dashboard.svc.js 1.92 KB
Newer Older
frank.xa.zhang's avatar
frank.xa.zhang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
// configuration web service proxy
webservices.factory('dashboardService', ['$http', 'apiConfig', function ($http, apiConfig) {
    'use strict';
    return {
        
        getChartSetting: function (chartId)
        {
            return $http.get('/Dashboard/ChartSetting/' + chartId, apiConfig.create());
        },

        removeChartSetting: function (chartId)
        {
            return $http.delete('/Dashboard/ChartSetting/' + chartId, apiConfig.create());
        },

        updateChartSortId: function(onechartId,anotherChartId){
            return $http.put('/Dashboard/ChartSort/' + onechartId + '/' + anotherChartId, {_:2}, apiConfig.create());
        },

        getChartData: function (chartType,projectList,yearList,monthList)
        {
            return $http.post('/Dashboard/ChartData/' + chartType, { PorjectIdList: projectList, ProjectYearList: yearList, MonthList: monthList }, apiConfig.create());
        },

        getRangeChartData: function (chartType, projectList, endDate, isMonth)
        {
            return $http.post('/Dashboard/RangeChartData/' + chartType, { PorjectIdList: projectList, EndDate: endDate, IsMonth: isMonth }, apiConfig.create());
        },

        saveSetting: function (chartId,chartName, chartType ,argumentField, valueField, showValue)
        {
            return $http.put('/Dashboard/ChartSetting/' + chartId, {Name: chartName, ChartTypeValue: chartType, ArgumentField: argumentField, valueField: valueField, ShowValue: showValue}, apiConfig.create())
        },

        getChartList: function ()
        {
            return $http.get('/Dashboard/ChartList', apiConfig.create());
        },

        getSystemChartList: function () {
            return $http.get('/Dashboard/systemcharts', apiConfig.create());
        },

        addUserChart: function (systemchartId) {
            return $http.get('/Dashboard/addUserChart/' + systemchartId, apiConfig.create());
        }
    };
}]);