切换主题
关闭所有窗口
关闭所有窗口示例
<script setup name="CloseAllWindows">
import { ref } from 'vue'
import {ElMessage} from 'element-plus'
import { checkInstance, getInstanceFCC } from '../../use-fcc'
import { setLog } from '../../use-log'
const token = ref('')
const userAccount = ref('')
const loading = ref(false)
const closeAllWindows = async () => {
if (loading.vue) {
setLog({
name: '关闭所有窗口结果',
msg: '请先实例化'
})
return
}
if (!await checkInstance()) {
setLog({
name: '关闭所有窗口',
msg: '请先实例化'
})
ElMessage({
message: '请先实例化',
type: 'warning'
})
return
}
loading.vue = true
let result = await getInstanceFCC().closeAllWindows()
setLog({
name: '关闭所有窗口结果',
msg: result
})
loading.vue = false
if (result.status == 200) {
ElMessage({
message: '关闭所有窗口成功',
type: 'success'
})
} else {
ElMessage({
message: result.msg,
type: 'info'
})
}
}
</script>
<template>
<el-form>
<el-form-item>
<el-button type="primary" @click="closeAllWindows" v-loading="loading">关闭所有窗口</el-button>
</el-form-item>
</el-form>
</template>使用方法
typescript
const result = await fcc.closeAllWindows()
if (result.status === 200) {
console.log('关闭所有窗口成功')
} else {
console.log('关闭所有窗口失败')
}1
2
3
4
5
6
2
3
4
5
6
入参说明
无
出参说明
| 出参名称 | 数据类型 | 说明 |
|---|---|---|
| status | number | 调用其接口返回结果的状态码,其含义请参考融合通讯中台通用状态码。 |
| msg | string | 给开发者的文字提示信息 |
| data | object | 参会成员集合 |
