riku
2023-12-21 3d7bf6dff3d1e2f12c4ecd0120ee110348ccdf49
1. 自评预检查功能修改中
已修改11个文件
已添加4个文件
441 ■■■■ 文件已修改
src/components.d.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/form/FYForm.vue 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/search-option/FYOptionLocation.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/search-option/FYOptionScene.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/search-option/FYOptionTime.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/search-option/FYOptionUserType.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/composables/formConfirm.js 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test.js 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/evaluation/ResultManage.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/evaluation/components/CompPreCheck.vue 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/evaluation/components/CompQuickSet.vue 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/evaluation/components/precheck/CompCheckArea.vue 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/evaluation/components/precheck/CompCheckConfirm.vue 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/evaluation/components/precheck/CompCheckExemption.vue 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/evaluation/components/precheck/CompCheckSource.vue 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components.d.ts
@@ -10,7 +10,6 @@
    BaseContentLayout: typeof import('./components/core/BaseContentLayout.vue')['default']
    BasePanelLayout: typeof import('./components/core/BasePanelLayout.vue')['default']
    Content: typeof import('./components/core/Content.vue')['default']
    copy: typeof import('./components/search-option/FYOptionLocation copy.vue')['default']
    ElAside: typeof import('element-plus/es')['ElAside']
    ElAvatar: typeof import('element-plus/es')['ElAvatar']
    ElBacktop: typeof import('element-plus/es')['ElBacktop']
@@ -62,6 +61,7 @@
    ElTag: typeof import('element-plus/es')['ElTag']
    ElText: typeof import('element-plus/es')['ElText']
    ElTooltip: typeof import('element-plus/es')['ElTooltip']
    ElTransfer: typeof import('element-plus/es')['ElTransfer']
    ElTree: typeof import('element-plus/es')['ElTree']
    Footer: typeof import('./components/core/Footer.vue')['default']
    FormCol: typeof import('./components/layout/FormCol.vue')['default']
src/components/form/FYForm.vue
@@ -26,7 +26,7 @@
 * å¯ä¼ å…¥åˆå§‹è¡¨å•数据formInfo,表单校验规则rules
 * å®žçްsubmit和cancel触发函数
 */
import { defineProps, defineEmits, reactive, ref, watch, computed } from 'vue';
import { defineProps, defineEmits, reactive, ref, watch, computed, defineExpose } from 'vue';
import { useFormConfirm } from '@/composables/formConfirm';
const props = defineProps({
@@ -62,15 +62,29 @@
  _locations: [
    {
      required: true,
      message: '省/市/区/镇不能为空',
      // message: '行政区划不能为空',
      trigger: 'change',
      validator: (rule, value, callback) => {
        if (!value) {
          callback(new Error('Please input the age'));
        } else {
          callback()
        }
      }
    }
  ],
  _scenetype: [
    {
      required: true,
      message: '场景类型不能为空',
      trigger: 'change'
      trigger: 'change',
      validator: (rule, value, callback) => {
        if (!value) {
          callback(new Error('Please input the age'));
        } else {
          callback()
        }
      }
    }
  ]
});
@@ -92,13 +106,18 @@
function submit() {
  loading.value = true;
  return new Promise((resolve, reject) => {
    emit('submit', formObj, () => {
      loading.value = false;
      resolve();
    },(err)=>{
      loading.value = false;
      reject(err);
    });
    emit(
      'submit',
      formObj,
      () => {
        loading.value = false;
        resolve();
      },
      (err) => {
        loading.value = false;
        reject(err);
      }
    );
  });
}
@@ -107,9 +126,9 @@
  emit('cancel');
}
const allRules = computed(()=>{
  return {...baseRules, ...props.rules}
})
const allRules = computed(() => {
  return { ...baseRules, ...props.rules };
});
//监听表单初始数据传入
watch(
@@ -117,7 +136,7 @@
  (nValue) => {
    formObj.value = nValue;
  },
  { deep: false, immediate: true }
  { deep: true, immediate: true }
);
//监听表单重置功能触发
@@ -134,6 +153,8 @@
watch(edit, (nValue) => {
  emit('update:isEdit', nValue);
});
defineExpose({ onSubmit, onCancel, onReset });
</script>
<style scoped></style>
src/components/search-option/FYOptionLocation.vue
@@ -21,7 +21,7 @@
      type: Boolean,
      default: true
    },
    // æŸ¥è¯¢çš„行政级别,取值1,2,3,4
    // æŸ¥è¯¢çš„行政级别,取值1,2,3,4, 5, 6
    level: {
      type: Number,
      default: 4
@@ -38,7 +38,10 @@
      type: Boolean,
      default: true
    },
    prop: String
    prop: {
      type: String,
      default: '_locations'
    }
  },
  emits: ['update:value'],
  data() {
src/components/search-option/FYOptionScene.vue
@@ -38,7 +38,10 @@
      type: Boolean,
      default: true,
    },
    prop: String
    prop: {
      type: String,
      default: '_scenetype'
    }
  },
  emits: ['update:value'],
  data() {
src/components/search-option/FYOptionTime.vue
@@ -1,5 +1,5 @@
<template>
  <el-form-item label="时间">
  <el-form-item label="时间" :prop="prop">
    <el-date-picker
      :model-value="value"
      @change="handleChange"
@@ -27,7 +27,8 @@
    initValue: {
      type: Boolean,
      default: true
    }
    },
    prop: String
  },
  emits: ['update:value'],
  data() {
src/components/search-option/FYOptionUserType.vue
@@ -6,12 +6,7 @@
      placeholder="用户类型"
      style="width: 150px"
    >
      <el-option
        v-for="s in userTypes"
        :key="s.value"
        :label="s.label"
        :value="s"
      />
      <el-option v-for="s in userTypes" :key="s.value" :label="s.label" :value="s" />
    </el-select>
  </el-form-item>
</template>
@@ -24,21 +19,24 @@
    // æ˜¯å¦åœ¨é¦–选项处添加“全部”选项
    allOption: {
      type: Boolean,
      default: true,
      default: true
    },
    // è¿”回结果
    value: Object,
    // æ˜¯å¦é»˜è®¤è¿”回初始选项
    initValue: {
      type: Boolean,
      default: true,
      default: true
    },
    prop: String
    prop: {
      type: String,
      default: '_usertype'
    }
  },
  emits: ['update:value'],
  data() {
    return {
      userTypes: enumUser(this.allOption),
      userTypes: enumUser(this.allOption)
    };
  },
  methods: {
@@ -50,6 +48,6 @@
    if (this.initValue) {
      this.handleChange(this.userTypes[0]);
    }
  },
  }
};
</script>
src/composables/formConfirm.js
@@ -92,9 +92,10 @@
  };
  // æäº¤è¡¨å•
  const onSubmit = function () {
    formRef.value.validate((valid) => {
  const onSubmit = function (messageBox = true) {
    formRef.value.validate(async (valid) => {
      if (valid) {
        if (messageBox) {
        useMessageBoxTip({
          confirmMsg: submit.msg,
          confirmTitle: submit.title,
@@ -104,6 +105,10 @@
            return res;
          }
        });
        } else {
          await submit.do();
          submited();
        }
      }
    });
  };
src/test.js
@@ -1,17 +1,26 @@
const shape = {
  radius: 9,
  d() {
    return this.radius * 2;
  },
  p: () => 2 * Math.PI * this.radius,
};
// const shape = {
//   radius: 9,
//   d() {
//     return this.radius * 2;
//   },
//   p: () => 2 * Math.PI * this.radius,
// };
console.log(shape.d());
console.log(shape.p());
// console.log(shape.d());
// console.log(shape.p());
const str = 'abc';
if (str[0] >= 'a' && str[0] <= 'z') {
  let a = parseInt(str[0]);
  a -= 32;
  console.log(a);
}
// const str = 'abc';
// if (str[0] >= 'a' && str[0] <= 'z') {
//   let a = parseInt(str[0]);
//   a -= 32;
//   console.log(a);
// }
let a = 4
let b = new Number(4)
let c = '4'
console.log(a == b);
console.log(a === b);
console.log(a == c);
console.log(b === c);
src/views/fysp/evaluation/ResultManage.vue
@@ -167,7 +167,4 @@
};
</script>
<style scoped>
.a {
  color: #f7a62c;
}
</style>
src/views/fysp/evaluation/components/CompPreCheck.vue
@@ -5,71 +5,31 @@
    <el-step title="豁免条目" />
    <el-step title="自动评估" />
  </el-steps>
  <el-card v-if="stepIndex == 0" shadow="never">
    <template #header>
      <div><el-text tag="b" size="large">选择评估范围</el-text></div>
      <el-text size="small" type="info">包括区县、场景类型以及月份</el-text>
    </template>
    <FYForm :form-info="evaConditon" :rules="evaConditionRules" :showButtons="false">
      <template #form-item="{ formObj }">
        <!-- åŒºåŽ¿ -->
        <FYOptionLocation
          :allOption="false"
          :level="3"
          :checkStrictly="false"
          v-model:value="formObj.locations"
        ></FYOptionLocation>
        <!-- åœºæ™¯ç±»åž‹ -->
        <FYOptionScene
          :allOption="false"
          :type="2"
          v-model:value="formObj.scenetype"
        ></FYOptionScene>
        <!-- æ—¶é—´ -->
        <FYOptionTime
          :initValue="true"
          type="month"
          v-model:value="formObj.time"
        ></FYOptionTime>
      </template>
    </FYForm>
    <template #footer>
      <el-row justify="space-around">
        <el-button type="primary" size="default">下一步</el-button>
      </el-row>
    </template>
  </el-card>
  <el-card v-if="stepIndex == 1" shadow="never"> Never2 </el-card>
  <el-card v-if="stepIndex == 2" shadow="never"> Never3 </el-card>
  <el-card v-if="stepIndex == 3" shadow="never"> Never4 </el-card>
  <CompCheckArea v-show="stepIndex == 0" v-model="stepIndex"></CompCheckArea>
  <CompCheckSource v-show="stepIndex == 1" v-model="stepIndex"></CompCheckSource>
  <CompCheckExemption v-show="stepIndex == 2" v-model="stepIndex"></CompCheckExemption>
  <CompCheckConfirm v-show="stepIndex == 3" v-model="stepIndex"></CompCheckConfirm>
</template>
<script>
import dayjs from 'dayjs';
import CompCheckArea from './precheck/CompCheckArea.vue';
import CompCheckSource from './precheck/CompCheckSource.vue';
import CompCheckExemption from './precheck/CompCheckExemption.vue';
import CompCheckConfirm from './precheck/CompCheckConfirm.vue';
/**
 * è‡ªåŠ¨è¯„ä¼°æ¡ä»¶åˆè§„æ€§æ£€æŸ¥
 */
export default {
  name: 'CompPreCheck',
  components: { CompCheckArea, CompCheckSource, CompCheckExemption, CompCheckConfirm },
  props: {},
  emits: ['preCheck'],
  data() {
    return {
      // æ“ä½œæ­¥éª¤ä¸‹æ ‡
      stepIndex: 0,
      // è¯„估任务范围
      evaConditon: {},
      evaConditionRules: {
        acountname: [
          {
            required: true,
            message: '账户名不能为空',
            trigger: 'blur'
          }
        ]
      }
      stepIndex: 0
    };
  },
  methods: {
src/views/fysp/evaluation/components/CompQuickSet.vue
@@ -1,10 +1,19 @@
<template>
  <el-row>
    <span>快捷选择</span>
    <el-button v-for="(v, i) in quickSetting" :key="i" type="primary" @click="quickSet(v)">{{
  <el-form-item label="快捷选择">
    <el-space>
    <el-button v-for="(v, i) in quickSetting" :key="i" type="primary" size="small" @click="quickSet(v)">{{
      v.name
    }}</el-button>
  </el-row>
    </el-space>
  </el-form-item>
  <!-- <el-row class="row">
    <el-space>
    <el-text>快捷选择</el-text>
    <el-button v-for="(v, i) in quickSetting" :key="i" type="primary" size="small" @click="quickSet(v)">{{
      v.name
    }}</el-button>
    </el-space>
  </el-row> -->
</template>
<script>
export default {
@@ -21,7 +30,7 @@
              cCode: '3100',
              cName: '上海市',
              dCode: '310106',
              dName: '静安区'
              dName: '静安区',
            },
            scenetype: { label: '工地', value: '1' }
          },
@@ -92,3 +101,9 @@
  }
}
</script>
<style scoped>
.row {
  padding: 8px 0px;
  /* background-color: antiquewhite; */
}
</style>
src/views/fysp/evaluation/components/precheck/CompCheckArea.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,100 @@
<template>
  <el-card shadow="never">
    <template #header>
      <div><el-text tag="b" size="large">选择评估范围</el-text></div>
      <el-text size="small" type="info">包括区县、场景类型以及月份</el-text>
    </template>
    <FYForm
      ref="formRef"
      :form-info="evaConditon"
      :rules="evaConditionRules"
      :showButtons="false"
      @submit="nextStep"
    >
      <template #form-item="{ formObj }">
        <CompQuickSet @quick-set="setOptions"></CompQuickSet>
        <!-- åŒºåŽ¿ -->
        <FYOptionLocation
          :allOption="false"
          :level="3"
          :initValue="false"
          :checkStrictly="false"
          v-model:value="formObj._locations"
        ></FYOptionLocation>
        <!-- åœºæ™¯ç±»åž‹ -->
        <FYOptionScene
          :allOption="false"
          :initValue="false"
          :type="2"
          v-model:value="formObj._scenetype"
        ></FYOptionScene>
        <!-- æ—¶é—´ -->
        <FYOptionTime
          prop="time"
          :initValue="true"
          type="month"
          v-model:value="formObj.time"
        ></FYOptionTime>
      </template>
    </FYForm>
    <template #footer>
      <el-row justify="space-around">
        <el-button type="primary" size="default" :loading="loading" @click="submit"
          >下一步</el-button
        >
      </el-row>
    </template>
  </el-card>
</template>
<script>
import CompQuickSet from '../CompQuickSet.vue';
/**
 * è¯„估范围合规性检查
 */
export default {
  components: { CompQuickSet },
  props: {
    // æ­¥éª¤ä¸‹æ ‡
    modelValue: Number
  },
  emits: ['update:modelValue'],
  data() {
    return {
      loading: false,
      // è¯„估任务范围
      evaConditon: {},
      evaConditionRules: {
        time: [
          {
            required: true,
            message: '时间不能为空',
            trigger: 'change'
          }
        ]
      }
    };
  },
  methods: {
    setOptions(param) {
      this.evaConditon._locations = param.locations;
      this.evaConditon._scenetype = param.scenetype;
    },
    submit() {
      this.$refs.formRef.onSubmit(false);
    },
    // è·³è½¬ä¸‹ä¸€æ­¥
    nextStep() {
      this.loading = true;
      return new Promise((reslove, reject) => {
        setTimeout(() => {
          this.$emit('update:modelValue', this.modelValue + 1);
          this.loading = false;
          reslove();
        }, 1000);
      });
    }
  }
};
</script>
src/views/fysp/evaluation/components/precheck/CompCheckConfirm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
<template>
  <el-card shadow="never">
    Never4
    <template #footer>
      <el-row justify="space-around">
        <el-button type="primary" size="default" @click="lastStep">上一步</el-button>
        <!-- <el-button type="primary" size="default" @click="nextStep">下一步</el-button> -->
      </el-row>
    </template>
  </el-card>
</template>
<script>
/**
 * è¯„估任务最终开启确认
 */
export default {
  props: {
    // æ­¥éª¤ä¸‹æ ‡
    modelValue: Number
  },
  emits: ['update:modelValue'],
  data() {
    return {
    };
  },
  methods: {
    // è·³è½¬ä¸‹ä¸€æ­¥
    nextStep() {
      this.$emit('update:modelValue', this.modelValue + 1);
    },
    // è·³è½¬ä¸‹ä¸€æ­¥
    lastStep() {
      this.$emit('update:modelValue', this.modelValue - 1);
    }
  }
};
</script>
src/views/fysp/evaluation/components/precheck/CompCheckExemption.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
<template>
  <el-card shadow="never">
    Never3
    <template #footer>
      <el-row justify="space-around">
        <el-button type="primary" size="default" @click="lastStep">上一步</el-button>
        <el-button type="primary" size="default" @click="nextStep">下一步</el-button>
      </el-row>
    </template>
  </el-card>
</template>
<script>
/**
 * è¯„估条目豁免设定
 */
export default {
  props: {
    // æ­¥éª¤ä¸‹æ ‡
    modelValue: Number
  },
  emits: ['update:modelValue'],
  data() {
    return {
    };
  },
  methods: {
    // è·³è½¬ä¸‹ä¸€æ­¥
    nextStep() {
      this.$emit('update:modelValue', this.modelValue + 1);
    },
    // è·³è½¬ä¸‹ä¸€æ­¥
    lastStep() {
      this.$emit('update:modelValue', this.modelValue - 1);
    }
  }
};
</script>
src/views/fysp/evaluation/components/precheck/CompCheckSource.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
<template>
  <el-card shadow="never">
    Never2
    <template #footer>
      <el-row justify="space-around">
        <el-button type="primary" size="default" @click="lastStep">上一步</el-button>
        <el-button type="primary" size="default" @click="nextStep">下一步</el-button>
      </el-row>
    </template>
  </el-card>
</template>
<script>
/**
 * è¯„估数据源完整性检查
 */
export default {
  props: {
    // æ­¥éª¤ä¸‹æ ‡
    modelValue: Number
  },
  emits: ['update:modelValue'],
  data() {
    return {
    };
  },
  methods: {
    // è·³è½¬ä¸‹ä¸€æ­¥
    nextStep() {
      this.$emit('update:modelValue', this.modelValue + 1);
    },
    // è·³è½¬ä¸‹ä¸€æ­¥
    lastStep() {
      this.$emit('update:modelValue', this.modelValue - 1);
    }
  }
};
</script>