From f68b32486dfefa20801ec337190f2ee2f1a433bc Mon Sep 17 00:00:00 2001 From: caoqianming Date: Fri, 5 Dec 2025 18:23:14 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20base=20=E8=B0=83=E6=88=90=E5=BB=B6?= =?UTF-8?q?=E8=BF=9F=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/xtUpload.vue | 5 +++-- pages/wf/ticketd_b.vue | 26 ++++++++++++-------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/components/xtUpload.vue b/components/xtUpload.vue index 162e483..fbfc79c 100644 --- a/components/xtUpload.vue +++ b/components/xtUpload.vue @@ -24,7 +24,7 @@ const emit = defineEmits(["update:modelValue", "update:obj"]); const props = defineProps({ xtype: { type: String, default: "path" }, // path 或 id - modelValue: { type: [Array, String], default: "pending" }, + modelValue: { type: [Array, String], default: ()=>{[]} }, obj: { type: Object, default: () => ({}) }, accept: { type: String, default: '' }, countMax: { type: Number, default: 1 }, @@ -44,7 +44,8 @@ const action = `${config.baseUrl}/file/` const inited = ref(false) onMounted(() => { - checkPropsUntilReady() + setTimeout(initFileList, 1000) + // checkPropsUntilReady() }) const checkPropsUntilReady = () => { diff --git a/pages/wf/ticketd_b.vue b/pages/wf/ticketd_b.vue index 96d25e3..d87f34a 100644 --- a/pages/wf/ticketd_b.vue +++ b/pages/wf/ticketd_b.vue @@ -15,7 +15,7 @@ import API from '@/utils/api'; const props = defineProps({ workflow_key: {type: String, default: null, required: false}, - ticket_: {type: [Object, String], default: "pending", required: false}, + ticket_: {type: Object, default: null, required: false}, t_id: {type: String, default: null, required: true}, title: {type: String, default: null, required: false}, submit_b_func: {type: Function, default: null, required: false}, @@ -26,20 +26,18 @@ const workflow = ref(null); const transitions = ref([]); const currentUser = ref(uni.getStorageSync("userInfo").id); onMounted(async () => { - checkPropsUntilReady() + setTimeout(()=>{init()}, 1000) + // await init(); + // watch( + // () => props.ticket_, + // async (newVal) => { + // if (newVal && Object.keys(newVal).length > 0) { + // await init(); + // } + // }, + // { deep: true } + // ) }) -const inited = ref(false) -const checkPropsUntilReady = () => { - if (inited.value) return - - if (props.ticket_ !== "pending") { - init() - inited.value = true - return - } - // ⭐ 每 200ms 查一次(非常轻量) - setTimeout(checkPropsUntilReady, 200) -} const suggestion = ref("") const isOwn = ref(false) const ticketId = ref(null) From 71dca19db3a700a6deaede074b9aab339e0a3f3e Mon Sep 17 00:00:00 2001 From: caoqianming Date: Fri, 5 Dec 2025 18:33:00 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20base=20=E6=B3=A8=E5=86=8CxtUpload?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.js b/main.js index 5467b27..c5771c7 100644 --- a/main.js +++ b/main.js @@ -26,6 +26,7 @@ import api from './utils/api' import check from './utils/check' import config from './utils/config.js' import { authDirective } from '@/utils/directives.js' +import xtUpload from "@/components/xtUpload.vue" export function createApp() { const app = createSSRApp(App) @@ -35,6 +36,7 @@ export function createApp() { app.config.globalProperties.$api = api app.config.globalProperties.$check = check app.config.globalProperties.$config = config + app.component('xtUpload', xtUpload); return { app } From a268549e034802df278b56e162f828002613ab8d Mon Sep 17 00:00:00 2001 From: caoqianming Date: Fri, 5 Dec 2025 18:33:18 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E4=B8=BAxtUpload?= =?UTF-8?q?=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/ofm/publicity_form.vue | 2 +- pages/ofm/seal_form.vue | 44 +----------------------------------- 2 files changed, 2 insertions(+), 44 deletions(-) diff --git a/pages/ofm/publicity_form.vue b/pages/ofm/publicity_form.vue index 87e1940..1774081 100644 --- a/pages/ofm/publicity_form.vue +++ b/pages/ofm/publicity_form.vue @@ -8,7 +8,7 @@ - + diff --git a/pages/ofm/seal_form.vue b/pages/ofm/seal_form.vue index 17bbdc1..2e1a940 100644 --- a/pages/ofm/seal_form.vue +++ b/pages/ofm/seal_form.vue @@ -26,7 +26,7 @@ - + @@ -111,51 +111,9 @@ import {actStateEnum} from "@/utils/enum.js" maskClick(e){ console.log('maskClick事件:', e); }, - fileSelect(e){ - console.log('fileSelect',e); - this.uploadFile(e) - }, - fileSuccess(e){ - console.log('fileSuccess',e) - }, sealTypeChange(){ console.log('this.form.seal',this.form.seal) }, - uploadFile(e) { - if (e.tempFiles.length === 0) { - uni.showToast({ - title: '请先选择文件', - icon: 'none', - }); - return; - } - // 获取第一个选择的文件 - const file = e.tempFiles[0]; - console.log(this.$api.sealCreate) - let fieldName = 'file'; - let filePath = file.url; - // 上传文件 - uni.uploadFile({ - url: `${config.baseUrl}/file/`, - filePath: filePath, - name: fieldName, - formData: {}, - header: this.header, - success: (uploadRes) => { - console.log('uploadRes',uploadRes) - // 上传成功后的回调 - const data = JSON.parse(uploadRes.data); - console.log('上传返回数据:', data); - if(data){ - this.form.file = data.path; - uni.showToast({ - title: '上传成功', - icon: 'success', - }); - } - }, - }); - }, //选择会议室和日期后查询有无预定 async submit_b_func(id){ let that = this;