<!--pages/msg/push/index.wxml-->
<title-bar title="上报动态"></title-bar>
<scroll-view scroll-y refresher-enabled style="height: calc(100vh - {{topBarH}}px);">
  <view class="item">
    <!-- 标题 -->
    <view class="h-div v-center header">
      <text class="single"></text>
      <text class="title">工作标题</text>
    </view>
    <input data-type="title" class="put v-div h-center" placeholder="请输入标题" value="{{postData.title}}"></input>
    <!-- 类型 -->
    <view class="h-div v-center header">
      <text class="single"></text>
      <text class="title">工作类型</text>
    </view>
    <input catchtap="popModal" data-type="showTypePop" disabled class="put v-div h-center" placeholder="请选择" value="{{TypeData[postData.type-1]}}"></input>
    <!-- 内容 -->
    <view class="h-div v-center header">
      <text class="single"></text>
      <text class="title">工作内容</text>
    </view>
    <textarea bindinput="inputContent" value="{{postData.content}}" style="color: #333333;" class="put v-div" placeholder="请输入工作内容"></textarea>
    <!-- 时间 -->
    <view class="h-div v-center header">
      <text class="single"></text>
      <text class="title">工作时间</text>
    </view>
    <view class="filter">
      <picker mode="date" value="{{dateFilter}}" bindchange="bindDateChange">
        <view class="picker">
          选择时间: {{dateFilter}}
        </view>
      </picker>
    </view>
    <!-- 附件 -->
    <view wx:if="{{!isUserDetail}}" class="h-div v-center header">
      <text class="single"></text>
      <text class="title flex">附件</text>
      <text wx:if="{{!isDetail}}" catchtap="chooseFile" class="title cuIcon-roundadd" style="font-weight: normal;color: #5DA6F4;">添加附件</text>
    </view>
    <view catchtap="filePre" data-url="{{item.FilePath}}" wx:for="{{files}}" class="file h-div v-center">
      <text class="ellipsis flex">{{item.realfilename}}</text>
      <text wx:if="{{!isDetail}}" catchtap="deleteFile" data-id="{{item.SysDocumentId}}" class="cuIcon-delete cloud" style="color:red;"></text>
    </view>
  </view>
  <view class="space"></view>
</scroll-view>
<view class="option" wx:if="{{!isDetail}}">
  <view catchtap="pushMsg" class="btn">上报</view>
</view>

<!-- 选择通知类型 -->
<view class="cu-modal {{showTypePop?'show':''}}">
  <view class="cu-dialog pop" catchtap>
    <view class="cu-bar justify-end pop-header">
      <view class="content">选择工作类型</view>
      <view class="action" catchtap="popModal" data-type="showTypePop">
        <text class="cuIcon-close text-red"></text>
      </view>
    </view>
    <radio-group class="block" style="max-height: 50vh;overflow-y: scroll;">
      <view class="cu-list menu text-left">
        <view class="cu-item" wx:for="{{TypeData}}" wx:key>
          <label catchtap="typeChange" data-index="{{index}}" class="flex justify-between align-center flex-sub">
            <view class="flex-sub">{{item}}</view>
          </label>
        </view>
      </view>
    </radio-group>
  </view>
</view>