<commit_before>define(['ku','alert','api','Sortable'],function (ku,msg,api,Sortable) {

    var fieldData = api.getFieldList();

    function init()
    {
        if(fieldData)
        {
            //渲染字段
            viewField(fieldData.data);

            var field_list = document.getElementById("field_list");
            var diy_design_field = document.getElementById("diy_design_field");

            Sortable.create(field_list, {
                group: {
                    name: 'field',
                    pull: 'clone',
                    put: false
                },
                sort: false,
            });

            // sort: false
            Sortable.create(diy_design_field, {
                group: {
                    name: 'field',
                    pull: false,
                    put: true
                },
                sort: true,
            });


        }else{
            msg.info('获取字段失败');
        }
    }


    /**
     * 渲染字段
     * @param v
     */
    function viewField(v)
    {
        //console.log(v);
        var h = '';
        for(var i=0;i < v.length;i++)
        {
            h+='<li>'+v[i].name+'</li>';
        }
        //console.log(h);
        $(".field_ul").empty().html(h);
    }

    return {
        init:init
    }


});<commit_msg>增加删除元素<commit_after>define(['ku','alert','api','Sortable'],function (ku,msg,api,Sortable) {

    var fieldData = api.getFieldList();

    function init()
    {
        if(fieldData)
        {
            //渲染字段
            viewField(fieldData.data);

            var field_list = document.getElementById("field_list");
            var diy_design_field = document.getElementById("diy_design_field");

            Sortable.create(field_list, {
                group: {
                    name: 'field',
                    pull: 'clone',
                    put: false
                },
                sort: false,
            });

            // sort: false
            Sortable.create(diy_design_field, {
                group: {
                    name: 'field',
                    pull: false,
                    put: true
                },
                sort: true,
            });

            $(".item").click(function(){
                $(this).find(".setB").empty().append('<span class="close del">×</span>');
                console.log(1);
            });
            //删除
            $(".del").click();
        }else{
            msg.info('获取字段失败');
        }
    }


    /**
     * 渲染字段
     * @param v
     */
    function viewField(v)
    {
        //console.log(v);
        var h = '';
        for(var i=0;i < v.length;i++)
        {
            h+='<li class="item">'+v[i].name+'<span class="setB"></span></li>';
        }
        //console.log(h);
        $(".field_ul").empty().html(h);
    }

    return {
        init:init
    }


});
{'fraction_non_alphanumeric': 0.15282623866015352, 'fraction_numerical': 0.00104675505931612, 'mean_word_length': 1.1284335560504826, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2440163', 'n_tokens_mistral': 861, 'n_tokens_neox': 840, 'n_words': 121}