龚焕茏
2024-03-05 1c391db321fae77ddcd297e14fbe1429960ead49
src/views/dg/danger/total.vue
@@ -82,16 +82,16 @@
      <el-form ref="dangerTotalFormRef" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="镇街名称" prop="townStreetName" label-width="100">
          <!-- <el-input v-model="form.townStreetName" placeholder="请输入镇街名称" /> -->
          <el-select v-model="form.townStreetName" placeholder="请选择" clearable style="width: 240px" @keyup.enter="handleQuery" >
          <el-select v-model="form.townStreetName" placeholder="请选择" clearable style="width: 240px" >
              <el-option v-for="item in townStreetNames" :key="item.townStreetName" :label="item.townStreetName" :value="item.townStreetName"/>
            </el-select>
        </el-form-item>
        <el-form-item label="统计周期" prop="periodDate" label-width="100">
          <el-select v-model="form.period" placeholder="请选择" style="width: 100px;">
          <el-select v-model="form.period" placeholder="请选择" style="width: 100px;" @change="clearPeriod">
            <el-option key="1" label="年度" :value="1" />
            <el-option key="2" label="月度" :value="2" />
          </el-select>
          &nbsp;
          &emsp;
          <el-date-picker v-model="form.periodDate" :type="pickerType" :value-format="pickerFormat" placeholder="请选择统计周期" />
        </el-form-item>
        <el-form-item label="发现隐患" prop="findSecurityRisks" label-width="100">
@@ -144,12 +144,12 @@
});
const townStreetNames = [
  {
    townStreetName: '幸福街道',
  },
  {
    townStreetName: '银杏街道'
  }];
{
  townStreetName: '幸福街道',
},
{
  townStreetName: '银杏街道'
}];
const initFormData: DangerTotalForm = {
  id: undefined,
@@ -159,7 +159,7 @@
  findSecurityRisks: undefined,
  issueNotice: undefined,
  dealWithSecurityRisks: undefined,
  status: undefined
  status: 1
}
const data = reactive<PageData<DangerTotalForm, DangerTotalQuery>>({
  form: {...initFormData},
@@ -309,4 +309,9 @@
const pickerFormat = computed(() => {
  return form.value.period === 1 ? 'YYYY' : 'YYYY-MM';
});
/** 清空周期 */
const clearPeriod = () => {
  form.value.periodDate = undefined;
};
</script>