|
...
|
...
|
@@ -25,11 +25,28 @@ |
|
25
|
25
|
</div>
|
|
26
|
26
|
</Upload>
|
|
27
|
27
|
</template>
|
|
|
28
|
+ <template #videoPlatformIdSlot="{ model, field }">
|
|
|
29
|
+ <a-select
|
|
|
30
|
+ placeholder="请选择流媒体配置"
|
|
|
31
|
+ v-model:value="model[field]"
|
|
|
32
|
+ :options="streamConfigOptions.map((item) => ({ value: item.value, label: item.label }))"
|
|
|
33
|
+ >
|
|
|
34
|
+ <template #dropdownRender="{ menuNode: menu }">
|
|
|
35
|
+ <v-nodes :vnodes="menu" />
|
|
|
36
|
+ <a-divider style="margin: 4px 0" />
|
|
|
37
|
+ <div @click="handleOpenStreamConfig" style="padding: 4px 8px; cursor: pointer">
|
|
|
38
|
+ <plus-outlined />
|
|
|
39
|
+ 新增流媒体配置
|
|
|
40
|
+ </div>
|
|
|
41
|
+ </template>
|
|
|
42
|
+ </a-select>
|
|
|
43
|
+ </template>
|
|
28
|
44
|
</BasicForm>
|
|
29
|
45
|
</BasicDrawer>
|
|
|
46
|
+ <SteramingDrawer @register="registerSteramingDrawer" @success="handleSuccess" />
|
|
30
|
47
|
</template>
|
|
31
|
48
|
<script lang="ts">
|
|
32
|
|
- import { defineComponent, ref, computed, unref, nextTick } from 'vue';
|
|
|
49
|
+ import { defineComponent, ref, computed, unref, nextTick, onMounted } from 'vue';
|
|
33
|
50
|
import { BasicForm, useForm } from '/@/components/Form';
|
|
34
|
51
|
import { formSchema } from './config.data';
|
|
35
|
52
|
import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
|
|
...
|
...
|
@@ -39,14 +56,27 @@ |
|
39
|
56
|
import { PlusOutlined, LoadingOutlined } from '@ant-design/icons-vue';
|
|
40
|
57
|
import { upload } from '/@/api/oss/ossFileUploader';
|
|
41
|
58
|
import { FileItem } from '/@/components/Upload/src/typing';
|
|
|
59
|
+ import { getStreamingMediaList } from '/@/api/camera/cameraManager';
|
|
|
60
|
+ import SteramingDrawer from '../streaming/SteramingDrawer.vue';
|
|
|
61
|
+ import { useDrawer } from '/@/components/Drawer';
|
|
42
|
62
|
|
|
43
|
63
|
export default defineComponent({
|
|
44
|
64
|
name: 'ContactDrawer',
|
|
45
|
|
- components: { BasicDrawer, BasicForm, Upload, PlusOutlined, LoadingOutlined },
|
|
|
65
|
+ components: {
|
|
|
66
|
+ BasicDrawer,
|
|
|
67
|
+ BasicForm,
|
|
|
68
|
+ Upload,
|
|
|
69
|
+ PlusOutlined,
|
|
|
70
|
+ LoadingOutlined,
|
|
|
71
|
+ SteramingDrawer,
|
|
|
72
|
+ VNodes: (_, { attrs }) => {
|
|
|
73
|
+ return attrs.vnodes;
|
|
|
74
|
+ },
|
|
|
75
|
+ },
|
|
46
|
76
|
emits: ['success', 'register'],
|
|
47
|
77
|
setup(_, { emit }) {
|
|
48
|
78
|
const loading = ref(false);
|
|
49
|
|
-
|
|
|
79
|
+ const streamConfigOptions: any = ref([]);
|
|
50
|
80
|
const isUpdate = ref(true);
|
|
51
|
81
|
const editId = ref('');
|
|
52
|
82
|
const [registerForm, { validate, setFieldsValue, resetFields }] = useForm({
|
|
...
|
...
|
@@ -54,7 +84,32 @@ |
|
54
|
84
|
schemas: formSchema,
|
|
55
|
85
|
showActionButtonGroup: false,
|
|
56
|
86
|
});
|
|
|
87
|
+ onMounted(async () => {
|
|
|
88
|
+ const res = await getStreamingMediaList({});
|
|
|
89
|
+ streamConfigOptions.value = res.map((m) => {
|
|
|
90
|
+ return {
|
|
|
91
|
+ label: m.host,
|
|
|
92
|
+ value: m.id,
|
|
|
93
|
+ };
|
|
|
94
|
+ });
|
|
|
95
|
+ });
|
|
|
96
|
+ const [registerSteramingDrawer, { openDrawer }] = useDrawer();
|
|
57
|
97
|
|
|
|
98
|
+ const handleOpenStreamConfig = () => {
|
|
|
99
|
+ openDrawer(true, {
|
|
|
100
|
+ createFlag: true,
|
|
|
101
|
+ });
|
|
|
102
|
+ };
|
|
|
103
|
+ async function handleSuccess() {
|
|
|
104
|
+ const res = await getStreamingMediaList({});
|
|
|
105
|
+ if (res) {
|
|
|
106
|
+ streamConfigOptions.value = res.map((m) => {
|
|
|
107
|
+ return { label: m.host, value: m.id };
|
|
|
108
|
+ });
|
|
|
109
|
+ } else {
|
|
|
110
|
+ streamConfigOptions.value = [];
|
|
|
111
|
+ }
|
|
|
112
|
+ }
|
|
58
|
113
|
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
|
59
|
114
|
await resetFields();
|
|
60
|
115
|
setDrawerProps({ confirmLoading: false });
|
|
...
|
...
|
@@ -136,6 +191,10 @@ |
|
136
|
191
|
beforeUpload,
|
|
137
|
192
|
tenantLogo,
|
|
138
|
193
|
loading,
|
|
|
194
|
+ streamConfigOptions,
|
|
|
195
|
+ registerSteramingDrawer,
|
|
|
196
|
+ handleOpenStreamConfig,
|
|
|
197
|
+ handleSuccess,
|
|
139
|
198
|
};
|
|
140
|
199
|
},
|
|
141
|
200
|
});
|
...
|
...
|
|