<template>
  <div class="page-content">
    <div class="add-meeting" :class="disabledFlag ? 'detailClass2' : 'detailClass1'">
      <van-form @submit="onSubmit" validate-trigger="onSubmit">
        <van-field name="meetingTitle" v-model="popObj.meetingTitle" label="会议标题"
          :placeholder="disabledFlag ? '' : '请输入会议标题'" :required="true"
          :rules="[{ required: true, message: '请填写会议标题' }]" :disabled="disabledFlag" />
        <van-field clickable name="sysDay" v-model="popObj.sysDay" label="会议日期"
          :placeholder="disabledFlag ? '' : '点击选择日期'" @click="popObj.handleShowPop4('sysDay', '选择日期', 4)"
          :required="true" :rules="[{ required: true, message: '请选择会议日期' }]" readonly :disabled="disabledFlag" />
        <van-popup v-model:show="popObj.showPop4" position="bottom">
          <van-date-picker v-model="popObj.value4" :title="popObj.popTitle" @confirm="popObj.onConfirm4($event)"
            @cancel="popObj.showPop4 = false" />
        </van-popup>
        <van-field clickable name="sysTime" v-model="popObj.sysTime" label="会议时间"
          :placeholder="disabledFlag ? '' : '点击选择时间'" @click="popObj.handleShowPop4('sysTime', '会议时间', 5)"
          :required="true" :rules="[{ required: true, message: '请选择会议时间' }]" readonly :disabled="disabledFlag" />
        <van-popup v-model:show="popObj.showPop5" position="bottom">
          <van-time-picker v-model="popObj.value5" :title="popObj.popTitle" @confirm="popObj.onConfirm4($event)"
            @cancel="popObj.showPop5 = false" />
        </van-popup>
        <van-field clickable name="meetingTypeName" v-model="popObj.meetingTypeName" label="会议类型"
          :placeholder="disabledFlag ? '' : '点击选择会议类型'" @click="popObj.handleShowPop1('meetingType', '会议类型')"
          :required="true" :rules="[{ required: true, message: '请选择会议类型' }]" readonly :disabled="disabledFlag" />
        <van-popup v-model:show="popObj.showPop1" position="bottom">
          <van-picker show-toolbar :title="popObj.popTitle" :columns="popObj[`${popObj.type}List`]"
            @confirm="popObj.onConfirm1($event)" @cancel="popObj.showPop1 = false" v-model="popObj.value1" />
        </van-popup>
        <van-field clickable name="meetingByName" v-model="popObj.meetingByName" label="会议形式"
          :placeholder="disabledFlag ? '' : '点击选择会议形式'" @click="popObj.handleShowPop1('meetingBy', '会议形式')"
          :required="true" :rules="[{ required: true, message: '请选择会议形式' }]" readonly :disabled="disabledFlag" />
        <div v-for="(item, index) in popObj.stockCodeList" :key="index">
          <van-field clickable name="text" v-model="item.text" :label="`股票代码${index + 1}`"
            :placeholder="disabledFlag ? '' : '点击选择股票'" @click="popObj.handleShowPop6('stockCode', '股票', index)"
            type="text" autosize readonly :right-icon="disabledFlag ? '' : 'close'"
            @click-right-icon.stop="popObj.deleteItemByType('stockCode', index)" :disabled="disabledFlag" />
        </div>
        <van-field clickable name="newItem" v-model="newItem" label="股票代码" placeholder="点击新增股票"
          @click="popObj.handleShowPop6('stockCode', '股票', -1)" readonly v-show="!disabledFlag" />
        <van-popup v-model:show="popObj.showPop2" position="bottom">
          <van-field v-model="popObj.searchValue" :placeholder="'请输入' + popObj.popTitle"
            @input="popObj.onSearchInput" />
          <van-picker show-toolbar :title="popObj.popTitle" :columns="popObj.showPop2List"
            @confirm="popObj.onConfirm2($event)" @cancel="popObj.showPop2 = false" />
        </van-popup>
        <div v-for="(item, index) in popObj.meetingGuestList" :key="index">
          <van-field clickable name="text" v-model="item.text" :label="`嘉宾${index + 1}`"
            :placeholder="disabledFlag ? '' : '点击选择宾'" @click="popObj.handleShowPop6('meetingGuest', '嘉宾', index)"
            type="text" autosize readonly :right-icon="disabledFlag ? '' : 'close'"
            @click-right-icon.stop="popObj.deleteItemByType('meetingGuest', index)" :disabled="disabledFlag" />
        </div>
        <van-field clickable name="newItem" v-model="newItem" label="嘉宾" placeholder="点击新增嘉宾"
          @click="popObj.handleShowPop6('meetingGuest', '嘉宾', -1)" readonly v-show="!disabledFlag" />
        <van-field clickable name="linkFromName" v-model="popObj.linkFromName" label="发起人"
          :placeholder="disabledFlag ? '' : '点击添加发起人'" @click="popObj.handleShowPop5('linkFrom', '发起人')" readonly
          :disabled="disabledFlag" />
        <van-popup v-model:show="popObj.showPop6" position="bottom">
          <div class="p-16 box-popup">
            <van-row class="mb-16">
              <van-col span="8">
                <van-button class="van-picker__cancel" native-type="button"
                  @click="popObj.showPop6 = false">取消</van-button>
              </van-col>
              <van-col span="8" class="text-center">
                <span class="sub-title f-b">请选择{{ popObj.popTitle }}</span>
              </van-col>
              <van-col span="8" class="text-end">
                <van-button class="van-picker__confirm" native-type="button" @click="popObj.onConfirm5">确认</van-button>
              </van-col>
            </van-row>
            <van-radio-group v-model="popObj.linkFrom" @click="popObj.changeLinkFrom">
              <van-radio :name="1">
                <div class="d-flex align-items-center">
                  <div class="radioLabel">机构人员</div>
                  <van-field class="flex-1 radioContent1 border-1 ms-10" v-model="popObj.linkFromField"
                    placeholder="录入发起人" :disabled="popObj.linkFrom !== 1" />
                </div>
              </van-radio>
              <van-radio :name="2" class="align-items-start-radio">
                <div class="d-flex align-items-start mt-10">
                  <div class="radioLabel">第一上海</div>
                  <div class="flex-1 radioContent2">
                    <van-radio-group class="ms-10" v-model="popObj.linkFromRadio" direction="horizontal"
                      :disabled="popObj.linkFrom !== 2">
                      <van-radio v-for="(item, index) in popObj.linkFromList" :key="index" :name="item.userId">
                        {{ item.userName }}
                      </van-radio>
                    </van-radio-group>
                  </div>
                </div>
              </van-radio>
            </van-radio-group>
          </div>
        </van-popup>
        <van-field name="phoneBy" v-model="popObj.phoneBy" label="电话拨入方式" :placeholder="disabledFlag ? '' : '请输入电话拨入方式'"
          :disabled="disabledFlag" />
        <van-field name="netBy" v-model="popObj.netBy" label="网络端登录方式" :placeholder="disabledFlag ? '' : '请输入网络端登录方式'"
          :disabled="disabledFlag" />
        <van-field v-if="popObj.netBy" name="meetingPassword" v-model="popObj.meetingPassword" label="会议密码"
          placeholder="请输入会议密码" :disabled="disabledFlag" />
        <van-field clickable name="organizerNames" v-model="popObj.organizerNames" label="相关研究员"
          :placeholder="disabledFlag ? '' : '点击选择相关研究员'" @click="popObj.handleShowPop3('organizer', '相关研究员')" readonly
          :disabled="disabledFlag" />
        <van-popup v-model:show="popObj.showPop3" position="bottom">
          <div class="p-16 box-popup">
            <van-row class="mb-16">
              <van-col span="8">
                <van-button class="van-picker__cancel" native-type="button"
                  @click="popObj.showPop3 = false">取消</van-button>
              </van-col>
              <van-col span="8" class="text-center">
                <span class="sub-title f-b">请选择{{ popObj.popTitle }}</span>
              </van-col>
              <van-col span="8" class="text-end">
                <van-button class="van-picker__confirm" native-type="button" @click="popObj.onConfirm3">确认</van-button>
              </van-col>
            </van-row>
            <van-checkbox-group v-model="popObj.value3" direction="horizontal">
              <van-checkbox v-for="(item, index) in popObj[`${popObj.type}List`]" :key="index" :name="item.value"
                shape="square">
                {{ item.text }}
              </van-checkbox>
            </van-checkbox-group>
          </div>
        </van-popup>
        <van-field name="content" v-model="popObj.content" label="备注" rows="3" type="textarea" autosize
          :disabled="disabledFlag" />
        <van-field clickable name="meetingByName" v-model="popObj.visibleName" label="可见范围"
          :placeholder="disabledFlag ? '' : '点击选择可见范围'" @click="popObj.handleShowPop1('visible', '可见范围')" readonly
          :disabled="disabledFlag" />
        <van-field v-if="popObj.selectvisible === '3'" clickable name="staffNames" v-model="popObj.staffNames"
          label="可见员工" :placeholder="disabledFlag ? '' : '点击选择可见员工'" @click="popObj.handleShowPop3('staff', '可见员工')"
          readonly :rules="[{ required: popObj.selectvisible === '3', message: '请选择可见员工' }]"
          :required="popObj.selectvisible === '3'" :disabled="disabledFlag" />
        <div class="m-16 d-flex justify-content-center">
          <van-button round block type="warning" size="small" native-type="button" @click="changeDisabled"
            v-if="meetingId">
            {{ disabledFlag ? '修改' : '取消' }}
          </van-button>
          <van-button v-show="!disabledFlag" round block type="primary" size="small" native-type="submit"
            :disabled="submitFlag">提交</van-button>
        </div>
      </van-form>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, reactive, onMounted, onUnmounted } from 'vue'
import emitter from '@/utils/mitt'
import {
  sysDicListByType, sysUserGetStaffAndManagerList, sysUserGetCompanyUserList, stockStockInfoLookUp,
  cusUserLookUp, workMeetingUpdateOrSave, workMeetingInfo, workMeetingUserList
} from '@/utils/api'
let submitFlag = ref(false)
let disabledFlag = ref(true)
let newItem = ref('')
let listIndex = ref(0)
let meetingId: any = ref('')
import { debounceThrottle } from '@/mixins/debounce-throttle'
const { throttle } = debounceThrottle()
import { type MeetingObj } from '@/utils/types'
const popObj: MeetingObj = reactive({
  showPop1: false,
  showPop2: false,
  showPop3: false,
  showPop4: false,
  showPop5: false,
  showPop6: false,
  popTitle: '',
  type: '',
  value1: [],
  value3: [],
  meetingTitle: '',
  sysDay: '',
  selectsysDay: [],
  sysTime: '',
  selectsysTime: [],
  meetingTypeName: '',
  selectmeetingType: '',
  meetingTypeList: [],
  meetingByName: '',
  selectmeetingBy: '',
  meetingByList: [],
  stockCodeList: [],
  searchValue: '',
  showPop2List: [],
  meetingGuestList: [],
  linkFromName: '',
  linkFrom: 1,
  linkFromRadio: '',
  linkFromField: '',
  linkFromList: [],
  phoneBy: '',
  netBy: '',
  meetingPassword: '',
  organizerNames: '',
  selectorganizerIds: [],
  organizerList: [],
  content: '',
  visibleName: '公开',
  selectvisible: '1',
  visibleList: [{
    value: '1',
    text: '公开'
  }, {
    value: '3',
    text: '员工'
  }],
  staffNames: '',
  staffList: [],
  selectstaffIds: [],
  handleShowPop1: (val: string, title: string) => {
    if (!disabledFlag.value) {
      popObj.showPop1 = true
      popObj.popTitle = title
      popObj.type = val
      popObj.value1 = [popObj[`select${val}`]]
    }
  },
  handleShowPop3: (val: string, title: string) => {
    if (!disabledFlag.value) {
      popObj.showPop3 = true
      popObj.popTitle = title
      popObj.type = val
      popObj.value3 = popObj[`select${val}Ids`]
    }
  },
  handleShowPop4: (val: string, title: string, index: number) => {
    if (!disabledFlag.value) {
      popObj.popTitle = title
      popObj.type = val
      popObj[`value${index}`] = popObj[`select${val}`]
      popObj[`showPop${index}`] = true
    }
  },
  handleShowPop5: (val: string, title: string) => {
    if (!disabledFlag.value) {
      if (popObj.linkFrom === 1) {
        popObj.linkFromRadio = ''
        popObj.linkFromField = popObj.linkFromName
      } else {
        const index = popObj.linkFromList.findIndex((ele: any) => {
          return ele.userName === popObj.linkFromName
        })
        if (index > -1) {
          popObj.linkFromRadio = popObj.linkFromList[index].userId
        }
      }
      popObj.showPop6 = true
      popObj.popTitle = title
      popObj.type = val
    }
  },
  handleShowPop6: (val: string, title: string, index: number) => {
    if (!disabledFlag.value) {
      popObj.showPop2 = true
      popObj.popTitle = title
      popObj.type = val
      popObj.searchValue = index > -1 ?
        popObj[`${val}List`][index][`${val === 'stockCode' ? 'value' : 'cusUserName'}`] : ''
      popObj.showPop2List = index > -1 && popObj[`${val}List`][index].value ?
        [{ text: popObj[`${val}List`][index].text, value: popObj[`${val}List`][index].value }] : []
      listIndex.value = index
    }
  },
  onSearchInput: throttle(
    async () => {
      if (popObj.searchValue) {
        if (popObj.type === 'stockCode') {
          const { data } = await stockStockInfoLookUp({ stockCode: popObj.searchValue })
          popObj.showPop2List = data.map((ele: any) => {
            ele.text = `${ele.stockCode}【${ele.stockName}】`
            ele.value = ele.stockCode
            return ele
          })
        } else if (popObj.type === 'meetingGuest') {
          const { data } = await cusUserLookUp({ cusUserName: popObj.searchValue })
          popObj.showPop2List = data.map((ele: any) => {
            ele.text = `${ele.cusUserName}${ele.cusName ? '【' + ele.cusName + '】' : ''}`
            ele.value = ele.cusUserId
            return ele
          })
        }
      } else {
        popObj.showPop2List = []
      }
    },
    500
  ),
  deleteItemByType: (type: string, index: number) => {
    if (!disabledFlag.value) {
      popObj[`${type}List`].splice(index, 1)
    }
  },
  onConfirm1: ({ selectedOptions }) => {
    if (selectedOptions) {
      popObj[`select${popObj.type}`] = selectedOptions[0].value
      popObj[`${popObj.type}Name`] = selectedOptions[0].text
      if (popObj.type === 'meetingBy') {
        if (selectedOptions[0].value === '1') {
          popObj.phoneBy = '香港：852-3005-1318\n大陆：400-810-5222\n'
        } else if (selectedOptions[0].value == 2) {
          popObj.phoneBy = '+8675536550000\n+85230018898'
        } else {
          popObj.phoneBy = ''
        }
      }
    }
    popObj.showPop1 = false
  },
  onConfirm2: ({ selectedOptions }) => {
    if (selectedOptions && selectedOptions[0]) {
      if (listIndex.value > -1) {
        popObj[`${popObj.type}List`][listIndex.value].value = selectedOptions[0].value
        popObj.stockCodeList[listIndex.value][`${popObj.type === 'stockCode' ? 'stockName' : 'cusUserName'}`] =
          selectedOptions[0][`${popObj.type === 'stockCode' ? 'stockName' : 'cusUserName'}`]
        popObj[`${popObj.type}List`][listIndex.value].text = selectedOptions[0].text
      } else {
        let data: any = {
          value: selectedOptions[0].value,
          text: selectedOptions[0].text
        }
        if (popObj.type === 'stockCode') {
          data.stockName = selectedOptions[0].stockName
        } else if (popObj.type === 'meetingGuest') {
          data.cusUserName = selectedOptions[0].cusUserName
        }
        popObj[`${popObj.type}List`].push(data)
      }
      popObj.showPop2 = false
    } else {
      if (popObj.type === 'stockCode') {
        showToast(`请选择${popObj.popTitle}后，再确认`)
      } else {
        popObj.meetingGuestList.push({
          value: '',
          cusUserName: popObj.searchValue,
          text: popObj.searchValue
        })
        popObj.showPop2 = false
      }
    }
  },
  onConfirm3: () => {
    popObj[`select${popObj.type}Ids`] = popObj.value3
    const sameList = popObj[`${popObj.type}List`].filter((ele: any) => popObj.value3.some((res: any) => {
      return ele.value === res
    }))
    let names = ''
    sameList.forEach((ele: any) => {
      names += `${ele.text},`
    })
    if (names) {
      names = names.substring(0, names.length - 1)
    }
    popObj[`${popObj.type}Names`] = names
    popObj.showPop3 = false
  },
  onConfirm4: ({ selectedValues }) => {
    if (selectedValues) {
      popObj[popObj.type] = `${selectedValues[0]}${popObj.type === 'sysDay' ? '-' + selectedValues[1] + '-' + selectedValues[2] : ':' + selectedValues[1]}`
      popObj[`select${popObj.type}`] = selectedValues
    }
    if (popObj.type === 'sysDay') {
      popObj.showPop4 = false
    } else {
      popObj.showPop5 = false
    }
  },
  changeLinkFrom: () => {
    if (popObj.linkFrom === 1) {
      popObj.linkFromRadio = ''
    } else if (popObj.linkFrom === 2) {
      popObj.linkFromField = ''
    }
  },
  onConfirm5: () => {
    if (popObj.linkFrom === 1) {
      popObj.linkFromName = popObj.linkFromField
      popObj.linkFromRadio = ''
      popObj.showPop6 = false
    } else if (popObj.linkFrom === 2) {
      popObj.linkFromField = ''
      const index = popObj.linkFromList.findIndex((ele: any) => {
        return ele.userId === popObj.linkFromRadio
      })
      if (index > -1) {
        popObj.linkFromName = popObj.linkFromList[index].userName
        popObj.showPop6 = false
      } else {
        showToast('请选择发起人')
      }
    }
  }
})

import { useRoute, useRouter } from 'vue-router'
const route = useRoute()
const router = useRouter()
import moment from 'moment'
const getSelectList = async () => {
  emitter.emit('showLoading', '')
  const data1 = await sysDicListByType({ dicType: 'meeting_type' })
  popObj.meetingTypeList = data1.data.map((ele: any) => {
    ele.text = ele.dicValue
    ele.value = ele.dicKey
    return ele
  })
  const data2 = await sysDicListByType({ dicType: 'meeting_by' })
  popObj.meetingByList = data2.data.map((ele: any) => {
    ele.text = ele.dicValue
    ele.value = ele.dicKey
    return ele
  })
  const data3 = await sysUserGetStaffAndManagerList()
  popObj.organizerList = data3.data.map((ele: any) => {
    ele.value = ele.userId
    ele.text = ele.userName
    return ele
  })
  const data4 = await sysUserGetCompanyUserList()
  popObj.staffList = data4.data.map((ele: any) => {
    ele.value = ele.userId
    ele.text = ele.userName
    return ele
  })
  popObj.linkFromList = data4.data
  if (route.query && route.query.addDay) {
    disabledFlag.value = false
    popObj.sysDay = route.query.addDay
    popObj.selectsysDay = popObj.sysDay.split('-')
    popObj.sysTime = '08:00'
    popObj.selectsysTime = ['08', '00']
    emitter.emit('hiddenLoading', '')
  } else if (route.query && route.query.meetingId) {
    disabledFlag.value = true
    meetingId.value = route.query.meetingId
    getMeeingInfo()
    emitter.emit('setTitle', { title: '修改会议', type: 'meetingType' })
  } else {
    disabledFlag.value = false
    let nowDay = moment().format('YYYY-MM-DD')
    popObj.sysDay = nowDay
    popObj.selectsysDay = nowDay.split('-')
    popObj.sysTime = '08:00'
    popObj.selectsysTime = ['08', '00']
    emitter.emit('setTitle', { title: '新增会议', type: 'meetingType' })
    emitter.emit('hiddenLoading', '')
  }
}

const getMeeingInfo = async () => {
  const { data } = await workMeetingInfo(meetingId.value)
  popObj.meetingTitle = data.meetingTitle
  popObj.sysDay = data.meetingTime.slice(0, 10)
  popObj.selectsysDay = data.meetingTime.split('-')
  popObj.sysTime = data.meetingTime.slice(11, 16)
  popObj.selectsysTime = data.meetingTime.split(':')
  popObj.meetingTypeName = data.meetingTypeName
  popObj.selectmeetingType = data.meetingType + ''
  popObj.meetingByName = data.meetingByName
  popObj.selectmeetingBy = data.meetingBy + ''
  let codeList = data.stockCodes ? data.stockCodes.split(',') : []
  let nameList = data.stockNames ? data.stockNames.split(',') : []
  popObj.stockCodeList = codeList.map((ele: any, index: number) => {
    return {
      value: ele,
      text: `${ele}${nameList.length > index ? '【' + nameList[index] + '】' : ''}`,
      stockName: nameList.length > index ? nameList[index] : '',
    }
  })
  let guestNameList = data.meetingGuestNames ? data.meetingGuestNames.split(',') : []
  let guestIdList = data.meetingGuestIds ? data.meetingGuestIds.split(',') : []
  popObj.meetingGuestList = guestNameList.map((ele: any, index: number) => {
    return {
      value: guestIdList.length > index ? guestIdList[index] : '',
      text: ele,
      cusUserName: ele,
    }
  })
  popObj.linkFrom = data.oranizerId && data.oranizerId !== -1 ? 2 : 1
  popObj.linkFromName = data.oranizerName
  popObj.phoneBy = data.phoneBy
  popObj.netBy = data.netBy
  popObj.meetingPassword = data.meetingPassword
  popObj.organizerNames = data.oranizerName
  popObj.selectorganizerIds = data.oranizerId ? data.oranizerId.split(',').map(Number) : []
  popObj.content = data.content
  popObj.visibleName = data.visible === 1 ? '公开' : '员工'
  popObj.selectvisible = data.visible + ''
  if (data.visible === 3) {
    getVisible()
  }
  emitter.emit('hiddenLoading', '')
}

const getVisible = async () => {
  const { data } = await workMeetingUserList({ meetingId: meetingId.value })
  let staffNames = ''
  let selectstaffIds: any = []
  data.forEach((ele: any, index: number) => {
    staffNames += `${ele.userName}${index < data.length - 1 ? ',' : ''}`
    selectstaffIds.push(ele.userId)
  })
  popObj.staffNames = staffNames
  popObj.selectstaffIds = selectstaffIds
}

const handleKeyUp = (event: KeyboardEvent) => {
  if (event.key === 'Enter') {
    event.preventDefault()
  }
}

onMounted(() => {
  window.addEventListener('keyup', handleKeyUp)
})

onUnmounted(() => {
  window.removeEventListener('keyup', handleKeyUp)
})

import listRefreshInfoStore from '@/stores/listRefreshInfo'
const listRefreshInfo = listRefreshInfoStore()
const onSubmit = async () => {
  submitFlag.value = true
  let stockCodeList: any = []
  popObj.stockCodeList.forEach((ele: any) => {
    if (ele.value) {
      stockCodeList.push({
        stockCode: ele.value,
        stockName: ele.stockName
      })
    }
  })
  let meetingGuestList: any = []
  popObj.meetingGuestList.forEach((ele: any) => {
    if (ele.cusUserName) {
      meetingGuestList.push({
        cusUserId: ele.value || -1,
        cusUserName: ele.cusUserName
      })
    }
  })
  const res: any = {
    meetingTitle: popObj.meetingTitle,
    meetingTime: `${popObj.sysDay} ${popObj.sysTime}:00`,
    meetingType: popObj.selectmeetingType,
    meetingBy: popObj.selectmeetingBy,
    stockCodeList: stockCodeList || [],
    meetingGuestList: meetingGuestList || [],
    linkFrom: popObj.linkFromName || null,
    linkFromId: popObj.linkFrom === 2 && popObj.linkFromRadio ? popObj.linkFromRadio : null,
    phoneBy: popObj.phoneBy || null,
    netBy: popObj.netBy || null,
    meetingPassword: popObj.netBy && popObj.meetingPassword ? popObj.meetingPassword : null,
    organizerIdList: popObj.selectorganizerIds || [],
    content: popObj.content || null,
    visible: popObj.selectvisible,
    userIdList: popObj.selectvisible === '3' ? popObj.selectstaffIds : [],
    meetingId: meetingId.value || null
  }
  const data: any = await workMeetingUpdateOrSave(meetingId.value, res)
  if (data.code === 0) {
    showToast('提交成功')
    if (meetingId.value) {
      listRefreshInfo.refreshId = meetingId.value
    } else {
      listRefreshInfo.addId = '1'
    }
    router.go(-1)
  } else {
    submitFlag.value = false
  }
}

const changeDisabled = () => {
  disabledFlag.value = !disabledFlag.value
  if (disabledFlag.value) {
    getMeeingInfo()
  }
}

getSelectList()
</script>

<style lang='scss' scoped>
.add-meeting {
  height: 100vh;
  overflow-y: auto;
}

.detailClass1 {
  .van-cell {
    margin: 12px 16px 0;
    width: calc(100vw - 32px);
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);

    @media screen and (min-width: 678px) {
      width: 646px;
    }
  }
}

.detailClass2 {
  .van-cell {
    margin: 0 16px;
    width: calc(100vw - 32px);
    box-shadow: 0 0;

    @media screen and (min-width: 678px) {
      width: 646px;
    }
  }
}

:deep(.van-field--disabled) .van-field__label {
  color: #646566;
}

:deep(.van-field__control:disabled) {
  -webkit-text-fill-color: #000 !important;
}

:deep(.van-field__control) {
  color: #000 !important;
}

:deep(.van-checkbox) {
  margin-right: 0 !important;
  width: 50%;
  margin-bottom: 5px;
}

:deep(.van-radio) {
  width: 100%;
}

.radioLabel {
  width: 60px;
}

.radioContent1 {
  max-width: 220px;
  margin-left: 10px !important;
}

.radioContent2 {
  max-height: 400px;
  overflow-y: auto;

  .van-radio {
    margin-right: 0 !important;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    width: 50%;
    margin-bottom: 5px;
  }
}

:deep(.align-items-start-radio) {
  align-items: flex-start !important;
  max-height: 300px;

  .van-radio__icon {
    margin-top: 10px;
  }
}

.van-radio-group {
  .van-cell {
    margin-top: 0;
  }
}

:deep(.ms-10) {
  .van-radio__icon {
    margin-top: 0;
  }
}
</style>
