### C# Example: ImageView Service Implementation Source: https://github.com/757607106/deom/blob/main/VanGo完整文档.md This C# code defines a service class for the ImageView component within the VanGo framework. It inherits from PageService and implements the IImageViewService interface. The Initialize method is overridden, suggesting custom setup logic for the service associated with the ImageView functionality. ```csharp using VanGo.Application; namespace VanGoHome.Components { public class ImageViewService : PageService, IImageViewService { protected override void Initialize() { base.Initialize(); } } } ``` -------------------------------- ### Create IntroJS Guided Tour (JavaScript) Source: https://github.com/757607106/deom/blob/main/VanGo完整文档.md This JavaScript code demonstrates how to initiate an IntroJS guided tour. It configures tour labels for 'next', 'previous', 'skip', and 'done' actions. It also includes an 'onbeforeexit' hook to confirm user intent before exiting the tour. The `introJs()` function is assumed to be globally available. ```javascript $scope.doBeginIntro = function (sender, e) { introJs().setOptions({ nextLabel: '下一步', prevLabel: '上一步', skipLabel: '退出', doneLabel: "完成" }).start().onbeforeexit(function () { return confirm("确定学会了吗?"); }); }; ``` -------------------------------- ### HTML FileUpload with Example Image Source: https://github.com/757607106/deom/blob/main/VanGo完整文档.md This snippet demonstrates how to display an example image alongside the FileUpload component by providing a URL to an image using the 'exampleBg' attribute. It also includes descriptive text and event handlers for file changes and upload success. ```html ``` -------------------------------- ### HTML Example: ImageView Component Usage Source: https://github.com/757607106/deom/blob/main/VanGo完整文档.md This HTML snippet demonstrates the various ways to use the ImageView component. It showcases setting image sources, dimensions, applying CSS for styling (like circles and borders), and configuring hover and active states. It also includes examples of click events and associated buttons for dynamic image source manipulation. ```html

图片控件

显示图片

代码演示

src 设置图片地址,必须设置宽高属性(字体图标除外):width、height。 通过设置 hoverImage,在鼠标悬浮时改变图片;通过设置 activeImage,在鼠标悬浮时改变图片;通过设置 isActive,默认使用active的图片。 一些基本事件的用法。
``` -------------------------------- ### C# Ueditor Service Example Source: https://github.com/757607106/deom/blob/main/VanGo完整文档.md A C# example demonstrating a UeditorService that inherits from PageService within the VanGo.Application namespace. It includes a basic Initialize method override. ```csharp using VanGo.Application; namespace VanGoHome.Components { public class UeditorService : PageService, IUeditorService { protected override void Initialize() { base.Initialize(); } } } ``` -------------------------------- ### CSHARP PageService Base Class Example Source: https://github.com/757607106/deom/blob/main/VanGo完整文档.md A C# code example demonstrating a basic PageService implementation for components like LinkButtonService and HotKeyService. It shows the standard structure for initializing services within a C# project. ```csharp using VanGo.Application; namespace VanGoHome.Components { public class LinkButtonService : PageService, ILinkButtonService { protected override void Initialize() { base.Initialize(); } } } ``` ```csharp using VanGo.Application; namespace VanGoHome.Components { public class HotKeyService : PageService, IHotKeyService { protected override void Initialize() { base.Initialize(); } } } ``` -------------------------------- ### HTML Steps Component Examples Source: https://github.com/757607106/deom/blob/main/VanGo完整文档.md Demonstrates basic usage of the Steps component in HTML, showing horizontal steps with default and small sizes. It highlights how to set the current step and display descriptions. ```html

Steps 步骤条

引导用户按照流程完成任务的导航条

代码演示

设置 Steps 属性 direction="default" 和 size="small" 设置 Steps 属性 direction="vertical" 和 size="small" 设置 Step 属性 fontIcon="icon-user" 和 icon="Content/gridLoading2.gif
``` -------------------------------- ### HTML TextEdit Component with Addons Source: https://github.com/757607106/deom/blob/main/VanGo完整文档.md Shows how to enhance the TextEdit input with prefix and suffix elements, such as icons or text. This includes examples of using 'addonBefore' and 'addonAfter' for custom labeling and input structuring. ```html ``` -------------------------------- ### HTML Example: VanGo Tab Component with Card Style Source: https://github.com/757607106/deom/blob/main/VanGo完整文档.md This example demonstrates the VanGo Tab component configured with a 'card' type style. It illustrates how to set the active tab, tab position, and load content similarly to the basic tab, including iframe and internal page loading. ```html

自定义内容。。。

``` -------------------------------- ### JavaScript Ueditor Controller Examples Source: https://github.com/757607106/deom/blob/main/VanGo完整文档.md Demonstrates various methods for interacting with a Ueditor component in JavaScript, including getting and setting content, managing selection, and controlling editor state. This code is part of a VanGo module. ```javascript vango.module('components') .controller('components.ueditorCtrl', ['$scope', '$uiTool', function ($scope, $uiTool) { // 初始化事件 this.initialize = function () { }; // 关闭时事件 this.closing = function () { // 返回false的时候阻止当前关闭动作 }; // 关闭后事件 this.closed = function () { }; $scope.doClick1 = function (sender, e) { var html = $scope.testUeditor.getAllHtml(); alert(html); }; $scope.doClick2 = function (sender, e) { alert($scope.testUeditor.getContent()); }; $scope.doClick3 = function (sender, e) { $scope.testUeditor.setContent("欢迎使用VanGo"); }; $scope.doClick33 = function (sender, e) { $scope.testUeditor.setContent("欢迎使用VanGo", true); }; $scope.doClick4 = function (sender, e) { alert($scope.testUeditor.getContentTxt()); }; $scope.doClick5 = function (sender, e) { alert($scope.testUeditor.getPlainTxt()); }; $scope.doClick6 = function (sender, e) { alert($scope.testUeditor.hasContents()); }; $scope.doClick7 = function (sender, e) { $scope.testUeditor.focus(); }; $scope.doClick8 = function (sender, e) { alert($scope.testUeditor.getSelectionText()); }; $scope.doClick9 = function (sender, e) { var text = window.prompt("插入HTML代码"); $scope.testUeditor.insertHtml(text); }; $scope.doClick10 = function (sender, e) { $scope.testUeditor.setEnabled(); }; $scope.doClick11 = function (sender, e) { $scope.testUeditor.setDisabled(); }; $scope.doClick12 = function (sender, e) { $scope.testUeditor.setHide(); }; $scope.doClick13 = function (sender, e) { $scope.testUeditor.setShow(); }; $scope.doClick16 = function (sender, e) { alert($scope.testUeditor.isFocus()); }; $scope.doClick17 = function (sender, e) { $scope.testUeditor.blur(); }; $scope.doClick18 = function (sender, e) { alert($scope.testUeditor.getLocalData()); }; $scope.doClick19 = function (sender, e) { if (!$scope.testUeditor.clearlocaldata()) { alert("已清空草稿箱"); } }; }]); ``` -------------------------------- ### JavaScript Hidden Field Controller Example Source: https://github.com/757607106/deom/blob/main/VanGo完整文档.md This JavaScript code defines a controller for a hidden field component using the Vango framework. It includes methods for initialization, closing events, and handling click events to get and set hidden field values. ```javascript vango.module('components') .controller('components.hiddenFieldCtrl', ['$scope', '$uiTool', function ($scope, $uiTool) { // 初始化事件 this.initialize = function () { }; // 关闭时事件 this.closing = function () { // 返回false的时候阻止当前关闭动作 }; // 关闭后事件 this.closed = function () { }; $scope.doClick1 = function (sender, e) { vango.log.debug("隐藏域1的值为:" + $scope.hf1.get("value")); }; $scope.doClick2 = function (sender, e) { $scope.hf2.set("value", $scope.txt1.get("value")); }; $scope.doClick3 = function (sender, e) { vango.log.debug("隐藏域2的值为:" + $scope.hf2.get("value")); }; }]); ``` -------------------------------- ### Implement Intro Service (C#) Source: https://github.com/757607106/deom/blob/main/VanGo完整文档.md A C# class that implements the IIntroService interface and inherits from PageService. This service is designed to manage the functionality related to user introductory guides or tours within the application. It includes a base implementation for the Initialize method. ```csharp using VanGo.Application; namespace VanGoHome.Components { public class IntroService : PageService, IIntroService { protected override void Initialize() { base.Initialize(); } } } ``` -------------------------------- ### HTML Form Data Binding Example Source: https://github.com/757607106/deom/blob/main/VanGo完整文档.md This HTML snippet showcases a 'page' component used for data binding with various form elements. It includes fields for username, warehouse selection, invoice type, date, amount, adjustment, and comments. It also demonstrates buttons for getting form data, clearing, resetting, and validating data. ```html

Page 数据绑定

VanGo规定每一个页面的所有组件必须要放到Page组件里面,这是一个展示的页面级容器, 可以快速进行前后端数据绑定

代码演示

``` -------------------------------- ### Javascript Grid Initialization and Data Binding Example Source: https://github.com/757607106/deom/blob/main/VanGo完整文档.md This Javascript code demonstrates initializing a grid component, defining data sources, and setting up event handlers. It includes sample data generation for different grid configurations and custom formatter functions. Dependencies include '$scope', '$uiTool', and '$compile'. ```javascript vango.module('components') .controller('components.gridBasicCtrl', ['$scope', '$uiTool', '$compile', function ($scope, $uiTool, $compile) { // 初始化事件 this.initialize = function () { }; // 关闭时事件 this.closing = function () { }; // 关闭后事件 this.closed = function () { }; var gdnames = ["苹果", "香蕉", "西瓜", "榴莲", "芒果", "石榴", "火龙果", "葡萄", "橘子", "菠萝"]; $scope.dropData = [ { value: 1, text: "直销" }, { value: 2, text: "线下" }, { value: 3, text: "网店" } ]; $scope.dataSource1 = []; for (var i = 0; i < 10; i++) { $scope.dataSource1.push({ "gdcode": i + 1, "gdname": gdnames[i], "gdunit": "斤", "gdstock": parseInt(Math.random() * 1000), "gdprice": parseFloat((Math.random() * 30).toFixed(2)), }); } $scope.dataSource2 = []; for (var i = 0; i < 30; i++) { var innum1 = Math.floor(Math.random() * 50) + 100; var outnum1 = Math.floor(Math.random() * 30) + 50; var innum2 = Math.floor(Math.random() * 100) + 200; var outnum2 = Math.floor(Math.random() * 80) + 100; var total = innum1 + innum2 - outnum1 - outnum2; $scope.dataSource2.push({ "gdname": gdnames[i % 10], "innum1": innum1, "outnum1": outnum1, "innum2": innum2, "outnum2": outnum2, "total": total, "price": parseFloat((Math.random() * 30).toFixed(2)), "date": "2021-12-12", "saletype": Math.floor(Math.random() * 3) + 1, "image": vango.appPath + "Content/Images/logo.png", }); } $scope.doOnFormatter = function () { return "我是自定义内容!"; }; $scope.doOnselectorselected = function (sender, e) { var grid = $scope.grid; var rowData = grid.getSelectedRowData() || {}; var returnData = e.data.owerScope.returnRowData; var newRowData = rowData; newRowData["kfullname"] = returnData["kfullname"]; grid.modifySelectedRowData(newRowData); }; }]); ``` -------------------------------- ### JavaScript RadioList Controller and Event Handling Source: https://github.com/757607106/deom/blob/main/VanGo完整文档.md This JavaScript code defines a controller for a RadioList component, demonstrating how to initialize events, handle closing and closed states, and manage data. It includes examples for setting and getting values, toggling enabled and visible states, and handling change events. Dependencies include AngularJS and the Vango framework. ```javascript vango.module('components') .controller('components.radioListCtrl', ['$scope', '$uiTool', function ($scope, $uiTool) { // 初始化事件 this.initialize = function () { }; // 关闭时事件 this.closing = function () { // 返回false的时候阻止当前关闭动作 }; // 关闭后事件 this.closed = function () { }; // 默认的数据项的valueField的值是value、textField的值是text,一般就不要用其他的字段了 $scope.rdlData = [ { value: 1, text: '北京' }, { value: 2, text: '上海' }, { value: 3, text: '广州' }, { value: 4, text: '深圳' }, { value: 5, text: '成都' }, { value: 6, text: '杭州' } ]; // 通过设置disable属性来禁用此选项 $scope.rdlData2 = [ { value: 1, text: '北京', disable: true }, { value: 2, text: '上海' }, { value: 3, text: '广州', disable: true }, { value: 4, text: '深圳' }, { value: 5, text: '成都', disable: true }, { value: 6, text: '杭州' } ]; $scope.doSetValue = function () { //随机选中一项 var oldDdata = $scope.rdl01.get("value"); var data = (Math.floor(Math.random() * 6) + 1).toString(); while (data === oldDdata) { data = (Math.floor(Math.random() * 6) + 1).toString(); } //设置选中项 $scope.rdl01.set("value", data); }; $scope.doSetValue2 = function () { //随机选中一项 var oldDdata = $scope.rdl01.get("value"); var data = (Math.floor(Math.random() * 6) + 1).toString(); while (data === oldDdata) { data = (Math.floor(Math.random() * 6) + 1).toString(); } //设置选中项,并控制change事件触发 $scope.rdl01.setValue(data, true); }; $scope.doGetValue = function () { var tmpValue = $scope.rdl01.get("value"); vango.log.debug("当前选中value为: " + tmpValue); }; $scope.doGetText = function (sender, e) { var tmpText = $scope.rdl01.get("text"); vango.log.debug("当前选中text为: " + tmpText); }; $scope.doToggleEnable = function (sender, e) { // 获取当前状态 var enabledState = $scope.rdl01.get("enabled"); // 设置相反状态 $scope.rdl01.set("enabled", !enabledState); }; $scope.doToggleVisible = function (sender, e) { // 获取当前状态 var visibleState = $scope.rdl01.get("visible"); // 设置相反状态 $scope.rdl01.set("visible", !visibleState); }; $scope.doChanged = function (sender, e) { vango.log.debug("触发onchange事件!"); }; $scope.doGetIndex = function (sender, e) { //indexOf支持三种传入参数,并按照此顺序查找:1.对象({ value: 4, text: '深圳' });2.value(4);3.text("深圳") 推荐使用text形式进行定位 var type = Math.floor(Math.random() * 3) + 1; var tmp; switch (type) { case 1: tmp = $scope.rdl02.indexOf({ value: 4, text: '深圳' }); break; case 2: tmp = $scope.rdl02.indexOf(4); break; case 3: tmp = $scope.rdl02.indexOf("深圳"); break; default: } alert("item({ value: 4, text: '深圳' })的索引为:" + tmp); }; $scope.doClear = function (sender, e) { $scope.rdl02.clear(); }; $scope.doGetItems = function (sender, e) { var dataSource = $scope.rdl02.get('dataSource'); alert("数据源为:" + angular.toJson(dataSource, true)); }; $scope.doSetItems = function (sender, e) { var newdataSource = [ { value: 1, text: '纽约' }, { value: 2, text: '伦敦' }, { value: 3, text: '芝加哥' }, { value: 4, text: '渥太华' }, { value: 5, text: '悉尼' }, { value: 6, text: '莫斯科' } ]; $scope.rdl02.resetDataSource(newdataSource); }; }]); ``` -------------------------------- ### HTML HiddenField Component Usage Source: https://github.com/757607106/deom/blob/main/VanGo完整文档.md This HTML snippet demonstrates the usage of a 'hiddenfield' component, likely part of a web framework. It shows how to set a 'value' and 'vid' for the hidden field, and how to interact with it using buttons to retrieve its value. It also includes examples for dynamically setting and getting the hidden field's value in conjunction with a TextEdit component. ```html @{ Layout = null; }

HiddenField 隐藏文本域

保存数据的隐藏文本域

代码演示

获取默认设置的隐藏文本域的值。 动态获取或设置隐藏文本域的值。
``` -------------------------------- ### JavaScript Component Controller Example Source: https://github.com/757607106/deom/blob/main/VanGo完整文档.md Demonstrates a JavaScript controller for UI components, including initialization, event handling for buttons (toggling enabled state, click actions, visibility), micro-app loading/unloading using qiankun, loading spinners, skin changes, focus management, and modal dialogs. It utilizes the Vango framework and its associated tools. ```javascript vango.module('components') .controller('components.buttonCtrl', ['$scope', '$uiTool', function ($scope, $uiTool) { // 初始化事件 this.initialize = function () { }; // 加载完成事件 this.loaded = function () { }; // 关闭时事件 this.closing = function () { // 返回false的时候阻止当前关闭动作 }; // 关闭后事件 this.closed = function () { }; $scope.doToogleEnabled = function (sender, e) { var state = $scope.bt02.get("enabled"); $scope.bt02.set("enabled", !state); $scope.bt03.set("enabled", !state); $scope.bt04.set("enabled", !state); $scope.bt05.set("enabled", !state); }; $scope.doButtonClick = function (sender, e) { vango.log.debug("快捷键触发了!"); }; $scope.doButtonVisible = function (sender, e) { if ($scope.btn11.get("visible") == true) { $scope.btn11.set("visible", false); } else { $scope.btn11.set("visible", true); } }; var microApp = null; $scope.doLoadClick = function (sender, e) { var qiankun = window.qiankunjs; if (qiankun) { microApp = qiankun.loadMicroApp({ name: "taoyan", entry: "//192.168.1.131:3456", container: "#qiankunContainer", }); } }; $scope.doUnLoadClick = function (sender, e) { if (microApp) { microApp.unmount(); //microApp = null; } }; $scope.doMountClick = function (sender, e) { if (microApp) { microApp.mount(); } }; $scope.doDestroyClick = function (sender, e) { if (microApp) { microApp = null; } }; $scope.doLoading = function (sender, e) { $scope.load.set('loading', true) setTimeout(function () { $scope.load.set('loading', false) }, 3000) }; $scope.doChangeSkin = function (sender, e) { vango.skinChange('1', true) }; $scope.doChangeSkin2 = function (sender, e) { vango.skinChange('', true) }; $scope.doFocus = function (sender, e) { $scope.bt01.focus(); }; $scope.doButtonTimeOutClick = function (sender, e) { $scope.service.testA(); }; $scope.doButtonSetFormTitleClick = function (sender, e) { $scope.form.set("title", "我的名字变了,你发现了吗?"); }; $scope.openModal = function (sender, e) { $uiTool.showModal("Business/TcForm", null, { targetScope: $scope, resize: true, resizing: function (layer) { console.log(layer) } }); } }]); ``` -------------------------------- ### NumberEdit Component - HTML and JavaScript Usage Source: https://context7.com/757607106/deom/llms.txt Illustrates the NumberEdit component's configuration through HTML attributes for numeric inputs, including decimal precision, min/max values, default values, and formula support. JavaScript examples show how to set and get values, and how to implement formula calculations by binding change events. ```html ``` ```javascript // Set and get values $scope.quantity.set('value', 100); var qty = $scope.quantity.getValue(); // Returns number // Formula linking (calculate total automatically) $scope.quantity.bind('change', calculateTotal); $scope.unitPrice.bind('change', calculateTotal); function calculateTotal() { var qty = $scope.quantity.getValue(); var price = $scope.unitPrice.getValue(); $scope.totalAmount.set('value', qty * price); } // In Grid formula columns, formulas are automatic: // // Supports: +, -, *, /, parentheses ```