fix: base 调成延迟模式
This commit is contained in:
parent
e0a6416fae
commit
f68b32486d
|
|
@ -24,7 +24,7 @@ const emit = defineEmits(["update:modelValue", "update:obj"]);
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
xtype: { type: String, default: "path" }, // path 或 id
|
xtype: { type: String, default: "path" }, // path 或 id
|
||||||
modelValue: { type: [Array, String], default: "pending" },
|
modelValue: { type: [Array, String], default: ()=>{[]} },
|
||||||
obj: { type: Object, default: () => ({}) },
|
obj: { type: Object, default: () => ({}) },
|
||||||
accept: { type: String, default: '' },
|
accept: { type: String, default: '' },
|
||||||
countMax: { type: Number, default: 1 },
|
countMax: { type: Number, default: 1 },
|
||||||
|
|
@ -44,7 +44,8 @@ const action = `${config.baseUrl}/file/`
|
||||||
|
|
||||||
const inited = ref(false)
|
const inited = ref(false)
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
checkPropsUntilReady()
|
setTimeout(initFileList, 1000)
|
||||||
|
// checkPropsUntilReady()
|
||||||
})
|
})
|
||||||
|
|
||||||
const checkPropsUntilReady = () => {
|
const checkPropsUntilReady = () => {
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import API from '@/utils/api';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
workflow_key: {type: String, default: null, required: false},
|
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},
|
t_id: {type: String, default: null, required: true},
|
||||||
title: {type: String, default: null, required: false},
|
title: {type: String, default: null, required: false},
|
||||||
submit_b_func: {type: Function, 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 transitions = ref([]);
|
||||||
const currentUser = ref(uni.getStorageSync("userInfo").id);
|
const currentUser = ref(uni.getStorageSync("userInfo").id);
|
||||||
onMounted(async () => {
|
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 suggestion = ref("")
|
||||||
const isOwn = ref(false)
|
const isOwn = ref(false)
|
||||||
const ticketId = ref(null)
|
const ticketId = ref(null)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue