wanggang
1 year ago
1 changed files with 8 additions and 15 deletions
@ -1,31 +1,24 @@ |
|||
import AppList from "../../components/list/index.js"; |
|||
import html from "html"; |
|||
import useConfig from "../../models/job-item.js"; |
|||
import { ref, nextTick, onMounted, onUnmounted } from "vue"; |
|||
import { ref, onMounted, onUnmounted } from "vue"; |
|||
import useConfig2 from "../../models/job-log.js"; |
|||
|
|||
export default { |
|||
components: { AppList }, |
|||
template: html`<app-list v-if="refresh" :config="config" @command="onCommand" />`, |
|||
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />`, |
|||
setup() { |
|||
const config = useConfig(); |
|||
const onCommand = async (item, rows, load, showList) => { |
|||
console.log(item.path, item, rows); |
|||
console.log(showList); |
|||
const config = useConfig2(); |
|||
config.query.schema.properties.filters.default[0].value = rows[0].id; |
|||
showList({ test: "test" }, "/base-data/job-log", config); |
|||
}; |
|||
const refresh = ref(true); |
|||
onMounted(async () => { |
|||
PubSub.subscribe("JobItem", () => { |
|||
refresh.value = false; |
|||
nextTick(() => (refresh.value = true)); |
|||
}); |
|||
}); |
|||
onUnmounted(() => { |
|||
PubSub.unsubscribe(onMonitor); |
|||
}); |
|||
return { config, onCommand, refresh }; |
|||
//
|
|||
const appListRef = ref(null); |
|||
const event = "JobItem"; |
|||
onMounted(() => PubSub.subscribe(event, async () => await appListRef.value.load())); |
|||
onUnmounted(() => PubSub.unsubscribe(event)); |
|||
return { config, onCommand, appListRef }; |
|||
}, |
|||
}; |
|||
|
Loading…
Reference in new issue