@auth
<div id="demand-div" class="d-none">
    <div class="container-fluid position-absolute" style="min-width:10px;z-index:300;top: 100px;">
        <div class="float-right position-absolute" style="right: 50px" >
            <button class="btn-circle btn-outline-primary" type="button" id="dropdownMenu2" data-toggle="dropdown" style="width: 45px;height: 45px"
                    aria-haspopup="true" aria-expanded="false">
                <span>提出<br/>问题</span>
            </button>
            <div class="dropdown-menu" aria-labelledby="dropdownMenu2">
                <button class="dropdown-item" type="button" @click="showAddDemand()">
                    提出问题
                </button>
                <a href={{url('demand/')}} class="dropdown-item">问题列表</a>
            </div>
        </div>
        <div v-if="ratio.ClaimCount" class="float-right position-absolute text-center" style="right: 50px;top:45px;width: 45px" >
            <span  :class="ratio.unClaimCount !== 0 ? 'text-danger':'text-success' " class="text-bold">@{{ ratio.unClaimCount }} / @{{ ratio.ClaimCount }}</span>
        </div>
    </div>

    <div class="modal" tabindex="-1" id="add-demand">
        <div class="modal-dialog modal-lg modal-dialog-centered">
            <div class="modal-content">
                <div class="modal-header">
                    <h4>问题详情添加</h4>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="form-group row">
                        <label for="add-demand-auth" class="col-sm-2 col-form-label text-right">问题可见权限</label>
                        <div class="col-sm-10 form-inline">
                            <select name="add-demand-auth" id="add-demand-auth" class="form-control col-sm-7"
                                    v-model="addDemand.authority_id"
                                    :class="demandErrors.authority_id?'is-invalid':''"
                                    @focus="demandErrors.authority_id!==null ? demandErrors.authority_id=null:''">
                                <option v-for="(authority,index) in authoritiesFilter" :value="authority.id">@{{ authority.alias_name }}</option>
                            </select>
                            <input type="text" class="form-control col-sm-3 ml-1" id="add-demand-auth-filter" @input="filterAuth($event)"
                                   placeholder="输入权限进行删选">
                            <div class="invalid-feedback" v-if="demandErrors.authority_id">
                                @{{ demandErrors.authority_id[0] }}
                            </div>
                        </div>
                    </div>

                    <div class="form-group row">
                        <label for="add-demand-type" class="col-sm-2 col-form-label text-right text-primary">问题类型&nbsp;*</label>
                        <div class="col-sm-10 form-inline">
                            <select name="add-demand-auth" id="add-demand-type" class="form-control col-sm-10"
                                    v-model="addDemand.type"
                                    :class="demandErrors.type?'is-invalid':''"
                                    @focus="demandErrors.type!==null ? demandErrors.type=null:''">
                                <option v-for="(type,index) in types" :value="type.name">@{{ type.value }}</option>
                            </select>
                            <div class="invalid-feedback" v-if="demandErrors.type">
                                @{{ demandErrors.type[0] }}
                            </div>
                        </div>
                    </div>

                    <div class="form-group row">
                        <label for="add-demand-description" class="col-sm-2 col-form-label text-right text-primary">问题描述&nbsp;*</label>
                        <div class="col-sm-10 form-inline">
                            <textarea  id="add-demand-description" class="form-control col-sm-10"
                                       v-model="addDemand.description"
                                      :class="demandErrors.description?'is-invalid':''"
                                      @focus="demandErrors.description!==null ? demandErrors.description=null:''"
                            ></textarea>

                            <div class="invalid-feedback" v-if="demandErrors.description">
                                @{{ demandErrors.description[0] }}
                            </div>
                        </div>
                    </div>


                    <div class="form-group row">
                        <label for="add-demand-file" class="col-sm-2 col-form-label text-right">上传文件</label>
                        <div class="col-sm-10 form-inline">
                            <input type="file" name="name" id="add-demand-file-create" class="form-control-file col-sm-10"
                                   placeholder="输入配置名称"
                                   :class="demandErrors.file?'is-invalid':''"
                                   @focus="demandErrors.file!==null ? demandErrors.file=null:''">
                            <div class="invalid-feedback" v-if="demandErrors.file">
                                @{{ demandErrors.file[0] }}
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" @click="createDemand">提交</button>
                </div>
            </div>

        </div>
    </div>
</div>
@endauth
