/**
 * 获取任务日志
 */

var treeSetting = {
    async: {
        type: 'get',
        enable: true,
        url:treeListUrl
        //url: function(){
         //   return $("#task-tree").data('treeListUrl');
       // }
    },
    data: {
        key:{
            title:"title"
        },
        simpleData: {
            enable: true
        }
    },
    view: {
        showIcon: false,
        selectedMulti: false,
        fontCss: {
            color: "#005bb8"
        }
    },
}

//图片使用dialog查看
function imagePriview(img) {
	if (img == '') {
		return;
	}
	art.dialog({
		title: '图片查看',
		fixed: true,
		width: '600px',
		height: '420px',
		id: "image_priview",
		lock: true,
		background: "#CCCCCC",
		opacity: 0,
		content: '<img src="' + img + '" />',
		time: 5
	});
}


jQuery(function($) {

    //及时设置任务状态
    $(".task-status-select").on('change',function(){
        if (!confirm('确定要改变状态？')) {
            return false;
        }
        var statusId = $(this).find('option:selected').val();
        var url = $(this).data('setUrl');
        url += statusId;
        $.getJSON(url, function(json){
            if (json.status == 1) {
                $(".task-status").html(json.status_name);
                artDialog.tips('状态修改成功');
            }
            else {
                alert(json.info);
            }

        });
    });
    

    //调取左侧树
    $.fn.zTree.init($("#task-tree"), treeSetting);

});
