| | |
| | | * @version: |
| | | * @Date: 2024-06-20 12:13:27 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-08-01 19:26:30 |
| | | * @LastEditTime: 2024-10-07 16:52:03 |
| | | --> |
| | | <template> |
| | | <Card :title="GetTitle(props.configType)['navTitle']"> |
| | |
| | | @click=" |
| | | navChangeItem( |
| | | item.action, |
| | | useModalData[item.action][1].openModal, |
| | | !item.isCustEl ? useModalData[item.action][1].openModal : null, |
| | | openRvModal, |
| | | selectedNodes, |
| | | keyCode, |
| | | ) |
| | | " |
| | | > |
| | | <span class="flex flex-col items-center"> |
| | | <Form class="properties-body" label-align="left" layout="vertical" v-if="item.isCustEl"> |
| | | <FormItem label="是否默认" name="是否默认"> |
| | | <Switch |
| | | v-model:checked="isDefault[selectedNodes[0]['code']]" |
| | | @change="(e) => switchChange(e, selectedNodes[0])" |
| | | /> |
| | | </FormItem> |
| | | </Form> |
| | | <span v-if="!item.isCustEl" class="flex flex-col items-center"> |
| | | <Icon :icon="item.icon" :color="item.color" size="20" /> |
| | | <span class="text-md mt-2 truncate">{{ item.title }}</span> |
| | | </span> |
| | | <GeneralModal |
| | | v-if="!item.isStep" |
| | | v-if="!item.isStep && !item.isCustEl" |
| | | @register="useModalData[item.action][0]" |
| | | @success="(d, u) => handleSuccess(d, u, item.action, objParams, refreshPage)" |
| | | ></GeneralModal> |
| | |
| | | <RouteViewModal @register="registerRv" @success="RvItemSuccess" /> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { Card, CardGrid } from 'ant-design-vue'; |
| | | import { Card, CardGrid, Switch, Form, FormItem } from 'ant-design-vue'; |
| | | import Icon from '@/components/Icon/Icon.vue'; |
| | | import GeneralModal from '/@/views/components/GeneralModal.vue'; |
| | | import RouteViewModal from '/@/views/components/RouteViewModal.vue'; |
| | |
| | | configType: { type: String }, |
| | | nodes: { type: Array as PropType<any[]> }, |
| | | }); |
| | | const keyCode = ref(objParams.value['CODE']); |
| | | const isDefault = ref({}); |
| | | isDefault[selectedNodes.value[0]['code']] = false; |
| | | const custImport = ref<any[]>([]); |
| | | const EntityCustFunction = ref([ |
| | | { |
| | |
| | | } |
| | | |
| | | function RvItemSuccess(d, u) {} |
| | | |
| | | /** |
| | | * @description: 开关改变事件 |
| | | * @param {*} d |
| | | * @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){ |
| | | |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | </script> |