<script setup>
import { ElMessage } from 'element-plus'
import ManageDepartment from '../qxgl/components/ManageDepartment.vue'
import XsDetailInfo from './components/XsDetailInfo.vue'
import JsDetailInfo from './components/JsDetailInfo.vue'
import JdDetailInfo from './components/JsDetailInfo.vue'
import {
  area_list,
  change_status,
  org_list,
  org_tree_list,
  role_area,
  role_list,
  role_school,
  school_list,
  user_detail,
  user_edit,
  user_list,
} from './api'
import xsform_data from './xsconfig.js'
import jsform_data from './jsconfig.js'
import { user } from '~/store/index'
import PrevIcon from '@/components/EpPagination/PrevIcon.vue'
import NextIcon from '@/components/EpPagination/NextIcon.vue'
const tableData = ref([])

const state_list = ref([
  {
    label: '启用',
    value: '0',
  },
  {
    label: '未启用',
    value: '-1',
  },
])

const total = ref(100)
const limit = ref(10)
const currentPage = ref(1)
const searchKey = ref('')
const initSearchKey = (val) => {
  searchKey.value = val
  initData()
}
function handleCurrentChange(val) {
  currentPage.value = val
  initData()
}
const ruleForm = ref({
  user_role_id: '',
  bm_id: '',
  status: '',
  uo_id_1: '',
  ue_ssqybh: '',
  ue_ssqymc: '',
})

const mineStatusValue = ref([])
let areaTotal = []
let areaAdminLength = false
initData()
function initData() {
  user_list({ page: 1, limit: 99999 }).then((res) => {
    if (res.code == 1) {
      areaTotal = []
      res.data.page_data.forEach((val) => {
        if (
          val.user_role_id >= 63
          && val.user_role_id <= 71
          && val.status == 0
        )
          areaTotal.push(val)
      })
      if (areaTotal.length >= 5)
        areaAdminLength = true
      else
        areaAdminLength = false

      console.log(areaTotal.length)
    }
  })
  const obj = {
    keyword: searchKey.value,
    limit: limit.value,
    page: currentPage.value,
    uo_id_1: mineStatusValue.value.join(','),
    user_role_id: ruleForm.value.user_role_id,
    uo_id_0: ruleForm.value.bm_id,
    status: ruleForm.value.status,
  }
  user_list(obj).then((res) => {
    if (res.code == 1) {
      tableData.value = []
      res.data.page_data.map((item) => {
        const obj = {
          user_id: item.user_id,
          user_realname: item.user_realname,
          user_role_name: item.user_role_name,
          ue_bmmc: item.user_ext.ue_bmmc,
          ue_sydw: item.user_ext.ue_sydw,
          ue_user_phone: item.user_ext.ue_user_phone,
          ue_user_email: item.user_ext.ue_user_email,
          regdate: item.regdate,
          user_role_id: item.user_role_id,
          ue_ssqybh: item.ue_ssqybh,
          ue_ssqymc: item.ue_ssqymc,
          area_info: item.area_info,
          sm_info: item.sm_info,
          newStatus: item.status != -1,
        }
        tableData.value.push(obj)
      })
      total.value = parseInt(res.data.total_rows)
    }
  })
}
const handleReset = (formEl) => {
  if (!formEl)
    return
  formEl.resetFields()
  initData()
}
const roleData = ref([])
const departmentData = ref([])
const sydwData = ref([])
const schoolData = ref([])
const areaData = ref([])
const treeData = ref([])
const jsformData = ref(jsform_data)
const xsformData = ref(xsform_data)
const deptData = ref([])
initKeyData()
async function initKeyData() {
  const res = await school_list({ area_id: '2615', limit: '100' })
  if (res.code == 1)
    schoolData.value = res.data.page_data

  const res1 = await role_list()
  if (res1.code == 1)
    roleData.value = res1.data

  const res2 = await org_tree_list()
  if (res2.code == 1)
    treeData.value = res2.data.list_tree

  const res3 = await org_list({ uo_pid: '0', limit: '100' })
  if (res3.code == 1)
    sydwData.value = res3.data.page_data

  const res5 = await area_list({ pid: '2615' })
  if (res5.code == 1)
    areaData.value = res5.data.area
}
const res6 = await org_list({ uo_pid: '0' })
if (res6.code == 1)
  deptData.value = res6.data.page_data

const defaultProps = {
  children: 'children',
  label: 'label',
}
const mineStatus = ref([])

const tree = ref(null)
const selectChange = (e) => {
  const arrNew = []
  const dataLength = mineStatusValue.value.length
  const eleng = e.length
  for (let i = 0; i < dataLength; i++) {
    for (let j = 0; j < eleng; j++) {
      if (e[j] === mineStatusValue.value[i].label)
        arrNew.push(mineStatusValue.value[i])
    }
  }
  tree.value.setCheckedNodes(arrNew) // 设置勾选的值
}
const handleCheckChange = () => {
  const res = tree.value.getCheckedNodes(true, true) // 这里两个true，1. 是否只是叶子节点 2. 是否包含半选节点（就是使得选择的时候不包含父节点）
  mineStatus.value = []
  res.forEach((item) => {
    mineStatus.value.push(item.label)
  })
  mineStatusValue.value = [...res]
}
const handleNodeClick = (e) => {
  mineStatus.value = [e.label]
  mineStatusValue.value = [e.id]
  initData()
}
const handleChange1 = () => {
  tree.value.setCurrentKey(null)
  mineStatus.value = []
  mineStatusValue.value = []
  initData()
}

// 编辑
const detailInfo = ref({})
const id = ref('')
const dialogVisible = ref(false)
const detailDialogVisible = ref(false)
async function handleEdit(item) {
  dialogVisible.value = true
  id.value = item.user_id
  const res = await user_detail({ user_id: item.user_id })
  if (res.code == 1) {
    detailInfo.value = res.data
    ruleForm.value = {
      user_realname: detailInfo.value.user_realname,
      ue_user_phone: detailInfo.value.user_ext.ue_user_phone,
      ue_user_email: detailInfo.value.user_ext.ue_user_email,
      uo_id_0: detailInfo.value.user_ext.ue_sydw_id,
      uo_id_1: detailInfo.value.user_ext.ue_bmbh,
      ue_zwmc: detailInfo.value.user_ext.ue_zwmc,
    }
    handleChange({ key: 'uo_id_0' }, ruleForm.value.uo_id_0, 1)
  }
}

const formData = ref([
  {
    name: '姓名',
    key: 'user_realname',
  },
  {
    name: '电话',
    key: 'ue_user_phone',
    type: 'tel',
  },
  {
    name: '邮箱',
    key: 'ue_user_email',
    type: 'email',
  },
  // {
  //   name: "事业单位",
  //   key: "uo_id_0",
  //   keyName: "uo_name_0",
  //   type: "select",
  //   selectKey: "sydwData",
  //   field: "uo_id",
  //   fieldName: "uo_name",
  // },
  // {
  //   name: "部门",
  //   key: "uo_id_1",
  //   keyName: "uo_name_1",
  //   type: "select",
  //   selectKey: "deptData",
  //   field: "uo_id",
  //   fieldName: "uo_name",
  // },

  // {
  //   name: "职位",
  //   key: "ue_zwmc",
  // },
])

const validateTel = (rule, value, callback) => {
  const reg_ph
    = /^(0|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57])[0-9]{8}$/
  if (value && !reg_ph.test(value))
    callback(new Error('请输入正确的电话号码'))
  else callback()
}

const rules_add = {
  ue_user_phone: [
    {
      validator: validateTel,
      message: '请输入正确的联系方式',
      trigger: ['blur', 'change'],
    },
  ],
  ue_user_email: [
    { type: 'email', message: '请输入正确的邮箱', trigger: ['blur', 'change'] },
  ],
}

// const deptData = ref([])
const selectObj = ref({
  uo_id_0: deptData.value,
  uo_id_1: [],
})
async function handleChange({ key, keyName, field, fieldName }, data, type) {
  if (key == 'uo_id_0') {
    if (ruleForm.value.uo_id_0 != '') {
      const res7 = await org_list({ uo_pid: ruleForm.value.uo_id_0 })
      if (res7.code == 1)
        deptData.value = [...res7.data.page_data]
      selectObj.value.uo_id_1 = deptData.value
    }
    else {
      selectObj.value.uo_id_1 = []
    }
    if (!type)
      ruleForm.value.uo_id_1 = ''
  }
}
const ruleFormRef = ref(null)
// 编辑-提交
const formRef = ref(null)

const handleSubmit = (formEl) => {
  if (!formEl)
    return

  formEl.validate(async (valid, fields) => {
    if (valid) {
      const obj1 = {
        ue_user_phone: ruleForm.value.ue_user_phone,
        ue_user_email: ruleForm.value.ue_user_email,
        ue_sydw_id: ruleForm.value.uo_id_0,
        ue_bmbh: ruleForm.value.uo_id_1,
        ue_zwmc: ruleForm.value.ue_zwmc,
      }
      const data = {
        user_ext: obj1,
        user_profile: {
          user_realname: ruleForm.value.user_realname,
        },
        user_id: id.value,
        // ue_user_realname: ruleForm.value.ue_user_realname,
      }
      const res = await user_edit(data)
      if (res.code != 1)
        return

      ElMessage.success('保存成功！')
      dialogVisible.value = false
      initData()
    }
    else {
      console.log('error submit!', fields)
    }
  })
}

const areaForm = $ref({
  ue_ssqybh: '',
  ue_ssqymc: '',
})
let ue_ssqybh
function handleAreaChange(val) {
  ue_ssqybh = val
  console.log(ue_ssqybh)
  // areaData.value.map((item) => {
  //   if (item.id == detailInfo.value.user_ext.ue_ssqybh)
  //     detailInfo.value.user_ext.ue_ssqymc = item.ue_ssqymc
  // })
}
// 设置区域管理员
const ruleFormRef_area = ref(null)
const setAreaDialogVisible = ref(false)
const setAreaAdmin = (item) => {
  // if(areaAdminLength){
  //   return ElMessage({
  //     message: '区域管理员不得超过五个!',
  //     type: 'warning',
  //   })
  // }
  setAreaDialogVisible.value = true
  id.value = item.user_id
  if (item.area_info.area_id4 != 0)
    areaForm.ue_ssqybh = item.area_info.area_id4

  // // areaForm.ue_ssqymc=item.area_info.ue_ssqymc;
  // const data = { user_id: item.user_id }
  // console.log(data, 123)
  // user_detail(data).then((res) => {
  //   if (res.code == 1) {

  //   }
  // })
}
// 区域-提交
const handleSubmit1 = (formEl) => {
  if (!formEl)
    return
  formEl.validate(async (valid, fields) => {
    if (valid) {
      console.log(1112222)
      const obj = {}
      for (const key in ruleForm.value) obj[key] = ruleForm.value[key]
      const data = {
        user_id: id.value,
        upid: ue_ssqybh,
      }
      await role_area(data)
      ElMessage.success('设置成功！')
      setAreaDialogVisible.value = false
      initData()
    }
    else {
      console.log('error submit!', fields)
    }
  })
}
const schoolForm = $ref({ ue_sm_id: '' })
let ue_sm_id
function handleSchoolChange(val) {
  ue_sm_id = val
  // schoolData.value.map((item) => {
  //   if (item.sm_id == detailInfo.value.user_ext.ue_sm_id)
  //     detailInfo.value.user_ext.ue_xxmc = item.sm_name
  // })
}
// 设置学校管理员
const setSchoolDialogVisible = ref(false)
let sm_user_role_id
const setSchoolAdmin = (item) => {
  setSchoolDialogVisible.value = true
  id.value = item.user_id
  sm_user_role_id = item.user_role_id
  if (item.sm_info)
    schoolForm.ue_sm_id = item.sm_info.sm_id

  // const data = { user_id: item.user_id }
  // console.log(data, 123)
  // user_detail(data).then((res) => {
  //   if (res.code == 1) {
  //     detailInfo.value = res.data
  //     console.log(detailInfo.value, 9999999999)
  //     ruleForm.value = {
  //       user_role_id: detailInfo.value.user_role_id,
  //       sm_id: detailInfo.value.user_ext.ue_sm_id,
  //       sm_name: detailInfo.value.user_ext.ue_xxmc,
  //     }
  //     console.log(ruleForm.value, 12312312312)
  //   }
  // })
}
// 取消设置校级管理员
const cancelSchoolAdmin = (item) => {
  const data = {
    sm_id: item.sm_info.sm_id,
    user_role_id: '75',
    user_id: item.user_id,
  }
  ElMessageBox.confirm('确认取消学校管理员?', '', {
    confirmButtonText: '确认',
    cancelButtonText: '取消',
    type: 'warning',
  })
    .then(() => {
      role_school(data).then((res) => {
        if (res.code == '1') {
          ElMessage({
            type: 'success',
            message: '取消成功!',
          })
          setSchoolDialogVisible.value = false
          initData()
        }
      })
    })
    .catch(() => {
      ElMessage({
        type: 'info',
        message: '取消操作',
      })
    })
}
// 学校-提交
const ruleFormRef_school = ref(null)
const handleSubmit2 = (formEl) => {
  if (!formEl)
    return
  formEl.validate(async (valid, fields) => {
    if (valid) {
      console.log(ruleForm.value, 123123)
      const data = {
        sm_id: schoolForm.ue_sm_id,
        user_role_id: '72',
        user_id: id.value,
      }
      console.log(data, 111)
      role_school(data).then((res) => {
        if (res.code == '1') {
          ElMessage.success('设置成功！')
          setSchoolDialogVisible.value = false
          initData()
        }
      })
    }
    else {
      console.log('error submit!', fields)
    }
  })
}

// // 是否启用
// // -1 禁止 0 启用
let statusType

function isOpen(item) {
  if (
    item.user_role_id >= 63
    && item.user_role_id <= 71
    && item.newStatus
    && areaAdminLength
  ) {
    initData()
    return ElMessage({
      message: '区域管理员不得超过五个!',
      type: 'warning',
    })
  }

  const openData = {
    user_id: item.user_id,
    status: item.newStatus == true ? '0' : '-1',
  }
  change_status(openData).then((res) => {
    if (res.code == '1') {
      ElMessage.success('操作成功！')
      initData()
    }
    if (res.code == '401') {
      ElMessage.success(res.msg)
      initData()
    }
  })
}
const userId = ref('')
const dialogType = ref('')
const getDetail = (val) => {
  detailDialogVisible.value = true
  userId.value = val.user_id
  if (val.user_role_id == '76')
    dialogType.value = 1
  else if (val.user_role_id == '75')
    dialogType.value = 2
  else
    dialogType.value = 3
}

const handleClose = () => {
  detailDialogVisible.value = false
  dialogType.value = ''
  dialogDeptVisible.value = false
}
let multipleSelection = $ref([])
const roleId = $ref('')
const handleSelectionChange = (val) => {
  multipleSelection = []
  val.forEach((i) => {
    multipleSelection.push(i.user_id)
  })
}

function exportAll() {
  const link = `${window.GLOBAL_CONFIG.uc}/user/main/index?api=xls&page=1&site=myxjyszptx&limit=10000
  &token=${user.value.token}&uid=${multipleSelection}`
  window.open(link, '_blank')
  console.log(link, 345)
}

const dialogDeptVisible = ref(false)
const handleManage = (row) => {
  dialogDeptVisible.value = true
  userId.value = row.user_id
}
</script>

<template>
  <div class="yhglContent card h-full">
    <div class="searchDiv flex justify-between">
      <el-form ref="ruleFormRef" label-position="top" :model="ruleForm" :inline="true" label-width="100px">
        <el-form-item label="全部身份" prop="user_role_id">
          <el-select v-model="ruleForm.user_role_id" filterable clearable @change="initData">
            <el-option v-for="(item, index) in roleData" :key="index" :label="item.rolename" :value="item.roleid" />
          </el-select>
        </el-form-item>
        <el-form-item label="事业单位" prop="uo_id_0">
          <el-select v-model="ruleForm.bm_id" filterable clearable>
            <el-option v-for="(item, index) in sydwData" :key="index" :label="item.uo_name" :value="item.uo_id" />
          </el-select>
        </el-form-item>
        <el-form-item label="部门/年级" prop="uo_id_1">
          <el-select v-model="mineStatus" placeholder="请选择" filterable clearable @change="selectChange" @clear="handleChange1">
            <el-option :value="mineStatusValue" style="height: auto">
              <el-tree ref="tree" default-expand-all :data="treeData" show-checkbox node-key="id" highlight-current :props="defaultProps" @check-change="handleCheckChange" @node-click="handleNodeClick" />
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="启用状态" prop="status">
          <el-select v-model="ruleForm.status" class="mr10" clearable placeholder="全部" @change="initData">
            <el-option v-for="item in state_list" :key="item.value" :label="item.label" :value="item.value" />
          </el-select>
        </el-form-item>
      </el-form>
      <div>
        <el-button size="small" type="primary" @click="initData">
          查询
        </el-button>
        <br>
        <el-button size="small" type="primary" plain class="mt-10px" @click="handleReset(ruleFormRef)">
          重置
        </el-button>
      </div>
    </div>

    <div class="flex justify-between mt-10px mb-20px">
      <div>
        <!-- <el-button class="_" type="primary">
          批量导入
        </el-button>
        <el-button class="_" type="primary" @click="handleAdd">
          新增
        </el-button> -->
        <el-button class="_" type="primary" @click="exportAll">
          导出
        </el-button>
      </div>
      <div class="flex items-center space-x-4">
        <search-keys @init="initSearchKey" />
        <!-- <el-button class="_" type="danger">
          删除
        </el-button> -->
      </div>
    </div>
    <el-table :data="tableData" style="width: 100%" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" />
      <el-table-column prop="user_id" label="ID" show-overflow-tooltip width="auto" />
      <el-table-column prop="user_realname" label="姓名" show-overflow-tooltip width="auto" />
      <el-table-column prop="ue_user_phone" label="联系电话" show-overflow-tooltip width="auto" />
      <el-table-column prop="ue_user_email" label="邮箱" show-overflow-tooltip width="auto" />
      <el-table-column prop="user_role_name" label="身份" show-overflow-tooltip width="auto" />
      <el-table-column prop="" label="状态" show-overflow-tooltip width="auto">
        <template #default="{ row }">
          <span>离线</span>
        </template>
      </el-table-column>
      <!-- <el-table-column prop="ue_sydw" label="事业单位" show-overflow-tooltip width="auto" />
      <el-table-column prop="ue_bmmc" label="部门/年级" show-overflow-tooltip width="auto" /> -->
      <el-table-column label="启用状态" show-overflow-tooltip width="auto">
        <template #default="{ row }">
          <el-switch v-model="row.newStatus" @change="isOpen(row)" />
        </template>
      </el-table-column>
      <el-table-column prop="regdate" label="注册时间" show-overflow-tooltip width="200" />
      <el-table-column label="操作" width="250">
        <template #default="{ row }">
          <div class="flex items-center space-x-4">
            <img class="cursor-pointer" src="/images/edit.png" alt="" @click="handleEdit(row)">
            <el-dropdown>
              <div class="cursor-pointer w-24px">
                <img class="m-auto" src="/images/dots.png">
              </div>

              <template #dropdown>
                <el-dropdown-menu>
                  <el-dropdown-item @click="getDetail(row)">
                    查看详情
                  </el-dropdown-item>
                  <el-dropdown-item
                    v-if="
                      user.user_role_id == 3
                        && row.user_role_id != '76'
                        && row.user_role_id != '77'
                    " :disabled="areaAdminLength" @click="setAreaAdmin(row)"
                  >
                    设为区域管理员
                  </el-dropdown-item>
                  <el-dropdown-item
                    v-if="
                      user.user_role_id > 3
                        && user.user_role_id < 72
                        && row.user_role_id != '72'
                        && row.user_role_id != '76'
                        && row.user_role_id != '77'
                    " @click="setSchoolAdmin(row)"
                  >
                    设为校级管理员
                  </el-dropdown-item>
                  <el-dropdown-item
                    v-if="
                      user.user_role_id > 3
                        && user.user_role_id < 72
                        && row.user_role_id == '72'
                    " @click="cancelSchoolAdmin(row)"
                  >
                    取消设置校级管理员
                  </el-dropdown-item>
                  <el-dropdown-item @click="handleManage(row)">
                    设置管理部门
                  </el-dropdown-item>
                </el-dropdown-menu>
              </template>
            </el-dropdown>
            <!-- roleid=3 显示 设置区域管理员 roleid > 3 && roleid < 72 显示 设置为校管理员 -->
          </div>
        </template>
      </el-table-column>
    </el-table>
    <el-dialog v-model="dialogVisible" class="_" width="680" title="编辑" align-center :close-on-click-modal="false">
      <el-form ref="formRef" :model="ruleForm" :rules="rules_add" label-position="top">
        <div class="grid grid-cols-2 gap-x-6">
          <template v-for="(item, index) in formData" :key="index">
            <el-form-item :class="item.class" :label="item.name" :prop="item.key">
              <el-input v-if="!item.type || item.type == 'email' || item.type == 'tel'" v-model="ruleForm[item.key]" />
              <el-select v-if="item.type == 'select'" v-model="ruleForm[item.key]" class="w-full" filterable clearable :multiple="item.multiple" @change="(val) => handleChange(item, val)">
                <el-option v-for="(val, vi) in selectObj[item.key]" :key="vi" :label="val.name || val[item.fieldName]" :value="val.value || val[item.field]" />
              </el-select>
            </el-form-item>
          </template>
        </div>
      </el-form>
      <template #footer>
        <span class="flex_center space-x-12">
          <el-button size="large" @click="dialogVisible = false">取消</el-button>
          <el-button size="large" type="primary" @click="handleSubmit(formRef)">
            确定
          </el-button>
        </span>
      </template>
    </el-dialog>
    <!-- /校级 -->
    <el-dialog v-model="setSchoolDialogVisible" class="_" width="680" title="设为学校管理员" align-center :close-on-click-modal="false">
      <el-form ref="ruleFormRef_school" :model="schoolForm" label-position="top">
        <el-form-item label="学校" prop="ue_sm_id" class="w-240px m-auto">
          <el-select v-model="schoolForm.ue_sm_id" filterable clearable @change="handleSchoolChange">
            <el-option v-for="(item, index) in schoolData" :key="index" :label="item.sm_name" :value="item.sm_id" />
          </el-select>
        </el-form-item>
      </el-form>
      <template #footer>
        <span class="flex_center space-x-12">
          <el-button size="large" @click="setSchoolDialogVisible = false">取消</el-button>
          <el-button size="large" type="primary" @click="handleSubmit2(ruleFormRef_school)">
            确定
          </el-button>
        </span>
      </template>
    </el-dialog>
    <!-- 区域 -->
    <el-dialog v-model="setAreaDialogVisible" class="_" width="680" title="设为区域管理员" align-center :close-on-click-modal="false">
      <el-form ref="ruleFormRef_area" :model="areaForm" label-position="top">
        <el-form-item label="地址" class="w-240px m-auto" prop="ue_ssqybh">
          <el-select v-model="areaForm.ue_ssqybh" filterable clearable @change="handleAreaChange">
            <el-option v-for="(item, index) in areaData" :key="index" :label="item.name" :value="item.id" />
          </el-select>
        </el-form-item>
      </el-form>
      <template #footer>
        <span class="flex_center space-x-12">
          <el-button size="large" @click="setAreaDialogVisible = false">取消</el-button>
          <el-button size="large" type="primary" @click="handleSubmit1(ruleFormRef_area)">
            确定
          </el-button>
        </span>
      </template>
    </el-dialog>
    <div class="flex_center mt-6 pb-12">
      <el-pagination v-model:current-page="currentPage" v-model:page-size="limit" layout="total, prev, pager, next, jumper" :total="total" :prev-icon="PrevIcon" :next-icon="NextIcon" @current-change="handleCurrentChange" />
    </div>
    <el-dialog v-model="detailDialogVisible" width="1100px" close-on-click-modal @close="handleClose">
      <XsDetailInfo v-if="dialogType == 1" :data="xsformData" :user-id="userId" />
      <JsDetailInfo v-if="dialogType == 2" :data="jsformData" show-type="jsxx" :user-id="userId" />
      <JdDetailInfo v-if="dialogType == 3" :data="jsformData" :user-id="userId" show-type="jdxx" />
    </el-dialog>

    <el-dialog v-model="dialogDeptVisible" title="设置管理部门" width="680px" class="_" :close-on-click-modal="false" destroy-on-close @close="handleClose">
      <ManageDepartment :user-id="userId" :area-data="areaData" :sydw-data="sydwData" @close="handleClose" />
    </el-dialog>
  </div>
</template>

<style lang="scss" scoped>
@use "~/styles/input-search.scss";
@use "~/styles/button.scss";
@use "~/styles/table.scss";
@use "~/styles/message-box.scss";
@use "~/styles/dialog.scss";
@use "~/styles/pagination.scss";
x :deep(.el-button.is-text.text1) {
  padding: 0;
  height: auto;
  margin: auto;
}
:deep(.el-dropdown-menu__item) {
  text-align: center;
  padding: 10px 16px;
}
.searchDiv {
  border-bottom: 1px solid #ebf3ff;
  :deep(.el-form) {
    .el-form-item__label {
      font-size: 14px;
      color: #3f3f44;
      font-weight: 600;
      margin-bottom: 5px;
    }
    .el-form-item__content {
      .el-input,
      .el-input__wrapper {
        width: 100%;
        box-shadow: none;
        outline: none;
        border-radius: 8px;
      }
      .el-input {
        border: 1px solid #ebf3ff;
      }
    }
  }
  .el-button--small {
    height: 34px;
    padding: 6px 22px;
    border-radius: 10px;
    &.is-plain {
      background: none;
      color: #3f8cff;
    }
  }
}
:deep(.detailDialog) {
  border-radius: 16px;
}
.yhglContent {
  :deep(.el-dialog) {
    .el-form-item__label {
      font-size: 14px;
      color: #3f3f44;
      font-weight: 600;
      margin-bottom: 5px;
    }
    .el-form-item__content {
      .el-input,
      .el-input__wrapper,
      .el-textarea__inner {
        width: 100%;
        box-shadow: none;
        border-radius: 8px;
        background: #f7f7f7;
      }
    }
  }
}
</style>
