路徑D:\ireport365\ireport365.war\js\enduser\designer\vs-component-basic.js
添加時間軸 不用修改
~~~
{
name: "",
type: "timeAxis",
coverImage: contextPath + "/images/componenttypes/" + locale + "/basic/zh_b0080.png",
coverImageWidth: "50%",
tip: "時間軸"
},
~~~
不用修改
~~~
case "timeAxis":
a.sizeX = 4;
a.sizeY = 22;
break;
~~~
以下直接覆蓋 時間長了 里面不知道該哪兒了
~~~
vsPluginComponentModule.factory("$vcPlugin_basic_timeAxis", ["$vsPluginRegister", function (a) {
var b = {
//配置面板中顯示[數據]配置
showDataCategory: true,
//配置面板中顯示[標題]配置
showTitleCategory: true,
//配置面板中顯示[邊框]配置
showBorderCategory: true,
//配置面板中顯示[基本]配置
showBasicCategory: true,
//配置面板中顯示[浮動]配置
showFixedCategory: true,
//配置面板中顯示[事件]配置
showEventCategory: false,
init: function(scope, element, component, $compile){
scope.element = element;
scope.component = component;
//開啟頁面過濾
component.config.pageFilter = true;
//控件的圖形維度數量設置為1
scope.component.config.chartDimensionCount = 1;
component.config.selectedItem = null;
// component.config.fontColor = '#222';
// component.config.bgColor = '#F0F0F0';
// component.config.timeFontColor = '#FFF';
// component.config.timeBgColor = '#ff8800';
// component.config.timeColor = '#F0F0F0';
},
buildDataDescription: function (dataDescription, scope, element, component, $compile) {
// console.log(scope)
scope.$on(event_refreshBindingData, function (target, param) {
scope.$parent.queryConditionDimensions = true;
//如果刷新數據事件的發出者是當前控件,不處理本次通知
if(param.component != null && scope.component.id === param.component.id){
return;
}
// console.log(scope.component.config.datasourceConfig)
var dimensions = scope.component.config.datasourceConfig.dimensions;
var measures = scope.component.config.datasourceConfig.measures;
if (measures == null) {
measures = []
}
console.log(dimensions)
console.log(scope.$parent.queryConditionDimensions)
if (dimensions && dimensions.length > 0) {
scope.queryModelData({
eventParam: param,
dimensions: dimensions,
measures: measures,
tableKey: scope.component.config.datasourceConfig.metadataConfig.metadataTable.key,
onQuerySuccess: function (response) {
if (response.data.success) {
b.refreshChartView(scope, element, component, $compile)
} else {
toaster.error({
body: response.data.message
})
}
},
onError: function () {
toaster.error({
body: vsLang.connection_failed
})
}
})
}
});
},
refreshChartView: function(scope, element, component, $compile) {
var dimensions = component.config.datasourceConfig.dimensions;
// 設置2個維度
component.config.chartDimensionCount = 2
//從context中獲得控件數據
var data = component.context.data;
// console.log(data)
// console.log(dimensions)
var serieData = [];
var legendData = [];
for (var i = 0; i < data.length; i++) {
// console.log(data[i])
var dimValue = data[i][dimensions[dimensions.length - 1].name];
// console.log(dimValue)
var dimValue1 = data[i][dimensions[dimensions.length -2].name];
// console.log(dimValue1)
if (VSUtils.isEmpty(dimValue)) {
continue
}
if (VSUtils.isEmpty(dimValue1)) {
continue
}
serieData.push({
time: dimValue1,
contentList: dimValue
});
legendData.push(dimValue1)
}
if (serieData.length == 0) {
serieData = [""];
legendData = [""]
}
// console.log(serieData)
// 處理數據
// console.log($('#'+component.id+' .Creabine-TimeLine').html());
// 清空所有子節點
$('#'+component.id+' .Creabine-TimeLine').html('')
// $('#'+component.id+' .Creabine-TimeLine').html('123456789')
// 調用
var dom = $('#'+component.id+' .Creabine-TimeLine')
initElements(dom,serieData,true,'持續更新中',component);
},
buildChartDescription: function (h, f, c, e) {
var l = {
name: "time",
title: '時間軸',
groups: []
};
c.description.categories.push(l);
h.component = c;
h.calculateBackgroundSize = function (i) {
return f.width() > f.height() ? "auto 100%" : "100% auto"
};
var d = [];
d.push('<div class="timeLine"></div>')
var g = e(d.join(""))(h);
f.html(g);
// 初始化數據
var timeLineItemList = [
{
time:'2010',
contentList:[
'《鋼鐵俠1》',
'托尼·史塔克在恐怖分子追捕中受傷,在山洞中造出了第一副盔甲之后回到美國。',
]
},
{
time:'2010',
contentList:[
'《鋼鐵俠2》',
'托尼·史塔克公布了自己鋼鐵俠的身份,打造了代號“戰爭機器”的戰服。'
]
},
{
time:'2011',
contentList:[
'斯蒂夫·羅杰斯被一支石油勘探隊在北極發現,斯蒂夫被解凍隨即被送往紐約神盾局,尼克·弗瑞告訴斯蒂夫·羅杰斯他已經長眠了70年。',
]
},
{
time:'2012',
contentList:[
'《復仇者聯盟1》',
'洛基在其他惡役的協助下激活了立方體,尼克·弗瑞領導復仇者聯盟抵抗外來的入侵,大戰洛基。'
]
},
{
time:'2013',
contentList:[
'《鋼鐵俠3》',
'托尼·斯塔克的生活被強敵毀滅殆盡,無路可退的他必須依靠精良的高科技裝備以及過人才智,保護自己和身邊最親近的人,同時揪出真正的幕后元兇。',
]
},
{
time:'2014.12.0000',
contentList:[
'《美國隊長2: 冬日戰士》',
'復仇者聯盟兩年后, 神盾局出現九頭蛇內奸。斯蒂夫·羅杰斯帶領眾人挫敗敵人,并擊敗了寒冬戰士,發現他其實是自己多年前失蹤的好友巴蒂。'
]
},
{
time:'2015',
contentList:[
'《復仇者聯盟:奧創時代》',
'《蟻人》'
]
},
]
// console.log(f)
// console.log(c.id)
var r = new CreabineTimeline({
com:c,
root:g[0],
itemList:timeLineItemList,
startDirectionLeft: true,
endWords:'持續更新中',
})
// console.log(h)
l.groups.push({
name: "video",
title: {
text: "配置"
},
elements: [{
title: '時間字體顏色',
type: "colorpicker",
bind: "fontColor"
},
{
title: vsLang.width,
title: '時間背景顏色',
type: "colorpicker",
bind: "bgColor"
},
{
title: vsLang.offset_x,
title: '時間字體顏色',
type: "colorpicker",
bind: "timeFontColor"
},
{
title: vsLang.offset_y,
title: '時間背景顏色',
type: "colorpicker",
bind: "timeBgColor"
},{
title: vsLang.offset_y,
title: '軸線顏色',
type: "colorpicker",
bind: "timeColor"
},{
title: vsLang.table_main_columns,
type: "configSlide",
bind: "chartDimensionCount",
config: {
slideEnd: 20
}
}]
});
h.$watch("component.config.fontColor", function (w, u) {
var p = c.config;
p.fontColor = w;
h.$broadcast(event_refreshChartView, {})
});
h.$watch("component.config.bgColor", function (w, u) {
var p = c.config;
p.bgColor = w;
h.$broadcast(event_refreshChartView, {})
});
h.$watch("component.config.timeFontColor", function (w, u) {
var p = c.config;
p.timeFontColor = w;
h.$broadcast(event_refreshChartView, {})
});
h.$watch("component.config.timeBgColor", function (w, u) {
var p = c.config;
p.timeBgColor = w;
h.$broadcast(event_refreshChartView, {})
});
h.$watch("component.config.timeColor", function (w, u) {
var p = c.config;
p.timeColor = w;
h.$broadcast(event_refreshChartView, {})
});
h.$watch("component.config.chartDimensionCount", function (v, u) {
if (v != null && c.config.datasourceConfig.dimensions != null && c.config.chartDimensionCount <= c.config.datasourceConfig.dimensions.length) {
h.$parent.queryConditionDimensions = true;
h.$broadcast(event_refreshBindingData, {})
}
});
}
};
a.register("basic", "timeAxis", b);
return null
}]);
~~~
路徑D:\ireport365\ireport365.war\WEB-INF\classes\report-resource\design.js
同理 搜索代碼 替換吧
~~~
case "timeAxis":
var d = [];
d.push('<div class="timeLine"></div>')
var g = $compile(d.join(""))(scope);
element.html(g);
scope.$on(event_refreshBindingData, function (target, param) {
//如果刷新數據事件的發出者是當前控件,不處理本次通知
if(param.component != null && scope.component.id === param.component.id){
return;
}
// console.log(scope.component.config.datasourceConfig)
var dimensions = scope.component.config.datasourceConfig.dimensions;
var measures = scope.component.config.datasourceConfig.measures;
if(measures == null){
measures = [];
}
if (dimensions && dimensions.length > 0) {
scope.queryModelData({
eventParam: param,
dimensions: dimensions,
measures: measures,
tableKey: scope.component.config.datasourceConfig.metadataConfig.metadataTable.key,
onQuerySuccess: function (response) {
if (response.data.success) {
// console.log(response.data.success)
scope.refreshChartView(scope, element, component, $compile)
} else {
toaster.error({
body: response.data.message
})
}
},
onError: function () {
toaster.error({
body: vsLang.connection_failed
})
}
})
}
});
scope.refreshChartView = function(scope, element, component, $compile) {
var dimensions = component.config.datasourceConfig.dimensions;
//從context中獲得控件數據
var data = component.context.data;
// console.log(data)
// console.log(dimensions)
var serieData = [];
var legendData = [];
for (var i = 0; i < data.length; i++) {
// console.log(data[i])
var dimValue = data[i][dimensions[dimensions.length - 1].name];
// console.log(dimValue)
var dimValue1 = data[i][dimensions[dimensions.length -2].name];
// console.log(dimValue1)
if (VSUtils.isEmpty(dimValue)) {
continue
}
if (VSUtils.isEmpty(dimValue1)) {
continue
}
serieData.push({
time: dimValue1,
contentList: dimValue
});
legendData.push(dimValue1)
}
if (serieData.length == 0) {
serieData = [""];
legendData = [""]
}
// console.log(serieData)
// 處理數據
// console.log($('#'+component.id+' .Creabine-TimeLine').html());
// 清空所有子節點
$('#'+component.id+' .Creabine-TimeLine').html('')
// $('#'+component.id+' .Creabine-TimeLine').html('123456789')
// 調用
var dom = $('#'+component.id+' .Creabine-TimeLine')
initElements(dom,serieData,true,'持續更新中',component);
};
var timeLineItemList = [
{
time:'2010',
contentList:[
'《鋼鐵俠1》',
'托尼·史塔克在恐怖分子追捕中受傷,在山洞中造出了第一副盔甲之后回到美國。',
]
},
{
time:'2010',
contentList:[
'《鋼鐵俠2》',
'托尼·史塔克公布了自己鋼鐵俠的身份,打造了代號“戰爭機器”的戰服。'
]
},
{
time:'2011',
contentList:[
'斯蒂夫·羅杰斯被一支石油勘探隊在北極發現,斯蒂夫被解凍隨即被送往紐約神盾局,尼克·弗瑞告訴斯蒂夫·羅杰斯他已經長眠了70年。',
]
},
{
time:'2012',
contentList:[
'《復仇者聯盟1》',
'洛基在其他惡役的協助下激活了立方體,尼克·弗瑞領導復仇者聯盟抵抗外來的入侵,大戰洛基。'
]
},
{
time:'2013',
contentList:[
'《鋼鐵俠3》',
'托尼·斯塔克的生活被強敵毀滅殆盡,無路可退的他必須依靠精良的高科技裝備以及過人才智,保護自己和身邊最親近的人,同時揪出真正的幕后元兇。',
]
},
{
time:'2014.12.0000',
contentList:[
'《美國隊長2: 冬日戰士》',
'復仇者聯盟兩年后, 神盾局出現九頭蛇內奸。斯蒂夫·羅杰斯帶領眾人挫敗敵人,并擊敗了寒冬戰士,發現他其實是自己多年前失蹤的好友巴蒂。'
]
},
{
time:'2015',
contentList:[
'《復仇者聯盟:奧創時代》',
'《蟻人》'
]
},
]
new CreabineTimeline({
com:component,
root:g[0],
itemList:timeLineItemList,
startDirectionLeft: true,
endWords:'持續更新中',
})
break;
~~~
- video
- treemap
- mian.html文件注釋
- 配置項tab
- 配置項屬性
- internalRefreshAxisMdelData函數梳理
- 函數配置項-engine文件
- 替換數據源流程
- design.js
- 樹圖
- 下鉆 廢棄
- 人體圖
- 下鉆地圖
- 行列互轉
- 預覽樣式
- logo旁邊的報表名
- echarts 組件生成圖片
- 數據集樣式
- 頭部 黑色head
- 手機 ipad 圖片
- k線圖部分
- 平臺管理css樣式
- 目錄css和平板的邊距
- 設計頁-數據源-目錄
- 數據集 - 查看數據表 -按鈕和目錄樣式
- 報表列表頁按鈕css
- 角色管理頁按鈕css
- 推送通知按鈕css
- 子賬號按鈕css
- 數據連接
- openlayers地圖線路圖
- openlayers4_map_designer.js
- openlayers4_map_view.js
- 說明
- 常用圖標小bug
- echarts 氣泡地圖
- echarts 線路軌跡圖
- 導出pdf
- 可視化sql--css
- 表格滾動
- 主題色
- 時間軸
- 分享彈框
- 管理平臺header和菜單
- 報表平臺和菜單
- 初始化組件顏色
- 其他彈框
- olap分析樣式-廢棄
- 3d地圖柱狀圖
- 關系圖
- olap分析
- 地區地圖
- k線圖相關屬性設置
- 世界地圖
- 時間軸(new)
- 選擇省份下轉地圖
- 選擇省市飛線地圖
- 面積預警地圖默認顏色
- 組件覆層開關組件
- 汽車儀表盤bug
- 雷達圖bug修復不能分享的問題
- 餅狀 條形圖 自動播放
- 臨時用
- 自動輪播
- 方形元素 按鈕浮動報錯
- 面積預警地圖整合可選擇省市區
- 下鉆地圖添加返回按鈕
- 下鉆地圖修復預警bug
- 基本時間組件
- 添加時鐘組件
- 3d地球組件
- 盒須圖
- 組件加載動畫
- 報表背景漸變色
- 主題模板
- 沒用
- 3機房第三方組件
- 設計
- 分享
- 3d機房需要的靜態資源
- cesium地球需要的文件以及樣式
- cesium地球
- 設計頁
- 分享頁
- 圖標條形圖
- 世豪-前端代碼整理
- component.css 文件新添加
- 雜項
- index.jsp
- designer.css 樣式暫時不整理 里面比較雜
- vs-common.js 新加生成html2canvas pdf
- vs-component-basic.js 完
- vs-component-datasource.js 完
- vs-component-engine.js 完
- vs-component-widget-grid.js 完
- vs-component-widget-square.js 完
- vs-designer.js 完
- vs-designer-component.js 完
- vs-designer-report.js 完
- vs-designer-reportpage.js 完
- vs-component-echarts.js 完
- main.html 完
- component.html 新加組件設置頁模板
- 以前的報表頁設置控制器---做個記錄
- 大概修改過的代碼
- 2019-5-8 修改皮膚控制器
- 選擇模板
- 桑基圖2019-11-20
- bug 修正 2019-11-21
- 插圖柱狀圖
- cesiumchart組件
- gis 地圖 聯動 彈框 圖標
- 動態面積圖添加按鈕類配置項
- 玫瑰圖形組件
- cesium 圖形 和three.js 沖突的bug
- gis 地圖 默認圖層
- 網格標簽
- gis 點圖 值域
- gis 面圖 值域
- 按鈕圖標添加提示框
- 百度地圖
- 剩余的組件
- gulp說明文檔
- 色斑圖加透明