Ben Lin
2025-02-27 8a12783afd1d6c4881d90e66bb0a52010a1598ae
src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue
@@ -4,7 +4,7 @@
 * @version: 
 * @Date: 2024-06-20 12:13:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-10-07 16:52:03
 * @LastEditTime: 2024-10-16 00:34:34
-->
<template>
  <Card :title="GetTitle(props.configType)['navTitle']">
@@ -24,7 +24,7 @@
      <Form class="properties-body" label-align="left" layout="vertical" v-if="item.isCustEl">
        <FormItem label="是否默认" name="是否默认">
          <Switch
            v-model:checked="isDefault[selectedNodes[0]['code']]"
            v-model:checked="selectedNodes[0]['isDefault']"
            @change="(e) => switchChange(e, selectedNodes[0])"
          />
        </FormItem>
@@ -69,6 +69,8 @@
  import { EntityCustFunctionType } from '/@/api/tigerapi/model/basModel';
  import { useModal } from '/@/components/Modal';
  import { CustModalParams } from '/@/api/tigerapi/model/systemModel';
  import { useProdRouteStore } from '/@/store/modules/prodRoute';
  import { useUserStore } from '/@/store/modules/user';
  const ACard = Card;
  const objParams = inject('objParams') as Ref<any>;
@@ -78,8 +80,7 @@
    nodes: { type: Array as PropType<any[]> },
  });
  const keyCode = ref(objParams.value['CODE']);
  const isDefault = ref({});
  isDefault[selectedNodes.value[0]['code']] = false;
  const useProdRoute = useProdRouteStore();
  const custImport = ref<any[]>([]);
  const EntityCustFunction = ref([
    {
@@ -168,17 +169,18 @@
   * @return {*}
   */
  function switchChange(e, d) {
    CustFunc({
      ctype: 'isDefault',
      others: { ...d, ...{ isDefault: e } },
      keyCode: keyCode.value,
    }).then((res) => {
      console.log(res,isDefault);
      if(res.IsSuccessed){
        if(e){
    const p = useProdRoute.getParent(d.tid);
    if (p.code == `DefaultRoute_${useUserStore().getUserInfo.orgCode as string}_${keyCode.value}`) {
      CustFunc({
        ctype: 'isDefault',
        others: { ...d, ...{ isDefault: e } },
        keyCode: keyCode.value,
      }).then((res) => {
        if (res.IsSuccessed) {
          if (e) {
          }
        }
      }
    });
      });
    }
  }
</script>