Showing
1 changed file
with
28 additions
and
26 deletions
@@ -39,36 +39,38 @@ var ENUM = { | @@ -39,36 +39,38 @@ var ENUM = { | ||
39 | {en:"reject",cn:"互斥促销"}, | 39 | {en:"reject",cn:"互斥促销"}, |
40 | {en:"display",cn:"促销显示"},] | 40 | {en:"display",cn:"促销显示"},] |
41 | }; | 41 | }; |
42 | - | 42 | +//加载显示tab页内容 |
43 | +var loadTabHtml=function(columnname){ | ||
44 | + var default_html="<a href='#'>bad error</a>"; | ||
45 | + if (columnname === ENUM.tabName[0].en) {//baseinfo | ||
46 | + var html_baseinfo=$("#fm_baseInfo").html(); | ||
47 | + $("#tab_body").html(html_baseinfo); | ||
48 | + }else if(columnname === ENUM.tabName[1].en) {//condition | ||
49 | + var html_condition = $("#fm_condition").html()||default_html; | ||
50 | + $("#tab_body").html(html_condition); | ||
51 | + } else if(columnname === ENUM.tabName[2].en) {//operation | ||
52 | + var html_operation = $("#fm_operation").html()||default_html; | ||
53 | + $("#tab_body").html(html_operation); | ||
54 | + }else if(columnname === ENUM.tabName[3].en) {//limit | ||
55 | + var html_limit = $("#fm_limit").html()||default_html; | ||
56 | + $("#tab_body").html(html_limit); | ||
57 | + }else if(columnname === ENUM.tabName[4].en) {//reject | ||
58 | + // 加载促销列表 | ||
59 | + var html_promotions=$("#fm_reject").html(); | ||
60 | + $("#tab_body").html(html_promotions); | ||
61 | + rejectPromotions.init(); | ||
62 | + }else if(columnname === ENUM.tabName[5].en) {//display | ||
63 | + var html_display = $("#fm_display").html()||default_html; | ||
64 | + $("#tab_body").html(html_display); | ||
65 | + } | ||
66 | +} | ||
43 | //tab 页组件 | 67 | //tab 页组件 |
44 | var t = new common.tab2({ | 68 | var t = new common.tab2({ |
45 | el: "#basicTab", | 69 | el: "#basicTab", |
46 | active: 0, | 70 | active: 0, |
47 | click: function () { | 71 | click: function () { |
48 | var columnname = t.options.columns[t.options.active].name; | 72 | var columnname = t.options.columns[t.options.active].name; |
49 | - var default_html="<a href='#'>bad error</a>"; | ||
50 | - if (columnname === ENUM.tabName[0].en) {//baseinfo | ||
51 | - var html_baseinfo=$("#fm_baseInfo").html(); | ||
52 | - $("#tab_body").html(html_baseinfo); | ||
53 | - }else if(columnname === ENUM.tabName[1].en) {//condition | ||
54 | - var html_condition = $("#fm_condition").html()||default_html; | ||
55 | - $("#tab_body").html(html_condition); | ||
56 | - } else if(columnname === ENUM.tabName[2].en) {//operation | ||
57 | - var html_operation = $("#fm_operation").html()||default_html; | ||
58 | - $("#tab_body").html(html_operation); | ||
59 | - }else if(columnname === ENUM.tabName[3].en) {//limit | ||
60 | - var html_limit = $("#fm_limit").html()||default_html; | ||
61 | - $("#tab_body").html(html_limit); | ||
62 | - }else if(columnname === ENUM.tabName[4].en) {//reject | ||
63 | - // 加载促销列表 | ||
64 | - var html_promotions=$("#fm_reject").html(); | ||
65 | - $("#tab_body").html(html_promotions); | ||
66 | - rejectPromotions.init(); | ||
67 | - }else if(columnname === ENUM.tabName[5].en) {//display | ||
68 | - var html_display = $("#fm_display").html()||default_html; | ||
69 | - $("#tab_body").html(html_display); | ||
70 | - } | ||
71 | - | 73 | + loadTabHtml(columnname); |
72 | }, | 74 | }, |
73 | columns: [{ | 75 | columns: [{ |
74 | name: ENUM.tabName[0].en, | 76 | name: ENUM.tabName[0].en, |
@@ -96,5 +98,5 @@ var t = new common.tab2({ | @@ -96,5 +98,5 @@ var t = new common.tab2({ | ||
96 | display: ENUM.tabName[5].cn | 98 | display: ENUM.tabName[5].cn |
97 | }] | 99 | }] |
98 | }).init(ENUM.tab); | 100 | }).init(ENUM.tab); |
99 | - | ||
100 | - | 101 | +//默认加载 |
102 | +loadTabHtml(t.options.columns[t.options.active].name); |
-
Please register or login to post a comment