//流程引擎附加组件，在全省范围内选择处理人
define(['jquery', 'vue'], function ($, Vue) {
    return Vue.component('peac-user', {
        props: {},
        data: function () {
            return {
                text: '',
                value: ''
            }
        },
        template: '<div class="nowrap">\
                        <label>选择处理人</label>\
                        <popup-input popup-url="../popup/select-user.html" :text.sync="text" :value.sync="value"\
                         popup-title="请选择" popup-width="500px" popup-height="450px"></popup-input>\
                    </div>',
        created: function () {
        },
        mounted: function () {
        },
        watch: {},
        computed: {},
        methods: {
            verifyValue: function () {
                //可以允许不选值，根据业务自行设计组件
                if(this.value == undefined || this.value == '') {
                    // alert('请选择处理人。');
                    layer.confirm('请选择处理人。',
                        {title:'提示',btn: ['确定'],closeBtn: 0 },
                        function(index){
                            layer.close(index);
                        });
                    return false;
                }
                return true;
            },
            getValue: function () {
                return this.value + '::' + this.text;
            }
        }
    });
});
