@sigmaott/base-next 1.4.54 → 1.4.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -15,31 +15,30 @@ const isEvent = ref(inject('isEvent'))
|
|
|
15
15
|
const isPackage = ref(inject('isPackage'))
|
|
16
16
|
const { transcodeInput, packageInput } = useGetInputDetail({
|
|
17
17
|
formValue,
|
|
18
|
-
isTranscode
|
|
18
|
+
isTranscode,
|
|
19
19
|
isPackage,
|
|
20
20
|
isEvent,
|
|
21
21
|
})
|
|
22
22
|
|
|
23
|
-
function
|
|
23
|
+
function getProgramMapByPid(pid: string) {
|
|
24
24
|
if (!pid)
|
|
25
25
|
return null
|
|
26
|
-
let programs: any[] = []
|
|
27
|
-
let programMaps: any[] = []
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
?
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
27
|
+
const programMaps: any[] = (isTranscode.value || isEvent.value)
|
|
28
|
+
? (transcodeInput.value?.programMaps ?? [])
|
|
29
|
+
: (packageInput.value?.programMaps ?? [])
|
|
30
|
+
|
|
31
|
+
return programMaps.find((pm: any) => {
|
|
32
|
+
const rawPids = pm.pids || []
|
|
33
|
+
const pidList = Array.isArray(rawPids)
|
|
34
|
+
? rawPids.map(String)
|
|
35
|
+
: (typeof rawPids === 'string' ? rawPids.split(',').map(s => s.trim()) : [])
|
|
36
|
+
return pidList.includes(String(pid))
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function getProgramIdByPid(pid: string) {
|
|
41
|
+
return getProgramMapByPid(pid)?.id
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
const [inputPIdValue, inputPIdAttrs] = useElField<string>(getProp('streamId'), [
|
|
@@ -174,9 +173,12 @@ function getStream(type: string) {
|
|
|
174
173
|
const filtered = programs.filter(program => program.type === type)
|
|
175
174
|
|
|
176
175
|
const newOptions = filtered.map((program) => {
|
|
176
|
+
const programMap = getProgramMapByPid(program.id)
|
|
177
177
|
return {
|
|
178
178
|
...program,
|
|
179
|
-
programId:
|
|
179
|
+
programId: programMap?.id,
|
|
180
|
+
programName: programMap?.name,
|
|
181
|
+
provider: programMap?.provider,
|
|
180
182
|
}
|
|
181
183
|
})
|
|
182
184
|
|
|
@@ -195,6 +197,33 @@ function handleChangeOutputPID(value: string) {
|
|
|
195
197
|
ElMessage.error($t('SSConfig.output_pid_cannot_exceed_50_characters'))
|
|
196
198
|
}
|
|
197
199
|
}
|
|
200
|
+
|
|
201
|
+
const groupedStreams = computed(() => {
|
|
202
|
+
const streams = getStream(mediaType.value || '')
|
|
203
|
+
const groups: any[] = []
|
|
204
|
+
const map = new Map()
|
|
205
|
+
|
|
206
|
+
streams.forEach((stream) => {
|
|
207
|
+
const key = stream.programId || 'default'
|
|
208
|
+
if (!map.has(key)) {
|
|
209
|
+
const label = [
|
|
210
|
+
stream.programName ? `${stream.programName}` : '',
|
|
211
|
+
stream.programId ? `(ID: ${stream.programId})` : '',
|
|
212
|
+
stream.provider ? `- ${stream.provider}` : '',
|
|
213
|
+
].filter(Boolean).join(' ')
|
|
214
|
+
|
|
215
|
+
const group = {
|
|
216
|
+
label: label || 'Other Streams',
|
|
217
|
+
options: [],
|
|
218
|
+
}
|
|
219
|
+
map.set(key, group)
|
|
220
|
+
groups.push(group)
|
|
221
|
+
}
|
|
222
|
+
map.get(key).options.push(stream)
|
|
223
|
+
})
|
|
224
|
+
|
|
225
|
+
return groups
|
|
226
|
+
})
|
|
198
227
|
</script>
|
|
199
228
|
|
|
200
229
|
<template>
|
|
@@ -205,10 +234,12 @@ function handleChangeOutputPID(value: string) {
|
|
|
205
234
|
<el-form-item label="Input PID" v-bind="inputPIdAttrs" class="w-586px">
|
|
206
235
|
<el-select v-model="inputPIdValue" clearable :placeholder="t('SSConfig.enter_the_pid_placeholder')" filterable
|
|
207
236
|
allow-create @change="handleChangeInputPID">
|
|
208
|
-
<el-option v-for="
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
237
|
+
<el-option-group v-for="group in groupedStreams" :key="group.label" :label="group.label">
|
|
238
|
+
<el-option v-for="(preset, index) in group.options" :key="`${preset.id} + ${index}`" class="w-700px !h-auto"
|
|
239
|
+
:value="preset.id" :label="preset.id">
|
|
240
|
+
<MediaInfoViewer :isShowPId="true" :media="preset" />
|
|
241
|
+
</el-option>
|
|
242
|
+
</el-option-group>
|
|
212
243
|
</el-select>
|
|
213
244
|
</el-form-item>
|
|
214
245
|
<el-form-item label="Output PID" v-bind="outputPIdAttrs" class="w-586px">
|
|
@@ -217,3 +248,11 @@ function handleChangeOutputPID(value: string) {
|
|
|
217
248
|
</el-form-item>
|
|
218
249
|
</div>
|
|
219
250
|
</template>
|
|
251
|
+
|
|
252
|
+
<style scoped lang="scss">
|
|
253
|
+
:deep(.el-select-group__title) {
|
|
254
|
+
font-weight: bold !important;
|
|
255
|
+
color: var(--el-text-color-primary) !important;
|
|
256
|
+
font-size: 14px !important;
|
|
257
|
+
}
|
|
258
|
+
</style>
|