From 0837afc5453e47bcb15d4e4bc6cfbfc93770fee2 Mon Sep 17 00:00:00 2001 From: liushilong <2224574157@qq.com> Date: Sat, 30 Mar 2024 19:28:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BB=BB=E5=8A=A1=E7=BB=88=E5=AE=A1?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E5=92=8C=E4=B8=80=E9=94=AE=E6=9F=A5=E9=87=8D?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E7=9A=84=E6=96=B0=E5=BB=BA=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E6=96=B0=E5=A2=9E=E8=A7=84=E5=88=99=EF=BC=8C?= =?UTF-8?q?=E5=BC=B9=E7=AA=9724=E5=B0=8F=E6=97=B6=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/final/comp/NewFilterModal.vue | 6 +- .../home/aside/comp/modals/NewFilterModal.vue | 6 +- src/views/worksheet/modal/ApprovalModal.vue | 116 +++++++++--------- 3 files changed, 63 insertions(+), 65 deletions(-) diff --git a/src/views/final/comp/NewFilterModal.vue b/src/views/final/comp/NewFilterModal.vue index ae1e823..3b9a219 100644 --- a/src/views/final/comp/NewFilterModal.vue +++ b/src/views/final/comp/NewFilterModal.vue @@ -150,7 +150,7 @@ function unformatValue(searchfield: string, searchvalue: any) { function createCondition() { formValue.conditions.push({ type: null, - operator: null, + operator: 'eq', result: null, }) } @@ -227,7 +227,7 @@ function leaveHandler() { formValue.conditions = [ { type: null, - operator: null, + operator: 'eq', result: null, }, ] @@ -269,7 +269,7 @@ defineExpose({ - + - + -import { reactive, ref, toRefs } from 'vue' -import { format } from 'date-fns' -import { NButton, NDataTable, useDialog, useMessage } from 'naive-ui' -import { aiApprovaltools, aiApprovaltoolsClearmark } from '@/api/work/work' +import { onMounted, reactive, ref, toRefs } from "vue"; +import { format } from "date-fns"; +import { NButton, NDataTable, useDialog, useMessage } from "naive-ui"; +import { aiApprovaltools, aiApprovaltoolsClearmark } from "@/api/work/work"; +import { getToolsCount } from "@/api/home/main"; const emit = defineEmits<{ - (e: 'reject', params: any) - (e: 'notPass', params: any) -}>() + (e: "reject", params: any); + (e: "notPass", params: any); +}>(); -const dialog = useDialog() +const dialog = useDialog(); const state: any = reactive({ detail: {}, - taskId: '', -}) -const { detail } = toRefs(state) + taskId: "", +}); +const { detail } = toRefs(state); const cardStyle = { - 'width': '450px', - '--n-padding-bottom': '10px', - '--n-padding-left': '0px', -} + width: "450px", + "--n-padding-bottom": "10px", + "--n-padding-left": "0px", +}; -const show = ref(false) +const show = ref(false); function showModal(id) { - console.log(id) - state.taskId = id - getDetail(id) + console.log(id); + state.taskId = id; + getDetail(id); } async function getDetail(id) { - const res = await aiApprovaltools({ taskid: id }) - if (res.code === 'OK') { - state.detail = res.data - show.value = true + const res = await aiApprovaltools({ taskid: id }); + if (res.code === "OK") { + state.detail = res.data; + show.value = true; } - console.log(res) + console.log(res); } async function clearMark() { - const res = await aiApprovaltoolsClearmark({ taskid: state.taskId }) - if (res.code === 'OK') - closeModal() + const res = await aiApprovaltoolsClearmark({ taskid: state.taskId }); + if (res.code === "OK") closeModal(); } function closeModal() { - show.value = false + show.value = false; } async function reject() { // emit('reject', { a: 'todo' }) // closeModal() dialog.info({ - title: '确认提示', - content: '确认设置成假吗?', - positiveText: '确定', - negativeText: '取消', + title: "确认提示", + content: "确认设置成假吗?", + positiveText: "确定", + negativeText: "取消", onPositiveClick: async () => { // TODO:需要支持重置 // const result = await resetApproval() - clearMark() + clearMark(); }, onNegativeClick: () => {}, - }) + }); } async function viewRepeat(e: MouseEvent) { - emit('notPass', { + emit("notPass", { id: state.taskId, detail: state.detail, - }) - e.preventDefault() - closeModal() + }); + e.preventDefault(); + closeModal(); +} + +async function getShowStatus() { + const res = await getToolsCount(); + if (!JSON.parse(res.message)) { + show.value = true; + } } +onMounted(() => { + getShowStatus(); +}); defineExpose({ showModal, -}) +});