widget.js 5.45 KB
var self = new Vue({
    el:'#app',
    data(){
        return {
            search:'',
            projectId:null,
            userId:null,
            // 表格数据
            tabaledata:[
                {
                    xh:'1',
                    ajmc:'关于拍卖出让87.608亩国有建设用地使用权的请示(GX3-18-25)',
                    anlx:'批后',
                    zrdw:'高新分局',
                    ssqy:'高新',
                    ljr:'向小华',
                    djsh:'2020-07-05',
                    jssi:'2020-07-05',
                },
                {
                    xh:'2',
                    ajmc:'关于拍卖出让87.608亩国有建设用地使用权的请示(GX3-18-25)',
                    anlx:'批后',
                    zrdw:'高新分局',
                    ssqy:'高新',
                    ljr:'向小华',
                    djsh:'2020-07-05',
                    jssi:'2020-07-05',
                },
                {
                    xh:'3',
                    ajmc:'关于拍卖出让87.608亩国有建设用地使用权的请示(GX3-18-25)',
                    anlx:'批后',
                    zrdw:'高新分局',
                    ssqy:'高新',
                    ljr:'向小华',
                    djsh:'2020-07-05',
                    jssi:'2020-07-05',
                },
                {
                    xh:'4',
                    ajmc:'关于拍卖出让87.608亩国有建设用地使用权的请示(GX3-18-25)',
                    anlx:'批后',
                    zrdw:'高新分局',
                    ssqy:'高新',
                    ljr:'向小华',
                    djsh:'2020-07-05',
                    jssi:'2020-07-05',
                },
                {
                    xh:'5',
                    ajmc:'关于拍卖出让87.608亩国有建设用地使用权的请示(GX3-18-25)',
                    anlx:'批后',
                    zrdw:'高新分局',
                    ssqy:'高新',
                    ljr:'向小华',
                    djsh:'2020-07-05',
                    jssi:'2020-07-05',
                },
            ],
            isActive:1,
        }
    },
    methods:{
        handleSizeChange(){

        },
        handleCurrentChange(){},
        click(val){
            this.isActive = val
        },
        openHandleJumpUrl (flowId, itemTypeId, _stats = 'create') {
            // debugger
            var unique = this.uuid();
            let url = CONF_FRONT_SERVERURL + 'view/projecttask/detailproject.jsp?';
            url += 'stats=' + _stats;
            url += '&flowid=' + flowId;
            url += '&create=' + (this.projectId ? 1 : 0);
            url += '&projectid=' + (this.projectId || "");
            url += '&flowItemTypeId=' + (itemTypeId || "");
            url += '&uniquePath=' + unique;
            window.open(this.handleJumpUrl(url));
            this.addFlowUserCount(flowId);
        },
        addFlowUserCount (flowId) {
            if (flowId === null || flowId === undefined) {
                return false;
            }

            this.ajaxPromise({
                data: JSON.stringify({"flowId": flowId,"userId": this.userId}),
                contentType: "application/json",
                url: CONF_BACK_SERVERURL + "/mvc/flow/saveFlowUserCount.do"
            }).catch((error)=> {
                console.error(error);
            });
        },
        handleJumpUrl(url){
            var myid = "guid" + this.guid();
            var tempArr = url.split("?");
            var returnStr = tempArr[0] + "?guid=" + myid;
            var urlValue = tempArr[1];
            var cacheUrlValue = null;
            var data = {
                paramUrl:urlValue,
                ftoken:$.cookie('ftoken')
            };
            if(window.globalLocalCache){
                cacheUrlValue = window.globalLocalCache.AddCache(myid,"","",data);
            }
            return returnStr;
        },
        S4() {
            return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
        },
        guid() {
            return (this.S4()+this.S4()+"-"+this.S4()+"-"+this.S4()+"-"+this.S4()+"-"+this.S4()+this.S4()+this.S4());
        },
        uuid(){
            var s = [];
            var hexDigits = "0123456789abcdef";
            for (var i = 0; i < 36; i++) {
                s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
            }
            s[14] = "4";
            s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);
            s[8] = s[13] = s[18] = s[23] = "-";

            var uuid = s.join("");
            return uuid;
        },
        ajaxPromise(options) {
            return new Promise(function (resolve, reject) {
                if ( typeof options !== "object" ) {
                    return reject("参数错误!");
                }
                let _type = options.type || "POST";
                //'application/json'
                $.ajax({
                    type: _type,
                    url: options.url,
                    data: options.data,
                    dataType: options.dataType,
                    contentType: options.contentType,
                    headers: {"token":$.cookie('ftoken') },
                    success: function(result){
                        resolve(result);
                    },
                    error: function (error) {
                        reject(error);
                    }
                });
            })
        }
    }
})