From 48d0a5c1db6f825e38d77de9850434fecaae2636 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 23 Mar 2017 08:53:25 +0800 Subject: [PATCH] svg --- demo/js/config/widget.js | 8 ++ demo/js/widget/demo.pathchooser.js | 177 ++++++++++++++++++++++++++++ demo/js/widget/demo.relationview.js | 65 ++++++++++ 3 files changed, 250 insertions(+) create mode 100644 demo/js/widget/demo.pathchooser.js create mode 100644 demo/js/widget/demo.relationview.js diff --git a/demo/js/config/widget.js b/demo/js/config/widget.js index 414d0459e2..b8051a4813 100644 --- a/demo/js/config/widget.js +++ b/demo/js/config/widget.js @@ -5,4 +5,12 @@ Demo.WIDGET_CONFIG = [{ pId: 4, text: "bi.multi_select_combo", value: "demo.multi_select_combo" +}, { + pId: 4, + text: "bi.path_chooser", + value: "demo.path_chooser" +}, { + pId: 4, + text: "bi.relation_view", + value: "demo.relation_view" }]; \ No newline at end of file diff --git a/demo/js/widget/demo.pathchooser.js b/demo/js/widget/demo.pathchooser.js new file mode 100644 index 0000000000..620c259806 --- /dev/null +++ b/demo/js/widget/demo.pathchooser.js @@ -0,0 +1,177 @@ +/** + * Created by User on 2017/3/22. + */ +Demo.PathChooser = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-path-chooser" + }, + render: function () { + var pathchooser = BI.createWidget({ + type: "bi.path_chooser", + width: 800, + height: 400, + items: // [ + // [{region: "区域X", value: "X1"}, + // {region: "区域Q", value: "Q"}, + // {region: "区域A", value: "A"}, + // {region: "区域B", value: "B"}, + // {region: "区域D", value: "D"}, + // {region: "区域E", value: "E"}, + // {region: "区域G", value: "G"}, + // {region: "区域I", value: "I"}, + // {region: "区域J", value: "J"}], + // [{region: "区域X", value: "X"}, + // {region: "区域Q", value: "Q"}, + // {region: "区域A", value: "A"}, + // {region: "区域B", value: "B"}, + // {region: "区域C", value: "C"}, + // {region: "区域D", value: "D"}, + // {region: "区域E", value: "E"}, + // {region: "区域G", value: "G"}, + // {region: "区域I", value: "I"}, + // {region: "区域J", value: "J"}], + // [{region: "区域X", value: "X"}, + // //{region: "区域Q", value: "Q"}, + // {region: "区域A", value: "A"}, + // {region: "区域C", value: "C"}, + // {region: "区域D", value: "D"}, + // {region: "区域E", value: "E"}, + // {region: "区域G", value: "G"}, + // {region: "区域I", value: "I"}, + // {region: "区域J", value: "J"}], + // [{region: "区域X", value: "X"}, + // {region: "区域Q", value: "Q"}, + // {region: "区域A", value: "A"}, + // {region: "区域B", value: "B"}, + // {region: "区域D", value: "D"}, + // {region: "区域E", value: "E1"}, + // {region: "区域H", value: "H"}, + // {region: "区域I", value: "I"}, + // {region: "区域J", value: "J"}], + // [{region: "区域X", value: "X"}, + // {region: "区域Q", value: "Q"}, + // {region: "区域A", value: "A"}, + // {region: "区域B", value: "B"}, + // {region: "区域C", value: "C"}, + // {region: "区域D", value: "D"}, + // {region: "区域E", value: "E1"}, + // {region: "区域H", value: "H"}, + // {region: "区域I", value: "I"}, + // {region: "区域J", value: "J"}], + // [{region: "区域X", value: "X"}, + // {region: "区域Q", value: "Q"}, + // {region: "区域A", value: "A"}, + // {region: "区域C", value: "C"}, + // {region: "区域D", value: "D"}, + // {region: "区域E", value: "E1"}, + // {region: "区域H", value: "H"}, + // {region: "区域I", value: "I"}, + // {region: "区域J", value: "J"}], + // [{region: "区域X", value: "X"}, + // {region: "区域Q", value: "Q"}, + // {region: "区域A", value: "A"}, + // {region: "区域B", value: "B"}, + // {region: "区域D", value: "D"}, + // {region: "区域F", value: "F"}, + // {region: "区域H", value: "H"}, + // {region: "区域I", value: "I"}, + // {region: "区域J", value: "J"}], + // [{region: "区域X", value: "X"}, + // {region: "区域Q", value: "Q"}, + // {region: "区域A", value: "A"}, + // {region: "区域B", value: "B"}, + // {region: "区域C", value: "C"}, + // {region: "区域D", value: "D"}, + // {region: "区域F", value: "F"}, + // {region: "区域H", value: "H"}, + // {region: "区域I", value: "I"}, + // {region: "区域J", value: "J"}], + // [{region: "区域X", value: "X", text: "X"}, + // {region: "区域Q", value: "Q", text: "Q"}, + // {region: "区域A", value: "A", text: "A"}, + // {region: "区域C", value: "C", text: "C"}, + // {region: "区域D", value: "D", text: "D"}, + // {region: "区域F", value: "F", text: "F"}, + // {region: "区域H", value: "H", text: "H"}, + // {region: "区域I", value: "I", text: "I"}, + // {region: "区域J", value: "J", text: "J"}] + //] + [[{ + "region": "8c4460bc3605685e", + "regionText": "采购订单XXX", + "text": "ID", + "value": "1" + }, { + "region": "0fbd0dc648f41e97", + "regionText": "采购订单", + "text": "学号", + "value": "3" + }, { + "region": "c6d72d6c7e19a667", + "regionText": "供应商基本信息", + "text": "ID", + "value": "5" + }], [{ + "region": "ed013e18cc7c8637", + "regionText": "采购订单XXX", + "text": "ID", + "value": "1" + }, { + "region": "153d75878431f8ee", + "regionText": "A3", + "text": "学号", + "value": "2" + }, { + "region": "3861fb024c7d7825", + "regionText": "采购订单", + "text": "学号", + "value": "3" + }, { + "region": "88e3e5071bd10bc5", + "regionText": "供应商", + "text": "ID", + "value": "4" + }, { + "region": "8476c77ab5c147e0", + "regionText": "供应商基本信息", + "text": "ID", + "value": "5" + }], [{ + "region": "f00f67fbb9fba6fe", + "regionText": "采购订单XXX", + "text": "ID", + "value": "1" + }, { + "region": "1e8badf5d5793408", + "regionText": "A3", + "text": "学号", + "value": "2" + }, { + "region": "de1ebd3d0986a294", + "regionText": "供应商基本信息", + "text": "ID", + "value": "5" + }]] + }); + pathchooser.setValue(); + return { + type: "bi.absolute", + items: [{ + el: pathchooser, + left: 100, + top: 100 + }, { + el: { + type: "bi.button", + text: "getValue", + handler: function () { + BI.Msg.toast(JSON.stringify(pathchooser.getValue())); + } + }, + left: 100, + bottom: 10 + }] + } + } +}); +$.shortcut("demo.path_chooser", Demo.PathChooser); \ No newline at end of file diff --git a/demo/js/widget/demo.relationview.js b/demo/js/widget/demo.relationview.js new file mode 100644 index 0000000000..af63e026b0 --- /dev/null +++ b/demo/js/widget/demo.relationview.js @@ -0,0 +1,65 @@ +/** + * Created by User on 2017/3/22. + */ +Demo.RelationView = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-relation-view" + }, + render: function () { + var relationview = BI.createWidget({ + type: "bi.relation_view", + items: [ + { + primary: { + region: "B", regionText: "比", regionTitle: "bbb", regionHandler: function () { + alert("a") + }, + + + title: "b2...", + value: "b2", text: "b2字段", + handler: function () { + alert("d") + } + }, + foreign: {region: "C", value: "c1", text: "c1字段"} + }, + { + primary: {region: "A", value: "a1", text: "a1字段"}, + foreign: {region: "C", value: "c2", text: "c2字段"} + }, + { + primary: {region: "C", value: "c3", text: "c3字段"}, + foreign: {region: "D", value: "d1", text: "d1字段"} + }, + { + primary: {region: "A", value: "a1", text: "a1字段"}, + foreign: {region: "B", value: "b1", text: "b1字段"} + }, + + { + primary: {region: "X", value: "x1", text: "x1字段"}, + foreign: {region: "Y", value: "y1", text: "y1字段"} + }, + { + primary: {region: "X", value: "x2", text: "x2字段"}, + foreign: {region: "Z", value: "z1", text: "z1字段"} + }, + { + primary: {region: "X", value: "x2", text: "x2字段"}, + foreign: {region: "B", value: "b1", text: "b1字段"} + }, + { + primary: {region: "X33", value: "x233", text: "x233字段"}, + } + ] + }); + return { + type: "bi.float_center_adapt", + items: [{ + el: relationview + }] + } + } +}); +$.shortcut("demo.relation_view", Demo.RelationView); \ No newline at end of file