소스 검색

add parentChannelId parentStudioId

visuddhinanda 2 년 전
부모
커밋
6eb914d57b
1개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 8 2
      dashboard/src/components/channel/ChannelSelect.tsx

+ 8 - 2
dashboard/src/components/channel/ChannelSelect.tsx

@@ -15,6 +15,8 @@ interface IWidget {
   name?: string;
   name?: string;
   tooltip?: string;
   tooltip?: string;
   label?: string;
   label?: string;
+  parentChannelId?: string;
+  parentStudioId?: string;
   onSelect?: Function;
   onSelect?: Function;
 }
 }
 const ChannelSelectWidget = ({
 const ChannelSelectWidget = ({
@@ -23,6 +25,8 @@ const ChannelSelectWidget = ({
   name = "channel",
   name = "channel",
   tooltip,
   tooltip,
   label,
   label,
+  parentChannelId,
+  parentStudioId,
   onSelect,
   onSelect,
 }: IWidget) => {
 }: IWidget) => {
   return (
   return (
@@ -42,8 +46,10 @@ const ChannelSelectWidget = ({
           for (const iterator of json.data.rows) {
           for (const iterator of json.data.rows) {
             studio.set(iterator.studio.id, iterator.studio.nickName);
             studio.set(iterator.studio.id, iterator.studio.nickName);
           }
           }
-          let channels: IOption[] = [];
-
+          let channels: IOption[] = [{ value: "", label: "通用于此Studio" }];
+          if (typeof parentChannelId === "string") {
+            channels.push({ value: parentChannelId, label: "仅此版本" });
+          }
           studio.forEach((value, key, map) => {
           studio.forEach((value, key, map) => {
             const node = {
             const node = {
               value: key,
               value: key,