Commit dee9cae0c45fef27d1beee2f13974449b464aeb8
Merge branch 'ft' into 'main_dev'
fix(src/packages/): 优化加载组态右侧配置是否公开按钮样式 See merge request yunteng/thingskit-view!103
Showing
2 changed files
with
18 additions
and
20 deletions
| 1 | 1 | /** |
| 2 | 2 | * 重写select下拉框联动 |
| 3 | 3 | */ |
| 4 | -import {toRaw, toRefs} from 'vue' | |
| 5 | -import {CreateComponentType} from '@/packages/index.d' | |
| 4 | +import {toRefs} from 'vue' | |
| 5 | +import {CreateComponentGroupType, CreateComponentType} from '@/packages/index.d' | |
| 6 | 6 | import {useChartEditStore} from '@/store/modules/chartEditStore/chartEditStore' |
| 7 | -import {customRequest} from "@/api/external/customRequest"; | |
| 8 | -import {useFilterFn} from "@/hooks/external/useFilterFn"; | |
| 9 | 7 | |
| 10 | 8 | // 获取类型 |
| 11 | 9 | type ChartEditStoreType = typeof useChartEditStore |
| ... | ... | @@ -27,26 +25,24 @@ export const useChartInteract = ( |
| 27 | 25 | fnOnEvent.forEach(async (item) => { |
| 28 | 26 | const index = chartEditStore.fetchTargetIndex(item.interactComponentId) |
| 29 | 27 | if (index === -1) return |
| 30 | - const {Params, Header} = toRefs(chartEditStore.componentList[index].request.requestParams) | |
| 31 | - Object.keys(item.interactFn).forEach(key => { | |
| 28 | + //支持分组 | |
| 29 | + const target = chartEditStore.getComponentList?.reduce((prev: Array<CreateComponentType | CreateComponentGroupType>, acc) => { | |
| 30 | + acc?.isGroup ? (prev = [...(acc?.groupList as CreateComponentGroupType[])]) : prev?.push(acc) | |
| 31 | + return prev | |
| 32 | + }, []) | |
| 33 | + target?.forEach((targetItem)=>{ | |
| 34 | + if(targetItem.id!==chartConfig.id){ | |
| 35 | + const {Params, Header} = toRefs(targetItem.request.requestParams) | |
| 36 | + Object.keys(item.interactFn).forEach(key => { | |
| 32 | 37 | if (Params.value[key]) { |
| 33 | 38 | Params.value[key] = param[item.interactFn[key]] |
| 34 | 39 | } |
| 35 | 40 | if (Header.value[key]) { |
| 36 | 41 | Header.value[key] = param[item.interactFn[key]] |
| 37 | 42 | } |
| 38 | - }) | |
| 39 | - const res = await customRequest(toRaw(chartEditStore.componentList[index].request)) | |
| 40 | - if (res) { | |
| 41 | - try { | |
| 42 | - const filter = chartEditStore.componentList[index].filter | |
| 43 | - const {value} = useFilterFn(filter, res) | |
| 44 | - if (!value) return | |
| 45 | - chartEditStore.componentList[index].option.dataset = value | |
| 46 | - } finally { | |
| 47 | - console.log | |
| 43 | + }) | |
| 48 | 44 | } |
| 49 | - } | |
| 45 | + }) | |
| 50 | 46 | }) |
| 51 | 47 | } |
| 52 | 48 | ... | ... |
| ... | ... | @@ -6,9 +6,11 @@ |
| 6 | 6 | :options="configurationOptions"/> |
| 7 | 7 | </setting-item> |
| 8 | 8 | </setting-item-box> |
| 9 | - <setting-item-box name="是否公开" :alone="true"> | |
| 10 | - <setting-item name=""> | |
| 11 | - <n-switch @change="handleChange" v-model:value="optionData.isShare" size="small"/> | |
| 9 | + <setting-item-box name="是否公开"> | |
| 10 | + <setting-item> | |
| 11 | + <div style="display:flex"> | |
| 12 | + <n-switch @change="handleChange" v-model:value="optionData.isShare" size="small"/> | |
| 13 | + </div> | |
| 12 | 14 | </setting-item> |
| 13 | 15 | </setting-item-box> |
| 14 | 16 | <setting-item-box name="样式"> | ... | ... |