Merge branch 'master' of http://gitea.xxhhcty.xyz:8080/zcdsj/factory_web
This commit is contained in:
commit
f9694f0466
|
|
@ -63,7 +63,7 @@
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, defineProps, onMounted } from "vue";
|
import { ref, defineProps, onMounted, watch } from "vue";
|
||||||
import { actStateEnum, interveneTypeEnum } from "@/utils/enum.js";
|
import { actStateEnum, interveneTypeEnum } from "@/utils/enum.js";
|
||||||
import API from '@/api';
|
import API from '@/api';
|
||||||
import TOOL from "@/utils/tool.js";
|
import TOOL from "@/utils/tool.js";
|
||||||
|
|
@ -79,18 +79,26 @@ const ticketDetail = ref({
|
||||||
});
|
});
|
||||||
const ticketLog = ref([]);
|
const ticketLog = ref([]);
|
||||||
const ticketId = ref(null);
|
const ticketId = ref(null);
|
||||||
watch(
|
|
||||||
() => props.ticket_,
|
|
||||||
async (newVal) => {
|
|
||||||
if (newVal && Object.keys(newVal).length > 0) {
|
|
||||||
ticketId.value = newVal.id
|
|
||||||
getTicketDetail()
|
|
||||||
getTicketLog()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{ immediate: false }
|
|
||||||
)
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
// 立即处理初始值
|
||||||
|
if (props.ticket_ && Object.keys(props.ticket_).length > 0) {
|
||||||
|
ticketId.value = props.ticket_.id
|
||||||
|
getTicketDetail()
|
||||||
|
getTicketLog()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 同时监听后续变化
|
||||||
|
watch(
|
||||||
|
() => props.ticket_,
|
||||||
|
async (newVal) => {
|
||||||
|
if (newVal && Object.keys(newVal).length > 0) {
|
||||||
|
ticketId.value = newVal.id
|
||||||
|
getTicketDetail()
|
||||||
|
getTicketLog()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
)
|
||||||
});
|
});
|
||||||
const emit = defineEmits(['success']);
|
const emit = defineEmits(['success']);
|
||||||
const refreshTicket = async () => {
|
const refreshTicket = async () => {
|
||||||
|
|
|
||||||
|
|
@ -35,21 +35,22 @@ const props = defineProps({
|
||||||
const workflow = ref(null);
|
const workflow = ref(null);
|
||||||
const transitions = ref([]);
|
const transitions = ref([]);
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
init()
|
init();
|
||||||
|
watch(
|
||||||
|
() => props.ticket_,
|
||||||
|
async (newVal) => {
|
||||||
|
if (newVal && Object.keys(newVal).length > 0) {
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
)
|
||||||
})
|
})
|
||||||
watch(
|
|
||||||
() => props.ticket_,
|
|
||||||
async (newVal) => {
|
|
||||||
if (newVal && Object.keys(newVal).length > 0) {
|
|
||||||
await init()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{ immediate: false }
|
|
||||||
)
|
|
||||||
const ticketId = ref(null);
|
const ticketId = ref(null);
|
||||||
const actionShow = ref(false);
|
const actionShow = ref(false);
|
||||||
const init = async () => {
|
const init = async () => {
|
||||||
if (props.ticket_ != null && props.ticket_ != undefined) {
|
if (props.ticket_ && Object.keys(props.ticket_).length > 0) {
|
||||||
const isParticipant =
|
const isParticipant =
|
||||||
(props.ticket_.participant_type === 1 && props.ticket_.participant === currentUser.value) ||
|
(props.ticket_.participant_type === 1 && props.ticket_.participant === currentUser.value) ||
|
||||||
(props.ticket_.participant_type === 2 && props.ticket_.participant.includes(currentUser.value))
|
(props.ticket_.participant_type === 2 && props.ticket_.participant.includes(currentUser.value))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue