From 24f4177d8c60f337b39338fb51da31fe1ebd2a59 Mon Sep 17 00:00:00 2001 From: aeizzz Date: Thu, 2 Mar 2023 14:10:13 +0800 Subject: [PATCH] =?UTF-8?q?:recycle:=20Refactoring=20code.=20=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/QueryTree/index.vue | 10 +- src/components/cron/index.vue | 3 +- .../verifition/Verify/VerifyPoints.vue | 2 +- .../verifition/Verify/VerifySlide.vue | 9 +- .../wechart/wx-material-select/main.vue | 19 +- src/components/wechart/wx-reply/index.vue | 20 +- src/utils/request.ts | 5 +- src/views/gen/table/edit.vue | 1 - src/views/gen/table/preview.vue | 1 - src/views/mp/wx-auto-reply/index.vue | 12 - src/views/mp/wx-fans-msg/form.vue | 315 ------------------ .../mp/wx-material/components/news-form.vue | 4 +- src/views/mp/wx-menu/index.vue | 2 +- 13 files changed, 31 insertions(+), 372 deletions(-) delete mode 100644 src/views/mp/wx-fans-msg/form.vue diff --git a/src/components/QueryTree/index.vue b/src/components/QueryTree/index.vue index 3ce69323..e338baa0 100644 --- a/src/components/QueryTree/index.vue +++ b/src/components/QueryTree/index.vue @@ -2,7 +2,7 @@
-
@@ -13,7 +13,7 @@ import { onMounted, reactive, ref, unref } from "vue"; const emit = defineEmits(['search', 'nodeClick']) -const { placeholder, props, query, loading } = defineProps({ +const props = defineProps({ props: { type: Object, default: () => { @@ -40,7 +40,7 @@ const { placeholder, props, query, loading } = defineProps({ const state = reactive({ List: [], - localLoading: loading + localLoading: props.loading }) @@ -51,9 +51,9 @@ const handleNodeClick = (item: any) => { } const getDeptTree = () => { - if (query instanceof Function) { + if (props.query instanceof Function) { state.localLoading = true - const result = query(unref(searchName)) + const result = props.query(unref(searchName)) if ((typeof result === 'object' || typeof result === 'function') && typeof result.then === 'function') { result.then((r: any) => { state.List = r.data diff --git a/src/components/cron/index.vue b/src/components/cron/index.vue index 0adfb1af..b7fcf913 100644 --- a/src/components/cron/index.vue +++ b/src/components/cron/index.vue @@ -74,7 +74,6 @@
{{ state.language === 'en' ? 'cn' : 'en' }} @@ -556,7 +555,7 @@ cron预览: - + {{ state.cron }}
diff --git a/src/components/verifition/Verify/VerifyPoints.vue b/src/components/verifition/Verify/VerifyPoints.vue index 8e2702da..74200900 100644 --- a/src/components/verifition/Verify/VerifyPoints.vue +++ b/src/components/verifition/Verify/VerifyPoints.vue @@ -87,7 +87,7 @@ } } }, - setup(props,context){ + setup(props){ const {mode,captchaType} = toRefs(props) const { proxy } = getCurrentInstance(); let secretKey = ref(''), //后端返回的ase加密秘钥 diff --git a/src/components/verifition/Verify/VerifySlide.vue b/src/components/verifition/Verify/VerifySlide.vue index 4f913e29..9bc9dda5 100644 --- a/src/components/verifition/Verify/VerifySlide.vue +++ b/src/components/verifition/Verify/VerifySlide.vue @@ -101,8 +101,8 @@ export default { } } }, - setup(props, context) { - const {mode, captchaType, vSpace, imgSize, barSize, type, blockSize, explain} = toRefs(props) + setup(props) { + const {mode, captchaType, type, blockSize, explain} = toRefs(props) const { proxy } = getCurrentInstance(); let secretKey = ref(''), //后端返回的ase加密秘钥 passFlag = ref(''), //是否通过的标识 @@ -198,10 +198,11 @@ export default { //鼠标按下 function start(e) { e = e || window.event + let x = null if (!e.touches) { //兼容PC端 - var x = e.clientX; + x = e.clientX; } else { //兼容移动端 - var x = e.touches[0].pageX; + x = e.touches[0].pageX; } startLeft.value = Math.floor(x - barArea.value.getBoundingClientRect().left); startMoveTime.value = +new Date(); //开始滑动的时间 diff --git a/src/components/wechart/wx-material-select/main.vue b/src/components/wechart/wx-material-select/main.vue index 6fe3b5b1..c4672c81 100644 --- a/src/components/wechart/wx-material-select/main.vue +++ b/src/components/wechart/wx-material-select/main.vue @@ -7,9 +7,9 @@

{{ item.name }}

- 选择 - + @@ -23,10 +23,7 @@ - - +