Commit 612086218645dda1174cadb349d66d10c4a7f031

Authored by fengistao
1 parent ad6bb0b4

feat:修复没分配首页权限显示404,秋云修复修改密码,wip:设配配置搜集三个子弹窗的数据

@@ -6,7 +6,8 @@ VITE_PUBLIC_PATH = / @@ -6,7 +6,8 @@ VITE_PUBLIC_PATH = /
6 6
7 # Cross-domain proxy, you can configure multiple 7 # Cross-domain proxy, you can configure multiple
8 # Please note that no line breaks 8 # Please note that no line breaks
9 -VITE_PROXY = [["/api","http://192.168.10.117:8082/api"],["/upload","http://192.168.10.116:3300/upload"]] 9 +# VITE_PROXY = [["/api","http://192.168.10.118:8080/api"],["/upload","http://192.168.10.116:3300/upload"]]
  10 +VITE_PROXY = [["/api","http://101.133.234.90:8080/api"],["/upload","http://192.168.10.116:3300/upload"]]
10 # VITE_PROXY=[["/api","https://vvbin.cn/test"]] 11 # VITE_PROXY=[["/api","https://vvbin.cn/test"]]
11 12
12 # Delete console 13 # Delete console
@@ -19,4 +20,4 @@ VITE_GLOB_API_URL=/api @@ -19,4 +20,4 @@ VITE_GLOB_API_URL=/api
19 VITE_GLOB_UPLOAD_URL=/upload 20 VITE_GLOB_UPLOAD_URL=/upload
20 21
21 # Interface prefix 22 # Interface prefix
22 -VITE_GLOB_API_URL_PREFIX=/v1 23 +VITE_GLOB_API_URL_PREFIX=/yt
@@ -124,7 +124,7 @@ @@ -124,7 +124,7 @@
124 "ts-jest": "^27.0.4", 124 "ts-jest": "^27.0.4",
125 "ts-node": "^10.2.0", 125 "ts-node": "^10.2.0",
126 "typescript": "4.3.5", 126 "typescript": "4.3.5",
127 - "vite": "2.5.0", 127 + "vite": "2.6.13",
128 "vite-plugin-compression": "^0.3.3", 128 "vite-plugin-compression": "^0.3.3",
129 "vite-plugin-html": "^2.0.7", 129 "vite-plugin-html": "^2.0.7",
130 "vite-plugin-imagemin": "^0.4.3", 130 "vite-plugin-imagemin": "^0.4.3",
@@ -71,7 +71,9 @@ export const notifyAddLeaseApi = (params: NotifyAddreLeaseModel) => { @@ -71,7 +71,9 @@ export const notifyAddLeaseApi = (params: NotifyAddreLeaseModel) => {
71 export const notifyDeleteApi = (ids: string[]) => { 71 export const notifyDeleteApi = (ids: string[]) => {
72 return defHttp.delete({ 72 return defHttp.delete({
73 url: NotifyManagerApi.NOTICE_DELETE_URL, 73 url: NotifyManagerApi.NOTICE_DELETE_URL,
74 - data: ids, 74 + data: {
  75 + ids,
  76 + },
75 }); 77 });
76 }; 78 };
77 79
1 -// import { getMenuList } from '/@/api/sys/menu';  
2 -// import { reactive } from 'vue';  
3 -  
4 -// const isDolang = reactive({  
5 -// key: 1,  
6 -// value: '',  
7 -// });  
8 -// //这里判断是否含有首页  
9 -// async function doMenu() {  
10 -// const routeList = await getMenuList();  
11 -// const getHomePage = routeList.find((f) => {  
12 -// return f.path == '/dashboard';  
13 -// });  
14 -// if (getHomePage?.path == '/dashboard') {  
15 -// // router.push('/dashboard');  
16 -// } else {  
17 -// const route = routeList[0].path + '';  
18 -// isDolang.key = 1;  
19 -// isDolang.value = route;  
20 -// return isDolang;  
21 -// // router.push(route);  
22 -// }  
23 -// }  
24 -  
25 -// setTimeout(() => {  
26 -// doMenu();  
27 -// }, 1000);  
28 -  
29 -// console.log(isDolang.value);  
30 -// console.log(typeof isDolang.value);  
31 -  
32 -// setTimeout(() => {  
33 -// console.log(isDolang);  
34 -// }, 1500);  
35 -const firstMenu = '/system/account';  
36 -  
37 export const PageEnum = { 1 export const PageEnum = {
38 // basic login path 2 // basic login path
39 BASE_LOGIN: '/login', 3 BASE_LOGIN: '/login',
40 // basic home path 4 // basic home path
41 - BASE_HOME: firstMenu,  
42 - // BASE_HOME = '/dashboard', 5 + // BASE_HOME: isDolang.value == '/dashboard/workbench' ? '/dashboard/workbench' : isDolang.value,
  6 + BASE_HOME: '/dashboard/workbench',
43 // error page path 7 // error page path
44 ERROR_PAGE: '/exception', 8 ERROR_PAGE: '/exception',
45 // error log page path 9 // error log page path
@@ -21,11 +21,29 @@ @@ -21,11 +21,29 @@
21 </transition> 21 </transition>
22 </template> 22 </template>
23 </RouterView> 23 </RouterView>
  24 + <BasicModal
  25 + @register="register"
  26 + v-bind="$attrs"
  27 + :mask="true"
  28 + :showCancelBtn="false"
  29 + :showOkBtn="false"
  30 + :canFullscreen="false"
  31 + :closable="false"
  32 + :maskStyle="maskColor"
  33 + :height="600"
  34 + :width="1500"
  35 + :maskClosable="false"
  36 + title="请您修改初始密码"
  37 + :helpMessage="['请您修改初始密码']"
  38 + >
  39 + <PasswordDialog />
  40 + </BasicModal>
24 <FrameLayout v-if="getCanEmbedIFramePage" /> 41 <FrameLayout v-if="getCanEmbedIFramePage" />
25 </template> 42 </template>
26 43
27 <script lang="ts"> 44 <script lang="ts">
28 - import { computed, defineComponent, unref } from 'vue'; 45 + import { computed, defineComponent, ref, unref, onMounted } from 'vue';
  46 + import PasswordDialog from '/@/views/system/password/index.vue';
29 47
30 import FrameLayout from '/@/layouts/iframe/index.vue'; 48 import FrameLayout from '/@/layouts/iframe/index.vue';
31 49
@@ -36,10 +54,12 @@ @@ -36,10 +54,12 @@
36 import { getTransitionName } from './transition'; 54 import { getTransitionName } from './transition';
37 55
38 import { useMultipleTabStore } from '/@/store/modules/multipleTab'; 56 import { useMultipleTabStore } from '/@/store/modules/multipleTab';
39 - 57 + import { BasicModal, useModal } from '/@/components/Modal';
  58 + import { USER_INFO_KEY } from '/@/enums/cacheEnum';
  59 + import { getAuthCache } from '/@/utils/auth';
40 export default defineComponent({ 60 export default defineComponent({
41 name: 'PageLayout', 61 name: 'PageLayout',
42 - components: { FrameLayout }, 62 + components: { FrameLayout, BasicModal, PasswordDialog },
43 setup() { 63 setup() {
44 const { getShowMultipleTab } = useMultipleTabSetting(); 64 const { getShowMultipleTab } = useMultipleTabSetting();
45 const tabStore = useMultipleTabStore(); 65 const tabStore = useMultipleTabStore();
@@ -57,6 +77,17 @@ @@ -57,6 +77,17 @@
57 return tabStore.getCachedTabList; 77 return tabStore.getCachedTabList;
58 }); 78 });
59 79
  80 + const [register, { openModal }] = useModal();
  81 + const maskColor = ref({ backgroundColor: 'grey' });
  82 + const statusModel = ref(false);
  83 + onMounted(() => {
  84 + const userInfo = getAuthCache(USER_INFO_KEY);
  85 + if (userInfo.needSetPwd == true) {
  86 + statusModel.value = true;
  87 + openModal(statusModel.value);
  88 + }
  89 + });
  90 +
60 return { 91 return {
61 getTransitionName, 92 getTransitionName,
62 openCache, 93 openCache,
@@ -64,6 +95,8 @@ @@ -64,6 +95,8 @@
64 getBasicTransition, 95 getBasicTransition,
65 getCaches, 96 getCaches,
66 getCanEmbedIFramePage, 97 getCanEmbedIFramePage,
  98 + register,
  99 + maskColor,
67 }; 100 };
68 }, 101 },
69 }); 102 });
@@ -9,6 +9,9 @@ import { PAGE_NOT_FOUND_ROUTE } from '/@/router/routes/basic'; @@ -9,6 +9,9 @@ import { PAGE_NOT_FOUND_ROUTE } from '/@/router/routes/basic';
9 9
10 import { RootRoute } from '/@/router/routes'; 10 import { RootRoute } from '/@/router/routes';
11 11
  12 +import { router } from '/@/router';
  13 +import { getMenuList } from '/@/api/sys/menu';
  14 +
12 const LOGIN_PATH = PageEnum.BASE_LOGIN; 15 const LOGIN_PATH = PageEnum.BASE_LOGIN;
13 16
14 const ROOT_PATH = RootRoute.path; 17 const ROOT_PATH = RootRoute.path;
@@ -25,6 +28,7 @@ export function createPermissionGuard(router: Router) { @@ -25,6 +28,7 @@ export function createPermissionGuard(router: Router) {
25 userStore.getUserInfo.homePath && 28 userStore.getUserInfo.homePath &&
26 userStore.getUserInfo.homePath !== PageEnum.BASE_HOME 29 userStore.getUserInfo.homePath !== PageEnum.BASE_HOME
27 ) { 30 ) {
  31 + console.log('根路径');
28 next(userStore.getUserInfo.homePath); 32 next(userStore.getUserInfo.homePath);
29 return; 33 return;
30 } 34 }
@@ -60,12 +64,43 @@ export function createPermissionGuard(router: Router) { @@ -60,12 +64,43 @@ export function createPermissionGuard(router: Router) {
60 return; 64 return;
61 } 65 }
62 66
63 - // Jump to the 404 page after processing the login 67 + // if (from.path === LOGIN_PATH) {
  68 + // console.log('登录过后');
  69 + // router.push('/system/password');
  70 + // } else {
  71 + // // return;
  72 + // }
64 if ( 73 if (
65 from.path === LOGIN_PATH && 74 from.path === LOGIN_PATH &&
66 to.name === PAGE_NOT_FOUND_ROUTE.name && 75 to.name === PAGE_NOT_FOUND_ROUTE.name &&
67 to.fullPath !== (userStore.getUserInfo.homePath || PageEnum.BASE_HOME) 76 to.fullPath !== (userStore.getUserInfo.homePath || PageEnum.BASE_HOME)
68 ) { 77 ) {
  78 + // Jump to the 404 page after processing the login
  79 + console.log(router);
  80 + getMenuList().then((res) => {
  81 + if (res) {
  82 + console.log(res);
  83 + const getHomePage = res.find((f) => {
  84 + return f.path == '/dashboard/workbench';
  85 + });
  86 + if (getHomePage?.path == '/dashboard/workbench') {
  87 + setTimeout(() => {
  88 + router.push('/stationnotification/notificationmanager');
  89 + }, 10);
  90 + } else {
  91 + const routeF = res[0]?.children[0]?.path || res[0].path;
  92 + router.push(routeF);
  93 + }
  94 + }
  95 + });
  96 +
  97 + // if (getHomePage?.path == '/dashboard/workbench') {
  98 + // isDolang.value = '/dashboard/workbench';
  99 + // } else {
  100 + // const route = routeList[0].path + '';
  101 + // isDolang.key = 1;
  102 + // isDolang.value = route;
  103 + // }
69 next(userStore.getUserInfo.homePath || PageEnum.BASE_HOME); 104 next(userStore.getUserInfo.homePath || PageEnum.BASE_HOME);
70 return; 105 return;
71 } 106 }
@@ -21,7 +21,10 @@ export const asyncRoutes = [PAGE_NOT_FOUND_ROUTE, ...routeModuleList]; @@ -21,7 +21,10 @@ export const asyncRoutes = [PAGE_NOT_FOUND_ROUTE, ...routeModuleList];
21 export const RootRoute: AppRouteRecordRaw = { 21 export const RootRoute: AppRouteRecordRaw = {
22 path: '/', 22 path: '/',
23 name: 'Root', 23 name: 'Root',
  24 + // redirect: '/',
24 redirect: PageEnum.BASE_HOME, 25 redirect: PageEnum.BASE_HOME,
  26 + // redirect: !PageEnum.BASE_HOME ? '/dashboard' : PageEnum.BASE_HOME,
  27 + // redirect: '/dashboard',
25 meta: { 28 meta: {
26 title: 'Root', 29 title: 'Root',
27 }, 30 },
1 -import type { AppRouteModule } from '/@/router/types'; 1 +// import type { AppRouteModule } from '/@/router/types';
2 2
3 -import { LAYOUT } from '/@/router/constant';  
4 -import { t } from '/@/hooks/web/useI18n'; 3 +// import { LAYOUT } from '/@/router/constant';
  4 +// import { t } from '/@/hooks/web/useI18n';
5 5
6 -const dashboard: AppRouteModule = {  
7 - path: '/about',  
8 - name: 'About',  
9 - component: LAYOUT,  
10 - redirect: '/about/index',  
11 - meta: {  
12 - hideChildrenInMenu: true,  
13 - icon: 'simple-icons:about-dot-me',  
14 - title: t('routes.dashboard.about'),  
15 - orderNo: 100000,  
16 - },  
17 - children: [  
18 - {  
19 - path: 'index',  
20 - name: 'AboutPage',  
21 - component: () => import('/@/views/sys/about/index.vue'),  
22 - meta: {  
23 - title: t('routes.dashboard.about'),  
24 - icon: 'simple-icons:about-dot-me',  
25 - hideMenu: true,  
26 - },  
27 - },  
28 - ],  
29 -}; 6 +// const dashboard: AppRouteModule = {
  7 +// path: '/about',
  8 +// name: 'About',
  9 +// component: LAYOUT,
  10 +// redirect: '/about/index',
  11 +// meta: {
  12 +// hideChildrenInMenu: true,
  13 +// icon: 'simple-icons:about-dot-me',
  14 +// title: t('routes.dashboard.about'),
  15 +// orderNo: 100000,
  16 +// },
  17 +// children: [
  18 +// {
  19 +// path: 'index',
  20 +// name: 'AboutPage',
  21 +// component: () => import('/@/views/sys/about/index.vue'),
  22 +// meta: {
  23 +// title: t('routes.dashboard.about'),
  24 +// icon: 'simple-icons:about-dot-me',
  25 +// hideMenu: true,
  26 +// },
  27 +// },
  28 +// ],
  29 +// };
30 30
31 -export default dashboard; 31 +// export default dashboard;
@@ -5,6 +5,21 @@ import { Rule } from 'ant-design-vue/lib/form/interface'; @@ -5,6 +5,21 @@ import { Rule } from 'ant-design-vue/lib/form/interface';
5 */ 5 */
6 6
7 // 手机号验证 7 // 手机号验证
  8 +export const numberRule: Rule[] = [
  9 + {
  10 + required: true,
  11 + validator: (_, value: string) => {
  12 + const reg = /^[0-9]{8}$/;
  13 + if (!reg.test(value)) {
  14 + return Promise.reject('只能输入数字');
  15 + }
  16 + return Promise.resolve();
  17 + },
  18 + validateTrigger: 'blur',
  19 + },
  20 +];
  21 +
  22 +// 手机号验证
8 export const phoneRule: Rule[] = [ 23 export const phoneRule: Rule[] = [
9 { 24 {
10 required: true, 25 required: true,
@@ -12,49 +12,15 @@ @@ -12,49 +12,15 @@
12 <div class="md:w-3/10 w-full enter-y"> 12 <div class="md:w-3/10 w-full enter-y">
13 <HelpDoc /> 13 <HelpDoc />
14 </div> 14 </div>
15 - <!-- 密码弹窗 -->  
16 - <BasicModal  
17 - @register="register"  
18 - v-bind="$attrs"  
19 - :mask="true"  
20 - :showCancelBtn="false"  
21 - :showOkBtn="false"  
22 - :canFullscreen="false"  
23 - :closable="false"  
24 - :maskStyle="maskColor"  
25 - :height="600"  
26 - :width="1500"  
27 - :maskClosable="false"  
28 - title="请您修改初始密码"  
29 - :helpMessage="['请您修改初始密码']"  
30 - >  
31 - <PasswordDialog />  
32 - </BasicModal>  
33 </div> 15 </div>
34 </template> 16 </template>
35 <script lang="ts" setup> 17 <script lang="ts" setup>
36 - import PasswordDialog from '/@/views/system/password/index.vue';  
37 - import { BasicModal, useModal } from '/@/components/Modal';  
38 - import { getAuthCache } from '/@/utils/auth';  
39 - import { USER_INFO_KEY } from '/@/enums/cacheEnum';  
40 - import { ref, onMounted } from 'vue'; 18 + import { ref } from 'vue';
41 import GrowCard from './components/GrowCard.vue'; 19 import GrowCard from './components/GrowCard.vue';
42 import SiteAnalysis from './components/SiteAnalysis.vue'; 20 import SiteAnalysis from './components/SiteAnalysis.vue';
43 import { Card } from 'ant-design-vue'; 21 import { Card } from 'ant-design-vue';
44 import HelpDoc from './components/HelpDoc.vue'; 22 import HelpDoc from './components/HelpDoc.vue';
45 23
46 - const maskColor = ref({ backgroundColor: 'grey' });  
47 - const statusModel = ref(false);  
48 - const [register, { openModal }] = useModal();  
49 - onMounted(() => {  
50 - const userInfo = getAuthCache(USER_INFO_KEY);  
51 - if (userInfo.needSetPwd == true) {  
52 - statusModel.value = true;  
53 - openModal(statusModel.value);  
54 - } else if (userInfo.needSetPwd == false) {  
55 - openModal(statusModel.value);  
56 - }  
57 - });  
58 const loading = ref(true); 24 const loading = ref(true);
59 setTimeout(() => { 25 setTimeout(() => {
60 loading.value = false; 26 loading.value = false;
1 <template> 1 <template>
2 <div class="step3"> 2 <div class="step3">
3 - <template v-for="(item, index) in alarms" :key="item.id"> 3 + <template v-for="(item, index) in profileData" :key="item.id">
4 <CollapseContainer class="border mb-8"> 4 <CollapseContainer class="border mb-8">
5 <template #action> 5 <template #action>
6 <div @click="deleteAlarmRule(index)" class="cursor-pointer"> 6 <div @click="deleteAlarmRule(index)" class="cursor-pointer">
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 </BasicForm> 17 </BasicForm>
18 </CollapseContainer> 18 </CollapseContainer>
19 <p>创建报警规则</p> 19 <p>创建报警规则</p>
20 - <template v-for="(childItem, createIndex) in item.createRule" :key="childItem.id"> 20 + <template v-for="(childItem, createIndex) in item.alarms" :key="childItem.id">
21 <div class="aic mb-4" style="border: 1px solid #bfbfbf"> 21 <div class="aic mb-4" style="border: 1px solid #bfbfbf">
22 <div class="w-3/4"> 22 <div class="w-3/4">
23 <BasicForm @register="registerFormCreateAlarm" /> 23 <BasicForm @register="registerFormCreateAlarm" />
@@ -72,15 +72,29 @@ @@ -72,15 +72,29 @@
72 <a-button style="margin-left: 20px" type="primary" @click="addAlarmRule">添加报警规则</a-button> 72 <a-button style="margin-left: 20px" type="primary" @click="addAlarmRule">添加报警规则</a-button>
73 </div> 73 </div>
74 <!-- 详情模板 --> 74 <!-- 详情模板 -->
75 - <DetailTemplate v-if="isDetailTemplateEnableRuleAlarmRuleConditions" @register="registerModal" /> 75 + <DetailTemplate
  76 + v-if="isRuleAlarmRuleConditions == 1"
  77 + @getAllFields="getAllFieldsFunc"
  78 + @register="registerModal1"
  79 + />
76 <!-- 启用规则 --> 80 <!-- 启用规则 -->
77 - <EnableRule v-if="!isDetailTemplateEnableRuleAlarmRuleConditions" @register="registerModal" /> 81 + <EnableRule
  82 + v-if="isRuleAlarmRuleConditions == 2"
  83 + ref="getChildData2"
  84 + @getAllFieldsEnab="getAllFieldsEnabFunc"
  85 + @register="registerModal2"
  86 + />
78 <!-- 报警规则条件 --> 87 <!-- 报警规则条件 -->
79 - <AlarmRuleConditions v-if="isRuleAlarmRuleConditions == 1" @register="registerModal" /> 88 + <AlarmRuleConditions
  89 + v-if="isRuleAlarmRuleConditions == 3"
  90 + ref="getChildData3"
  91 + @getAllFieldsRule="getAllFieldsRuleFunc"
  92 + @register="registerModal3"
  93 + />
80 </template> 94 </template>
81 95
82 <script lang="ts"> 96 <script lang="ts">
83 - import { defineComponent, ref, unref } from 'vue'; 97 + import { defineComponent, ref, unref, getCurrentInstance } from 'vue';
84 import type { alarmListItem } from '../types/index'; 98 import type { alarmListItem } from '../types/index';
85 import { CollapseContainer } from '/@/components/Container/index'; 99 import { CollapseContainer } from '/@/components/Container/index';
86 import { BasicForm, useForm } from '/@/components/Form'; 100 import { BasicForm, useForm } from '/@/components/Form';
@@ -115,41 +129,60 @@ @@ -115,41 +129,60 @@
115 }, 129 },
116 emits: ['prev', 'next'], 130 emits: ['prev', 'next'],
117 setup(_, { emit }) { 131 setup(_, { emit }) {
118 - const isDetailTemplateEnableRuleAlarmRuleConditions = ref(true);  
119 - const isRuleAlarmRuleConditions = ref(1); 132 + const { proxy } = getCurrentInstance();
  133 + // const isDetailTemplateEnableRuleAlarmRuleConditions = ref(true);
  134 + const getChildData1 = ref(null);
  135 + const getChildData2 = ref(null);
  136 + const getChildData3 = ref(null);
  137 + const isRuleAlarmRuleConditions = ref(0);
120 const getAllFormData: any = ref({}); 138 const getAllFormData: any = ref({});
  139 + const alarmss: any = ref([]);
  140 + const emptyObj: any = ref({});
121 //告警列表 141 //告警列表
122 - let alarms = ref<alarmListItem[]>([]); 142 + let profileData = ref<alarmListItem[]>([]);
123 const log = (e) => { 143 const log = (e) => {
124 console.log(e); 144 console.log(e);
125 }; 145 };
126 // 添加和删除告警配置 146 // 添加和删除告警配置
127 const deleteAlarmRule = (index: number) => { 147 const deleteAlarmRule = (index: number) => {
128 - unref(alarms).splice(index, 1); 148 + unref(profileData).splice(index, 1);
129 }; 149 };
130 // 上一步 150 // 上一步
131 const prevStep = () => { 151 const prevStep = () => {
132 emit('prev'); 152 emit('prev');
133 }; 153 };
134 const addAlarmRule = () => { 154 const addAlarmRule = () => {
135 - unref(alarms).push({  
136 - id: Date.now(),  
137 - messageMode: '',  
138 - propagate: false,  
139 - propagateRelationTypes: [''],  
140 - createRule: [ 155 + unref(profileData).push({
  156 + // id: Date.now(),
  157 + // messageMode: '',
  158 + // propagate: false,
  159 + // propagateRelationTypes: [''],
  160 + configuration: {},
  161 + transportConfiguration: {},
  162 + provisionConfiguration: {
  163 + provisionDeviceSecret: '',
  164 + },
  165 + // alarms: [
  166 + // {
  167 + // id: Date.now() + Math.random(),
  168 + // alarmVisible: false,
  169 + // addKeyFilterVisible: false,
  170 + // detailVisible: false,
  171 + // detail: '',
  172 + // },
  173 + // ],
  174 + // clearRule: [],
  175 + alarms: [
141 { 176 {
142 id: Date.now() + Math.random(), 177 id: Date.now() + Math.random(),
143 - alarmVisible: false,  
144 - addKeyFilterVisible: false,  
145 - detailVisible: false,  
146 - detail: '',  
147 - filterList: [], 178 + alarmType: '',
  179 + createRules: {},
  180 + clearRule: {},
  181 + propagate: true,
  182 + propagateRelationTypes: [''],
148 }, 183 },
149 ], 184 ],
150 - clearRule: [],  
151 }); 185 });
152 - console.log(alarms.value);  
153 }; 186 };
154 187
155 // 表单部分 报警类型 188 // 表单部分 报警类型
@@ -195,7 +228,7 @@ @@ -195,7 +228,7 @@
195 228
196 // 添加‘创建条件’ 229 // 添加‘创建条件’
197 const addCreateRole = (index: number) => { 230 const addCreateRole = (index: number) => {
198 - unref(alarms)[index].createRule.push({ 231 + unref(profileData)[index].alarms.push({
199 id: Date.now() + Math.random(), 232 id: Date.now() + Math.random(),
200 alarmVisible: false, 233 alarmVisible: false,
201 addKeyFilterVisible: false, 234 addKeyFilterVisible: false,
@@ -206,7 +239,16 @@ @@ -206,7 +239,16 @@
206 }; 239 };
207 // 删除‘创建条件’ 240 // 删除‘创建条件’
208 const deleteCondition = (index: number, createIndex: number) => { 241 const deleteCondition = (index: number, createIndex: number) => {
209 - alarms.value[index].createRule.splice(createIndex, 1); 242 + profileData.value[index].alarms.splice(createIndex, 1);
  243 + };
  244 + const getAllFieldsFunc = (v) => {
  245 + console.log(v);
  246 + };
  247 + const getAllFieldsEnabFunc = (v) => {
  248 + console.log(v);
  249 + };
  250 + const getAllFieldsRuleFunc = (v) => {
  251 + console.log(v);
210 }; 252 };
211 253
212 const handleFormStep3toStep4Next = async () => { 254 const handleFormStep3toStep4Next = async () => {
@@ -216,53 +258,71 @@ @@ -216,53 +258,71 @@
216 const valueRegisterFormHighSetting = await validateRegisterFormHighSetting(); 258 const valueRegisterFormHighSetting = await validateRegisterFormHighSetting();
217 const valueRegisterFormCreateAlarm = await validateRegisterFormCreateAlarm(); 259 const valueRegisterFormCreateAlarm = await validateRegisterFormCreateAlarm();
218 const valueRegisterFormClearAlarm = await validateRegisterFormClearAlarm(); 260 const valueRegisterFormClearAlarm = await validateRegisterFormClearAlarm();
  261 + const getValueRegisterFormHighSetting = {
  262 + propagate: valueRegisterFormHighSetting?.propagate,
  263 + propagateRelationTypes: [valueRegisterFormHighSetting?.propagateRelationTypes],
  264 + };
  265 + // console.log(proxy.$refs.getChildData1);
  266 + // console.log(proxy.$refs.getChildData2);
  267 + // console.log(proxy.$refs.getChildData3);
  268 + // let getChildValues1 = proxy.$refs.getChildData1.getAllFields();
  269 + // console.log('详情模板', getChildValues1);
  270 + // let getChildValues2 = proxy.$refs.getChildData2.getAllFieldsEnab();
  271 + // console.log('启用规则', getChildValues2);
  272 + // let getChildValues3 = proxy.$refs.getChildData3.getAllFieldsRule();
  273 + // console.log('报警规则条件', getChildValues3);
  274 +
  275 + Object.assign(emptyObj.value, valueRegisterForm, getValueRegisterFormHighSetting);
  276 + alarmss.value.push(emptyObj.value);
  277 + const getAlarms = {
  278 + alarms: alarmss.value,
  279 + };
219 Object.assign( 280 Object.assign(
220 getAllFormData.value, 281 getAllFormData.value,
221 - valueRegisterForm,  
222 - valueRegisterFormHighSetting,  
223 - valueRegisterFormCreateAlarm,  
224 - valueRegisterFormClearAlarm,  
225 - alarms.value 282 + getAlarms
  283 + // valueRegisterFormCreateAlarm,
  284 + // valueRegisterFormClearAlarm
  285 + // profileData.value
226 ); 286 );
227 console.log('第三步的数据', getAllFormData.value); 287 console.log('第三步的数据', getAllFormData.value);
228 emit('next', getAllFormData.value); 288 emit('next', getAllFormData.value);
229 } catch (error) {} 289 } catch (error) {}
230 }; 290 };
231 291
232 - const [registerModal, { openModal }] = useModal(); 292 + const [registerModal1, { openModal: openModal1 }] = useModal();
  293 + const [registerModal2, { openModal: openModal2 }] = useModal();
  294 + const [registerModal3, { openModal: openModal3 }] = useModal();
233 295
234 const handleOpenDetailTemplate = () => { 296 const handleOpenDetailTemplate = () => {
235 - openModal(true, {  
236 - isUpdate: false,  
237 - });  
238 - isDetailTemplateEnableRuleAlarmRuleConditions.value = true;  
239 - console.log(isDetailTemplateEnableRuleAlarmRuleConditions.value); 297 + isRuleAlarmRuleConditions.value = 1;
  298 + openModal1(true);
240 }; 299 };
241 const handleOpenEnableRule = () => { 300 const handleOpenEnableRule = () => {
242 - openModal(true, {  
243 - isUpdate: false,  
244 - });  
245 - isDetailTemplateEnableRuleAlarmRuleConditions.value = false;  
246 - console.log(isDetailTemplateEnableRuleAlarmRuleConditions.value); 301 + isRuleAlarmRuleConditions.value = 2;
  302 + openModal2(true);
247 }; 303 };
248 const handleOpenAlaramRuleConditions = () => { 304 const handleOpenAlaramRuleConditions = () => {
249 - openModal(true, {  
250 - isUpdate: false,  
251 - });  
252 - isRuleAlarmRuleConditions.value = 1;  
253 - console.log(isRuleAlarmRuleConditions.value); 305 + isRuleAlarmRuleConditions.value = 3;
  306 + openModal3(true);
254 }; 307 };
255 308
256 return { 309 return {
  310 + getAllFieldsRuleFunc,
  311 + getAllFieldsEnabFunc,
  312 + getAllFieldsFunc,
  313 + getChildData1,
  314 + getChildData2,
  315 + getChildData3,
257 isRuleAlarmRuleConditions, 316 isRuleAlarmRuleConditions,
258 - isDetailTemplateEnableRuleAlarmRuleConditions,  
259 - registerModal, 317 + registerModal1,
  318 + registerModal2,
  319 + registerModal3,
260 handleOpenEnableRule, 320 handleOpenEnableRule,
261 handleOpenAlaramRuleConditions, 321 handleOpenAlaramRuleConditions,
262 handleOpenDetailTemplate, 322 handleOpenDetailTemplate,
263 handleFormStep3toStep4Next, 323 handleFormStep3toStep4Next,
264 log, 324 log,
265 - alarms, 325 + profileData,
266 deleteAlarmRule, 326 deleteAlarmRule,
267 prevStep, 327 prevStep,
268 addAlarmRule, 328 addAlarmRule,
  1 +{
  2 + "alarmProfile": {
  3 + "alarmContactId": "string",
  4 + "createTime": "2021-12-20T08:19:59.510Z",
  5 + "creator": "string",
  6 + "defaultConfig": "string",
  7 + "description": "string",
  8 + "deviceProfileId": "string",
  9 + "enabled": true,
  10 + "icon": "string",
  11 + "id": "string",
  12 + "messageMode": "string",
  13 + "name": "string",
  14 + "roleIds": [
  15 + "string"
  16 + ],
  17 + "tenantExpireTime": "2021-12-20T08:19:59.511Z",
  18 + "tenantId": "string",
  19 + "tenantStatus": "DISABLED",
  20 + "updateTime": "2021-12-20T08:19:59.511Z",
  21 + "updater": "string"
  22 + },
  23 + "convertJs": "string",
  24 + "createTime": "2021-12-20T08:19:59.511Z",
  25 + "creator": "string",
  26 + "defaultConfig": "string",
  27 + "defaultQueueName": "string",
  28 + "defaultRuleChainId": "string",
  29 + "description": "string",
  30 + "enabled": true,
  31 + "icon": "string",
  32 + "id": "string",
  33 + "name": "string",
  34 + "profileData": {
  35 + "configuration": {},
  36 + "transportConfiguration": {},
  37 + "provisionConfiguration": {
  38 + "provisionDeviceSecret": "string"
  39 + },
  40 + "alarms": [
  41 + {
  42 + "id": "highTemperatureAlarmID",
  43 + "alarmType": "High Temperature Alarm",
  44 + "createRules": {
  45 + "additionalProp1": {
  46 + "condition": {
  47 + "condition": [
  48 + {
  49 + "key": {
  50 + "type": "TIME_SERIES",
  51 + "key": "temp"
  52 + },
  53 + "valueType": "NUMERIC",
  54 + "value": {},
  55 + "predicate": {}
  56 + }
  57 + ],
  58 + "spec": {}
  59 + },
  60 + "schedule": {
  61 + "type": "ANY_TIME"
  62 + },
  63 + "alarmDetails": "string",
  64 + "dashboardId": {
  65 + "id": "784f394c-42b6-435a-983c-b7beff2784f9",
  66 + "entityType": "DASHBOARD"
  67 + }
  68 + },
  69 + "additionalProp2": {
  70 + "condition": {
  71 + "condition": [
  72 + {
  73 + "key": {
  74 + "type": "TIME_SERIES",
  75 + "key": "temp"
  76 + },
  77 + "valueType": "NUMERIC",
  78 + "value": {},
  79 + "predicate": {}
  80 + }
  81 + ],
  82 + "spec": {}
  83 + },
  84 + "schedule": {
  85 + "type": "ANY_TIME"
  86 + },
  87 + "alarmDetails": "string",
  88 + "dashboardId": {
  89 + "id": "784f394c-42b6-435a-983c-b7beff2784f9",
  90 + "entityType": "DASHBOARD"
  91 + }
  92 + },
  93 + "additionalProp3": {
  94 + "condition": {
  95 + "condition": [
  96 + {
  97 + "key": {
  98 + "type": "TIME_SERIES",
  99 + "key": "temp"
  100 + },
  101 + "valueType": "NUMERIC",
  102 + "value": {},
  103 + "predicate": {}
  104 + }
  105 + ],
  106 + "spec": {}
  107 + },
  108 + "schedule": {
  109 + "type": "ANY_TIME"
  110 + },
  111 + "alarmDetails": "string",
  112 + "dashboardId": {
  113 + "id": "784f394c-42b6-435a-983c-b7beff2784f9",
  114 + "entityType": "DASHBOARD"
  115 + }
  116 + }
  117 + },
  118 + "clearRule": {
  119 + "condition": {
  120 + "condition": [
  121 + {
  122 + "key": {
  123 + "type": "TIME_SERIES",
  124 + "key": "temp"
  125 + },
  126 + "valueType": "NUMERIC",
  127 + "value": {},
  128 + "predicate": {}
  129 + }
  130 + ],
  131 + "spec": {}
  132 + },
  133 + "schedule": {
  134 + "type": "ANY_TIME"
  135 + },
  136 + "alarmDetails": "string",
  137 + "dashboardId": {
  138 + "id": "784f394c-42b6-435a-983c-b7beff2784f9",
  139 + "entityType": "DASHBOARD"
  140 + }
  141 + },
  142 + "propagate": true,
  143 + "propagateRelationTypes": [
  144 + "string"
  145 + ]
  146 + }
  147 + ]
  148 + },
  149 + "roleIds": [
  150 + "string"
  151 + ],
  152 + "tbProfileId": "string",
  153 + "tenantExpireTime": "2021-12-20T08:19:59.511Z",
  154 + "tenantId": "string",
  155 + "tenantStatus": "DISABLED",
  156 + "transportType": "COAP",
  157 + "updateTime": "2021-12-20T08:19:59.511Z",
  158 + "updater": "string"
  159 +}
  1 +{
  2 + "name": "hhhhh",
  3 + "transportType": "COAP",
  4 + "profileData": {
  5 + "alarms": [
  6 + {
  7 + "alarmType": "1",
  8 + "propagate": true,
  9 + "propagateRelationTypes": [
  10 + "1"
  11 + ]
  12 + }
  13 + ]
  14 + },
  15 + "alarmProfile": {
  16 + "alarmContactId": "ce350734-9504-48c2-82d2-277e3fe5583f",
  17 + "messageMode": "DING_TALK_MESSAGE"
  18 + }
  19 +}
1 import { FormSchema } from '/@/components/Table'; 1 import { FormSchema } from '/@/components/Table';
2 2
  3 +/**
  4 + * 所使用的枚举值
  5 + */
  6 +
  7 +export enum TriggerEnum {
  8 + IS_DEVICE_ACT = 'DEVICE_ACT',
  9 + IS_TIME_ACT = 'TIME_ACT',
  10 + IS_SCENE_ACT = 'SCENE_ACT',
  11 +}
  12 +
  13 +export const isShiDu = (type: string) => {
  14 + return type === TriggerEnum.IS_DEVICE_ACT;
  15 +};
  16 +export const isWenDu = (type: string) => {
  17 + return type === TriggerEnum.IS_TIME_ACT;
  18 +};
  19 +
  20 +export const isTimeAll = (type: string) => {
  21 + return type === TriggerEnum.IS_SCENE_ACT;
  22 +};
  23 +
3 export const formSchema: FormSchema[] = [ 24 export const formSchema: FormSchema[] = [
4 { 25 {
5 field: 'detail', 26 field: 'detail',
6 - label: '报警详细信息', 27 + label: '条件类型',
  28 + colProps: { span: 24 },
  29 + component: 'Select',
  30 + componentProps: {
  31 + placeholder: '请选择报警日程表',
  32 + options: [
  33 + { label: '简单', value: 'DEVICE_ACT' },
  34 + { label: '持续时间', value: 'TIME_ACT' },
  35 + { label: '重复', value: 'SCENE_ACT' },
  36 + ],
  37 + },
  38 + },
  39 + {
  40 + field: 'type1',
  41 + label: '动态源类型',
  42 + colProps: { span: 24 },
  43 + component: 'Select',
  44 + componentProps: {
  45 + placeholder: '请选择动态源类型',
  46 + options: [
  47 + { label: '无动态值', value: 'second' },
  48 + { label: '当前租户', value: 'minute' },
  49 + { label: '当前客户', value: 'hour' },
  50 + { label: '当前设备', value: 'day' },
  51 + ],
  52 + },
  53 + ifShow: ({ values }) => isWenDu(Reflect.get(values, 'detail')),
  54 + },
  55 + {
  56 + field: 'time1',
  57 + label: '源属性',
  58 + colProps: { span: 24 },
  59 + component: 'Input',
  60 + componentProps: {
  61 + placeholder: '源属性',
  62 + },
  63 + ifShow: ({ values }) => isWenDu(Reflect.get(values, 'detail')),
  64 + },
  65 + {
  66 + field: 'type1',
  67 + label: '动态源类型',
  68 + colProps: { span: 24 },
  69 + component: 'Select',
  70 + componentProps: {
  71 + placeholder: '请选择动态源类型',
  72 + options: [
  73 + { label: '无动态值', value: 'second' },
  74 + { label: '当前租户', value: 'minute' },
  75 + { label: '当前客户', value: 'hour' },
  76 + { label: '当前设备', value: 'day' },
  77 + ],
  78 + },
  79 + ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')),
  80 + },
  81 + {
  82 + field: 'time1',
  83 + label: '源属性',
  84 + colProps: { span: 24 },
  85 + component: 'Input',
  86 + componentProps: {
  87 + placeholder: '源属性',
  88 + },
  89 + ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')),
  90 + },
  91 + {
  92 + field: 'time',
  93 + label: '持续时间值',
  94 + colProps: { span: 24 },
  95 + component: 'Input',
  96 + componentProps: {
  97 + placeholder: '请输入持续时间值',
  98 + },
  99 + ifShow: ({ values }) => isWenDu(Reflect.get(values, 'detail')),
  100 + },
  101 + {
  102 + field: 'r',
  103 + label: '时间单位',
  104 + colProps: { span: 24 },
  105 + component: 'Select',
  106 + componentProps: {
  107 + placeholder: '请选择报警日程表',
  108 + options: [
  109 + { label: '秒', value: 'second' },
  110 + { label: '分钟', value: 'minute' },
  111 + { label: '小时', value: 'hour' },
  112 + { label: '天', value: 'day' },
  113 + ],
  114 + },
  115 + ifShow: ({ values }) => isWenDu(Reflect.get(values, 'detail')),
  116 + },
  117 + {
  118 + field: 'time',
  119 + label: '事件计数值必填',
7 colProps: { span: 24 }, 120 colProps: { span: 24 },
8 - required: true,  
9 component: 'Input', 121 component: 'Input',
10 componentProps: { 122 componentProps: {
11 - placeholder: '请输入报警详细信息', 123 + placeholder: '请输入事件计数值必填',
12 }, 124 },
  125 + rules: [{ message: '事件计数应在1到2147483637之间', trigger: 'blur' }],
  126 + ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')),
13 }, 127 },
14 ]; 128 ];
@@ -21,21 +21,35 @@ @@ -21,21 +21,35 @@
21 BasicModal, 21 BasicModal,
22 BasicForm, 22 BasicForm,
23 }, 23 },
24 - emits: ['success', 'register'],  
25 - setup() { 24 + emits: ['success', 'register', 'getAllFieldsRule'],
  25 + setup(_, { emit }) {
  26 + // const getValueData: any = ref({});
  27 +
26 const isUpdate = ref(true); 28 const isUpdate = ref(true);
27 - const [registerForm] = useForm({ 29 + const [registerForm, { getFieldsValue }] = useForm({
28 labelWidth: 120, 30 labelWidth: 120,
29 schemas: formSchema, 31 schemas: formSchema,
30 }); 32 });
31 - const getTitle = computed(() => (!unref(isUpdate) ? '新增报警规则条件' : '编辑报警规则条件'));  
32 - const [register] = useModalInner((data) => { 33 + const getTitle = computed(() => (!unref(isUpdate) ? '添加报警规则条件' : '编辑报警规则条件'));
  34 + const [register, { closeModal }] = useModalInner((data) => {
33 isUpdate.value = !!data?.isUpdate; 35 isUpdate.value = !!data?.isUpdate;
34 }); 36 });
35 const handleSubmit = () => { 37 const handleSubmit = () => {
36 - console.log(1); 38 + const values = getFieldsValue();
  39 + emit('getAllFieldsRule', values);
  40 + // console.log(1);
  41 + // let getV = {};
  42 + // getAllFieldsRule(getV);
  43 + closeModal();
37 }; 44 };
  45 + // function getAllFieldsRule(getV) {
  46 + // const values = getFieldsValue();
  47 + // getValueData.value = values;
  48 + // getV = getValueData.value;
  49 + // return getV;
  50 + // }
38 return { 51 return {
  52 + // getAllFieldsRule,
39 registerForm, 53 registerForm,
40 handleSubmit, 54 handleSubmit,
41 register, 55 register,
1 import { FormSchema } from '/@/components/Table'; 1 import { FormSchema } from '/@/components/Table';
2 2
3 -/**  
4 - * 所使用的枚举值  
5 - */  
6 -  
7 -export enum TriggerEnum {  
8 - IS_DEVICE_ACT = 'DEVICE_ACT',  
9 - IS_TIME_ACT = 'TIME_ACT',  
10 - IS_SCENE_ACT = 'SCENE_ACT',  
11 -}  
12 -  
13 -export const isShiDu = (type: string) => {  
14 - return type === TriggerEnum.IS_DEVICE_ACT;  
15 -};  
16 -export const isWenDu = (type: string) => {  
17 - return type === TriggerEnum.IS_TIME_ACT;  
18 -};  
19 -  
20 -export const isTimeAll = (type: string) => {  
21 - return type === TriggerEnum.IS_SCENE_ACT;  
22 -};  
23 -  
24 export const formSchema: FormSchema[] = [ 3 export const formSchema: FormSchema[] = [
25 { 4 {
26 field: 'detail', 5 field: 'detail',
27 - label: '条件类型',  
28 - colProps: { span: 24 },  
29 - component: 'Select',  
30 - componentProps: {  
31 - placeholder: '请选择报警日程表',  
32 - options: [  
33 - { label: '简单', value: 'DEVICE_ACT' },  
34 - { label: '持续时间', value: 'TIME_ACT' },  
35 - { label: '重复', value: 'SCENE_ACT' },  
36 - ],  
37 - },  
38 - },  
39 - {  
40 - field: 'type1',  
41 - label: '动态源类型',  
42 - colProps: { span: 24 },  
43 - component: 'Select',  
44 - componentProps: {  
45 - placeholder: '请选择动态源类型',  
46 - options: [  
47 - { label: '无动态值', value: 'second' },  
48 - { label: '当前租户', value: 'minute' },  
49 - { label: '当前客户', value: 'hour' },  
50 - { label: '当前设备', value: 'day' },  
51 - ],  
52 - },  
53 - ifShow: ({ values }) => isWenDu(Reflect.get(values, 'detail')),  
54 - },  
55 - {  
56 - field: 'time1',  
57 - label: '源属性',  
58 - colProps: { span: 24 },  
59 - component: 'Input',  
60 - componentProps: {  
61 - placeholder: '源属性',  
62 - },  
63 - ifShow: ({ values }) => isWenDu(Reflect.get(values, 'detail')),  
64 - },  
65 - {  
66 - field: 'type1',  
67 - label: '动态源类型',  
68 - colProps: { span: 24 },  
69 - component: 'Select',  
70 - componentProps: {  
71 - placeholder: '请选择动态源类型',  
72 - options: [  
73 - { label: '无动态值', value: 'second' },  
74 - { label: '当前租户', value: 'minute' },  
75 - { label: '当前客户', value: 'hour' },  
76 - { label: '当前设备', value: 'day' },  
77 - ],  
78 - },  
79 - ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')),  
80 - },  
81 - {  
82 - field: 'time1',  
83 - label: '源属性',  
84 - colProps: { span: 24 },  
85 - component: 'Input',  
86 - componentProps: {  
87 - placeholder: '源属性',  
88 - },  
89 - ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')),  
90 - },  
91 - {  
92 - field: 'time',  
93 - label: '持续时间值',  
94 - colProps: { span: 24 },  
95 - component: 'Input',  
96 - componentProps: {  
97 - placeholder: '请输入持续时间值',  
98 - },  
99 - ifShow: ({ values }) => isWenDu(Reflect.get(values, 'detail')),  
100 - },  
101 - {  
102 - field: 'r',  
103 - label: '时间单位',  
104 - colProps: { span: 24 },  
105 - component: 'Select',  
106 - componentProps: {  
107 - placeholder: '请选择报警日程表',  
108 - options: [  
109 - { label: '秒', value: 'second' },  
110 - { label: '分钟', value: 'minute' },  
111 - { label: '小时', value: 'hour' },  
112 - { label: '天', value: 'day' },  
113 - ],  
114 - },  
115 - ifShow: ({ values }) => isWenDu(Reflect.get(values, 'detail')),  
116 - },  
117 - {  
118 - field: 'time',  
119 - label: '事件计数值必填', 6 + label: '报警详细信息',
120 colProps: { span: 24 }, 7 colProps: { span: 24 },
  8 + required: true,
121 component: 'Input', 9 component: 'Input',
122 componentProps: { 10 componentProps: {
123 - placeholder: '请输入事件计数值必填', 11 + placeholder: '请输入报警详细信息',
124 }, 12 },
125 - rules: [{ message: '事件计数应在1到2147483637之间', trigger: 'blur' }],  
126 - ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')),  
127 }, 13 },
128 ]; 14 ];
@@ -21,21 +21,33 @@ @@ -21,21 +21,33 @@
21 BasicModal, 21 BasicModal,
22 BasicForm, 22 BasicForm,
23 }, 23 },
24 - emits: ['success', 'register'],  
25 - setup() { 24 + emits: ['success', 'register', 'getAllFields'],
  25 + setup(_, { emit }) {
  26 + // const getValueData: any = ref({});
26 const isUpdate = ref(true); 27 const isUpdate = ref(true);
27 - const [registerForm] = useForm({ 28 + const [registerForm, { getFieldsValue }] = useForm({
28 labelWidth: 120, 29 labelWidth: 120,
29 schemas: formSchema, 30 schemas: formSchema,
30 }); 31 });
31 const getTitle = computed(() => (!unref(isUpdate) ? '新增详情模板' : '编辑详情模板')); 32 const getTitle = computed(() => (!unref(isUpdate) ? '新增详情模板' : '编辑详情模板'));
32 - const [register] = useModalInner((data) => { 33 + const [register, { closeModal }] = useModalInner((data) => {
33 isUpdate.value = !!data?.isUpdate; 34 isUpdate.value = !!data?.isUpdate;
34 }); 35 });
35 const handleSubmit = () => { 36 const handleSubmit = () => {
36 - console.log(1); 37 + const values = getFieldsValue();
  38 + emit('getAllFields', values);
  39 + // let getV = {};
  40 + // getAllFields(getV);
  41 + closeModal();
37 }; 42 };
  43 + // function getAllFields(getV) {
  44 + // const values = getFieldsValue();
  45 + // getValueData.value = values;
  46 + // getV = getValueData.value;
  47 + // return getV;
  48 + // }
38 return { 49 return {
  50 + // getAllFields,
39 registerForm, 51 registerForm,
40 handleSubmit, 52 handleSubmit,
41 register, 53 register,
@@ -61,7 +61,7 @@ export const formSchema: FormSchema[] = [ @@ -61,7 +61,7 @@ export const formSchema: FormSchema[] = [
61 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')), 61 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')),
62 }, 62 },
63 { 63 {
64 - field: 'time', 64 + field: 'time1',
65 component: 'TimePicker', 65 component: 'TimePicker',
66 label: '时间选择', 66 label: '时间选择',
67 colProps: { 67 colProps: {
@@ -70,7 +70,7 @@ export const formSchema: FormSchema[] = [ @@ -70,7 +70,7 @@ export const formSchema: FormSchema[] = [
70 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')), 70 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')),
71 }, 71 },
72 { 72 {
73 - field: 'time', 73 + field: 'time2',
74 component: 'TimePicker', 74 component: 'TimePicker',
75 label: '时间选择', 75 label: '时间选择',
76 colProps: { 76 colProps: {
@@ -90,7 +90,7 @@ export const formSchema: FormSchema[] = [ @@ -90,7 +90,7 @@ export const formSchema: FormSchema[] = [
90 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')), 90 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')),
91 }, 91 },
92 { 92 {
93 - field: 'time', 93 + field: 'time3',
94 component: 'TimePicker', 94 component: 'TimePicker',
95 label: '时间选择', 95 label: '时间选择',
96 colProps: { 96 colProps: {
@@ -99,7 +99,7 @@ export const formSchema: FormSchema[] = [ @@ -99,7 +99,7 @@ export const formSchema: FormSchema[] = [
99 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')), 99 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')),
100 }, 100 },
101 { 101 {
102 - field: 'time', 102 + field: 'time4',
103 component: 'TimePicker', 103 component: 'TimePicker',
104 label: '时间选择', 104 label: '时间选择',
105 colProps: { 105 colProps: {
@@ -118,7 +118,7 @@ export const formSchema: FormSchema[] = [ @@ -118,7 +118,7 @@ export const formSchema: FormSchema[] = [
118 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')), 118 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')),
119 }, 119 },
120 { 120 {
121 - field: 'time', 121 + field: 'time5',
122 component: 'TimePicker', 122 component: 'TimePicker',
123 label: '时间选择', 123 label: '时间选择',
124 colProps: { 124 colProps: {
@@ -127,7 +127,7 @@ export const formSchema: FormSchema[] = [ @@ -127,7 +127,7 @@ export const formSchema: FormSchema[] = [
127 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')), 127 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')),
128 }, 128 },
129 { 129 {
130 - field: 'time', 130 + field: 'time6',
131 component: 'TimePicker', 131 component: 'TimePicker',
132 label: '时间选择', 132 label: '时间选择',
133 colProps: { 133 colProps: {
@@ -146,7 +146,7 @@ export const formSchema: FormSchema[] = [ @@ -146,7 +146,7 @@ export const formSchema: FormSchema[] = [
146 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')), 146 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')),
147 }, 147 },
148 { 148 {
149 - field: 'time', 149 + field: 'time7',
150 component: 'TimePicker', 150 component: 'TimePicker',
151 label: '时间选择', 151 label: '时间选择',
152 colProps: { 152 colProps: {
@@ -155,7 +155,7 @@ export const formSchema: FormSchema[] = [ @@ -155,7 +155,7 @@ export const formSchema: FormSchema[] = [
155 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')), 155 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')),
156 }, 156 },
157 { 157 {
158 - field: 'time', 158 + field: 'time8',
159 component: 'TimePicker', 159 component: 'TimePicker',
160 label: '时间选择', 160 label: '时间选择',
161 colProps: { 161 colProps: {
@@ -174,7 +174,7 @@ export const formSchema: FormSchema[] = [ @@ -174,7 +174,7 @@ export const formSchema: FormSchema[] = [
174 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')), 174 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')),
175 }, 175 },
176 { 176 {
177 - field: 'time', 177 + field: 'time9',
178 component: 'TimePicker', 178 component: 'TimePicker',
179 label: '时间选择', 179 label: '时间选择',
180 colProps: { 180 colProps: {
@@ -183,7 +183,7 @@ export const formSchema: FormSchema[] = [ @@ -183,7 +183,7 @@ export const formSchema: FormSchema[] = [
183 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')), 183 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')),
184 }, 184 },
185 { 185 {
186 - field: 'time', 186 + field: 'time33',
187 component: 'TimePicker', 187 component: 'TimePicker',
188 label: '时间选择', 188 label: '时间选择',
189 colProps: { 189 colProps: {
@@ -202,7 +202,7 @@ export const formSchema: FormSchema[] = [ @@ -202,7 +202,7 @@ export const formSchema: FormSchema[] = [
202 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')), 202 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')),
203 }, 203 },
204 { 204 {
205 - field: 'time', 205 + field: 'time333',
206 component: 'TimePicker', 206 component: 'TimePicker',
207 label: '时间选择', 207 label: '时间选择',
208 colProps: { 208 colProps: {
@@ -211,7 +211,7 @@ export const formSchema: FormSchema[] = [ @@ -211,7 +211,7 @@ export const formSchema: FormSchema[] = [
211 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')), 211 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')),
212 }, 212 },
213 { 213 {
214 - field: 'time', 214 + field: 'time131',
215 component: 'TimePicker', 215 component: 'TimePicker',
216 label: '时间选择', 216 label: '时间选择',
217 colProps: { 217 colProps: {
@@ -230,7 +230,7 @@ export const formSchema: FormSchema[] = [ @@ -230,7 +230,7 @@ export const formSchema: FormSchema[] = [
230 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')), 230 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')),
231 }, 231 },
232 { 232 {
233 - field: 'time', 233 + field: 'time3423',
234 component: 'TimePicker', 234 component: 'TimePicker',
235 label: '时间选择', 235 label: '时间选择',
236 colProps: { 236 colProps: {
@@ -239,7 +239,7 @@ export const formSchema: FormSchema[] = [ @@ -239,7 +239,7 @@ export const formSchema: FormSchema[] = [
239 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')), 239 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'detail')),
240 }, 240 },
241 { 241 {
242 - field: 'time', 242 + field: 'time3431',
243 component: 'TimePicker', 243 component: 'TimePicker',
244 label: '时间选择', 244 label: '时间选择',
245 colProps: { 245 colProps: {
@@ -296,7 +296,7 @@ export const formSchema: FormSchema[] = [ @@ -296,7 +296,7 @@ export const formSchema: FormSchema[] = [
296 ifShow: ({ values }) => isWenDu(Reflect.get(values, 'detail')), 296 ifShow: ({ values }) => isWenDu(Reflect.get(values, 'detail')),
297 }, 297 },
298 { 298 {
299 - field: 'time', 299 + field: 'timerrw',
300 component: 'TimePicker', 300 component: 'TimePicker',
301 label: '时间选择', 301 label: '时间选择',
302 colProps: { 302 colProps: {
@@ -305,7 +305,7 @@ export const formSchema: FormSchema[] = [ @@ -305,7 +305,7 @@ export const formSchema: FormSchema[] = [
305 ifShow: ({ values }) => isWenDu(Reflect.get(values, 'detail')), 305 ifShow: ({ values }) => isWenDu(Reflect.get(values, 'detail')),
306 }, 306 },
307 { 307 {
308 - field: 'time', 308 + field: 'timewwq',
309 component: 'TimePicker', 309 component: 'TimePicker',
310 label: '时间选择', 310 label: '时间选择',
311 colProps: { 311 colProps: {
@@ -21,21 +21,33 @@ @@ -21,21 +21,33 @@
21 BasicModal, 21 BasicModal,
22 BasicForm, 22 BasicForm,
23 }, 23 },
24 - emits: ['success', 'register'],  
25 - setup() { 24 + emits: ['success', 'register', 'getAllFieldsEnab'],
  25 + setup(_, { emit }) {
  26 + // const getValueData: any = ref({});
26 const isUpdate = ref(true); 27 const isUpdate = ref(true);
27 - const [registerForm] = useForm({ 28 + const [registerForm, { getFieldsValue }] = useForm({
28 labelWidth: 120, 29 labelWidth: 120,
29 schemas: formSchema, 30 schemas: formSchema,
30 }); 31 });
31 const getTitle = computed(() => (!unref(isUpdate) ? '新增报警日程表' : '编辑报警日程表')); 32 const getTitle = computed(() => (!unref(isUpdate) ? '新增报警日程表' : '编辑报警日程表'));
32 - const [register] = useModalInner((data) => { 33 + const [register, { closeModal }] = useModalInner((data) => {
33 isUpdate.value = !!data?.isUpdate; 34 isUpdate.value = !!data?.isUpdate;
34 }); 35 });
35 const handleSubmit = () => { 36 const handleSubmit = () => {
36 - console.log(1); 37 + const values = getFieldsValue();
  38 + emit('getAllFieldsEnab', values);
  39 + // let getV = {};
  40 + // getAllFieldsEnab(getV);
  41 + closeModal();
37 }; 42 };
  43 + // function getAllFieldsEnab(getV) {
  44 + // const values = getFieldsValue();
  45 + // getValueData.value = values;
  46 + // getV = getValueData.value;
  47 + // return getV;
  48 + // }
38 return { 49 return {
  50 + // getAllFieldsEnab,
39 registerForm, 51 registerForm,
40 handleSubmit, 52 handleSubmit,
41 register, 53 register,
@@ -13,12 +13,30 @@ interface createRule { @@ -13,12 +13,30 @@ interface createRule {
13 interface clearRule { 13 interface clearRule {
14 detail: string; 14 detail: string;
15 } 15 }
  16 +
  17 +interface provisionConfigurationD {
  18 + provisionDeviceSecret: string;
  19 +}
  20 +
  21 +interface IAddAlarms {
  22 + id: number;
  23 + alarmType: string;
  24 + createRules: object;
  25 + clearRule: object;
  26 + propagate: true;
  27 + propagateRelationTypes: string[];
  28 +}
  29 +
16 export interface alarmListItem { 30 export interface alarmListItem {
17 - id?: number;  
18 - alarmType?: string;  
19 - messageMode?: string;  
20 - propagate?: boolean;  
21 - propagateRelationTypes?: string[];  
22 - createRule?: createRule[];  
23 - clearRule?: clearRule[]; 31 + configuration?: object;
  32 + transportConfiguration?: object;
  33 + provisionConfiguration?: provisionConfigurationD;
  34 + // id?: number;
  35 + alarms?: IAddAlarms[];
  36 + // alarmType?: string;
  37 + // messageMode?: string;
  38 + // createRule?: createRule[];
  39 + // clearRule?: clearRule[];
  40 + // propagate?: boolean;
  41 + // propagateRelationTypes?: string[];
24 } 42 }
@@ -117,30 +117,7 @@ export const formSchema: FormSchema[] = [ @@ -117,30 +117,7 @@ export const formSchema: FormSchema[] = [
117 }); 117 });
118 }, 118 },
119 }, 119 },
120 - {  
121 - field: 'organizationId',  
122 - label: '所属组织',  
123 - colProps: { span: 12 },  
124 - component: 'ApiTreeSelect',  
125 - componentProps: {  
126 - api: async () => {  
127 - const data = await getOrganizationList();  
128 - copyTransFun(data as any as any[]);  
129 - // const filterData = data.map((m) => {  
130 - // return {  
131 - // label: m.label,  
132 - // value: m.value,  
133 - // };  
134 - // });  
135 - // return filterData;  
136 - return data;  
137 - },  
138 - onChange: (v) => {  
139 - isDeptId.value = v;  
140 - },  
141 - },  
142 - ifShow: ({ values }) => isOrg(Reflect.get(values, 'receiverType')),  
143 - }, 120 +
144 { 121 {
145 field: 'receiverType', 122 field: 'receiverType',
146 required: true, 123 required: true,
@@ -194,6 +171,30 @@ export const formSchema: FormSchema[] = [ @@ -194,6 +171,30 @@ export const formSchema: FormSchema[] = [
194 // }, 171 // },
195 }, 172 },
196 { 173 {
  174 + field: 'organizationId',
  175 + label: '所属组织',
  176 + colProps: { span: 12 },
  177 + component: 'ApiTreeSelect',
  178 + componentProps: {
  179 + api: async () => {
  180 + const data = await getOrganizationList();
  181 + copyTransFun(data as any as any[]);
  182 + // const filterData = data.map((m) => {
  183 + // return {
  184 + // label: m.label,
  185 + // value: m.value,
  186 + // };
  187 + // });
  188 + // return filterData;
  189 + return data;
  190 + },
  191 + onChange: (v) => {
  192 + isDeptId.value = v;
  193 + },
  194 + },
  195 + ifShow: ({ values }) => isOrg(Reflect.get(values, 'receiverType')),
  196 + },
  197 + {
197 field: '', 198 field: '',
198 component: 'Input', 199 component: 'Input',
199 label: '', 200 label: '',
@@ -32,7 +32,7 @@ export const formSchema: FormSchema[] = [ @@ -32,7 +32,7 @@ export const formSchema: FormSchema[] = [
32 required: true, 32 required: true,
33 validator: (_, value) => { 33 validator: (_, value) => {
34 if (!value) { 34 if (!value) {
35 - return Promise.reject('不能为空'); 35 + return Promise.reject('密码不能为空');
36 } 36 }
37 if (value !== values.passwordNew) { 37 if (value !== values.passwordNew) {
38 return Promise.reject('两次输入的密码不一致!'); 38 return Promise.reject('两次输入的密码不一致!');
@@ -36,13 +36,15 @@ export const formSchema: FormSchema[] = [ @@ -36,13 +36,15 @@ export const formSchema: FormSchema[] = [
36 }, 36 },
37 { 37 {
38 field: 'isolatedTbRuleEngine', 38 field: 'isolatedTbRuleEngine',
39 - label: '隔离板芯容器的加工', 39 + label: '',
40 component: 'Checkbox', 40 component: 'Checkbox',
  41 + renderComponentContent: '隔离板芯容器的加工',
41 }, 42 },
42 { 43 {
43 field: 'isolatedTbCore', 44 field: 'isolatedTbCore',
44 - label: '在独立的ThinngsBoard规则引擎中处理', 45 + label: '',
45 component: 'Checkbox', 46 component: 'Checkbox',
  47 + renderComponentContent: '在独立的ThinngsBoard规则引擎中处理',
46 }, 48 },
47 { 49 {
48 field: 'description', 50 field: 'description',
1 import { FormSchema } from '/@/components/Table'; 1 import { FormSchema } from '/@/components/Table';
  2 +import { numberRule } from '/@/utils/rules';
2 3
3 export const formSchema: FormSchema[] = [ 4 export const formSchema: FormSchema[] = [
4 { 5 {
5 field: 'maxDevices', 6 field: 'maxDevices',
6 label: '最大设备数(0-无限制)', 7 label: '最大设备数(0-无限制)',
7 - component: 'InputNumber', 8 + component: 'Input',
  9 + colProps: { span: 24 },
8 componentProps: { 10 componentProps: {
9 placeholder: '请输入最大设备数', 11 placeholder: '请输入最大设备数',
10 }, 12 },
  13 + rules: numberRule,
11 }, 14 },
12 { 15 {
13 field: 'maxAssets', 16 field: 'maxAssets',
14 label: '最大资产数(0-无限制)', 17 label: '最大资产数(0-无限制)',
15 colProps: { span: 24 }, 18 colProps: { span: 24 },
16 - component: 'InputNumber', 19 + component: 'Input',
  20 + rules: numberRule,
  21 +
17 componentProps: { 22 componentProps: {
18 placeholder: '请输入最大资产', 23 placeholder: '请输入最大资产',
19 }, 24 },
@@ -22,7 +27,9 @@ export const formSchema: FormSchema[] = [ @@ -22,7 +27,9 @@ export const formSchema: FormSchema[] = [
22 field: 'maxCustomers', 27 field: 'maxCustomers',
23 label: '最大客户数(0-无限制)', 28 label: '最大客户数(0-无限制)',
24 colProps: { span: 24 }, 29 colProps: { span: 24 },
25 - component: 'InputNumber', 30 + component: 'Input',
  31 + rules: numberRule,
  32 +
26 componentProps: { 33 componentProps: {
27 placeholder: '请输入最大客户数', 34 placeholder: '请输入最大客户数',
28 }, 35 },
@@ -31,7 +38,9 @@ export const formSchema: FormSchema[] = [ @@ -31,7 +38,9 @@ export const formSchema: FormSchema[] = [
31 field: 'maxUsers', 38 field: 'maxUsers',
32 label: '最大用户数(0-无限制)', 39 label: '最大用户数(0-无限制)',
33 colProps: { span: 24 }, 40 colProps: { span: 24 },
34 - component: 'InputNumber', 41 + component: 'Input',
  42 + rules: numberRule,
  43 +
35 componentProps: { 44 componentProps: {
36 placeholder: '请输入最大用户数', 45 placeholder: '请输入最大用户数',
37 }, 46 },
@@ -40,7 +49,9 @@ export const formSchema: FormSchema[] = [ @@ -40,7 +49,9 @@ export const formSchema: FormSchema[] = [
40 field: 'maxDashboards', 49 field: 'maxDashboards',
41 label: '仪表板的最大数量(0-无限制)', 50 label: '仪表板的最大数量(0-无限制)',
42 colProps: { span: 24 }, 51 colProps: { span: 24 },
43 - component: 'InputNumber', 52 + component: 'Input',
  53 + rules: numberRule,
  54 +
44 componentProps: { 55 componentProps: {
45 placeholder: '请输入仪表板的最大数量', 56 placeholder: '请输入仪表板的最大数量',
46 }, 57 },
@@ -49,25 +60,31 @@ export const formSchema: FormSchema[] = [ @@ -49,25 +60,31 @@ export const formSchema: FormSchema[] = [
49 field: 'maxRuleChains', 60 field: 'maxRuleChains',
50 label: '最大规则链数(0-无限制)', 61 label: '最大规则链数(0-无限制)',
51 colProps: { span: 24 }, 62 colProps: { span: 24 },
52 - component: 'InputNumber', 63 + component: 'Input',
  64 + rules: numberRule,
  65 +
53 componentProps: { 66 componentProps: {
54 placeholder: '请输入最大规则链数', 67 placeholder: '请输入最大规则链数',
55 }, 68 },
56 }, 69 },
57 { 70 {
58 field: 'maxResourcesInBytes', 71 field: 'maxResourcesInBytes',
59 - label: 'Maximun sum of resource files in bytes(0-unlimited)', 72 + label: '以字节为单位的资源文件的最大总和(0-无限制)',
60 colProps: { span: 24 }, 73 colProps: { span: 24 },
61 - component: 'InputNumber', 74 + component: 'Input',
  75 + rules: numberRule,
  76 +
62 componentProps: { 77 componentProps: {
63 placeholder: '请输入', 78 placeholder: '请输入',
64 }, 79 },
65 }, 80 },
66 { 81 {
67 field: 'maxOtaPackagesInBytes', 82 field: 'maxOtaPackagesInBytes',
68 - label: 'Maximun sum of ota packages files size in bytes(0-unlimited)', 83 + label: 'Ota包文件大小的最大总和(字节)(0-无限制)',
69 colProps: { span: 24 }, 84 colProps: { span: 24 },
70 - component: 'InputNumber', 85 + component: 'Input',
  86 + rules: numberRule,
  87 +
71 componentProps: { 88 componentProps: {
72 placeholder: '请输入', 89 placeholder: '请输入',
73 }, 90 },
@@ -76,7 +93,9 @@ export const formSchema: FormSchema[] = [ @@ -76,7 +93,9 @@ export const formSchema: FormSchema[] = [
76 field: 'maxTransportMessages', 93 field: 'maxTransportMessages',
77 label: '最大传输消息数(0-无限制)', 94 label: '最大传输消息数(0-无限制)',
78 colProps: { span: 24 }, 95 colProps: { span: 24 },
79 - component: 'InputNumber', 96 + component: 'Input',
  97 + rules: numberRule,
  98 +
80 componentProps: { 99 componentProps: {
81 placeholder: '请输入最大传输消息数', 100 placeholder: '请输入最大传输消息数',
82 }, 101 },
@@ -85,7 +104,9 @@ export const formSchema: FormSchema[] = [ @@ -85,7 +104,9 @@ export const formSchema: FormSchema[] = [
85 field: 'maxTransportDataPoints', 104 field: 'maxTransportDataPoints',
86 label: '传输数据点的最大数量(0-无限制)', 105 label: '传输数据点的最大数量(0-无限制)',
87 colProps: { span: 24 }, 106 colProps: { span: 24 },
88 - component: 'InputNumber', 107 + component: 'Input',
  108 + rules: numberRule,
  109 +
89 componentProps: { 110 componentProps: {
90 placeholder: '请输入传输数据点的最大数量', 111 placeholder: '请输入传输数据点的最大数量',
91 }, 112 },
@@ -94,7 +115,9 @@ export const formSchema: FormSchema[] = [ @@ -94,7 +115,9 @@ export const formSchema: FormSchema[] = [
94 field: 'maxREExecutions', 115 field: 'maxREExecutions',
95 label: '最大规则引擎数(0-无限制)', 116 label: '最大规则引擎数(0-无限制)',
96 colProps: { span: 24 }, 117 colProps: { span: 24 },
97 - component: 'InputNumber', 118 + component: 'Input',
  119 + rules: numberRule,
  120 +
98 componentProps: { 121 componentProps: {
99 placeholder: '请输入最大规则引擎数', 122 placeholder: '请输入最大规则引擎数',
100 }, 123 },
@@ -104,7 +127,9 @@ export const formSchema: FormSchema[] = [ @@ -104,7 +127,9 @@ export const formSchema: FormSchema[] = [
104 field: 'maxJSExecutions', 127 field: 'maxJSExecutions',
105 label: '最大JavaScript执行数(0-不受限制)', 128 label: '最大JavaScript执行数(0-不受限制)',
106 colProps: { span: 24 }, 129 colProps: { span: 24 },
107 - component: 'InputNumber', 130 + component: 'Input',
  131 + rules: numberRule,
  132 +
108 componentProps: { 133 componentProps: {
109 placeholder: '请输入最大JavaScript执行数', 134 placeholder: '请输入最大JavaScript执行数',
110 }, 135 },
@@ -113,7 +138,9 @@ export const formSchema: FormSchema[] = [ @@ -113,7 +138,9 @@ export const formSchema: FormSchema[] = [
113 field: 'maxDPStorageDays', 138 field: 'maxDPStorageDays',
114 label: '最大日存储数据点数(0-无限制)', 139 label: '最大日存储数据点数(0-无限制)',
115 colProps: { span: 24 }, 140 colProps: { span: 24 },
116 - component: 'InputNumber', 141 + component: 'Input',
  142 + rules: numberRule,
  143 +
117 componentProps: { 144 componentProps: {
118 placeholder: '请输入最大日存储数据点数', 145 placeholder: '请输入最大日存储数据点数',
119 }, 146 },
@@ -122,25 +149,31 @@ export const formSchema: FormSchema[] = [ @@ -122,25 +149,31 @@ export const formSchema: FormSchema[] = [
122 field: 'defaultStorageTtlDays', 149 field: 'defaultStorageTtlDays',
123 label: '默认存储 TTL 天数(0-无限制)', 150 label: '默认存储 TTL 天数(0-无限制)',
124 colProps: { span: 24 }, 151 colProps: { span: 24 },
125 - component: 'InputNumber', 152 + component: 'Input',
  153 + rules: numberRule,
  154 +
126 componentProps: { 155 componentProps: {
127 placeholder: '请输入默认存储 TTL 天数', 156 placeholder: '请输入默认存储 TTL 天数',
128 }, 157 },
129 }, 158 },
130 { 159 {
131 field: 'alarmsTtlDays', 160 field: 'alarmsTtlDays',
132 - label: 'Alams TTL days(0-unlimaited)', 161 + label: 'Alams TTL days(0-无限制)',
133 colProps: { span: 24 }, 162 colProps: { span: 24 },
134 - component: 'InputNumber', 163 + component: 'Input',
  164 + rules: numberRule,
  165 +
135 componentProps: { 166 componentProps: {
136 placeholder: '请输入Alams TTL days', 167 placeholder: '请输入Alams TTL days',
137 }, 168 },
138 }, 169 },
139 { 170 {
140 field: 'rpcTtlDays', 171 field: 'rpcTtlDays',
141 - label: 'RPC TTL days(0-unlimaited)', 172 + label: 'RPC TTL days(0-无限制)',
142 colProps: { span: 24 }, 173 colProps: { span: 24 },
143 - component: 'InputNumber', 174 + component: 'Input',
  175 + rules: numberRule,
  176 +
144 componentProps: { 177 componentProps: {
145 placeholder: '请输入RPC TTL days', 178 placeholder: '请输入RPC TTL days',
146 }, 179 },
@@ -149,7 +182,9 @@ export const formSchema: FormSchema[] = [ @@ -149,7 +182,9 @@ export const formSchema: FormSchema[] = [
149 field: 'maxRuleNodeExecutionsPerMessage', 182 field: 'maxRuleNodeExecutionsPerMessage',
150 label: '每条消息的最大规则节点执行数(0-无限制)', 183 label: '每条消息的最大规则节点执行数(0-无限制)',
151 colProps: { span: 24 }, 184 colProps: { span: 24 },
152 - component: 'InputNumber', 185 + component: 'Input',
  186 + rules: numberRule,
  187 +
153 componentProps: { 188 componentProps: {
154 placeholder: '请输入每条消息的最大规则节点执行数', 189 placeholder: '请输入每条消息的最大规则节点执行数',
155 }, 190 },
@@ -158,7 +193,9 @@ export const formSchema: FormSchema[] = [ @@ -158,7 +193,9 @@ export const formSchema: FormSchema[] = [
158 field: 'maxEmails', 193 field: 'maxEmails',
159 label: '发送的最大电子邮件数(0-无限制)', 194 label: '发送的最大电子邮件数(0-无限制)',
160 colProps: { span: 24 }, 195 colProps: { span: 24 },
161 - component: 'InputNumber', 196 + component: 'Input',
  197 + rules: numberRule,
  198 +
162 componentProps: { 199 componentProps: {
163 placeholder: '请输入发送的最大电子邮件数', 200 placeholder: '请输入发送的最大电子邮件数',
164 }, 201 },
@@ -167,16 +204,19 @@ export const formSchema: FormSchema[] = [ @@ -167,16 +204,19 @@ export const formSchema: FormSchema[] = [
167 field: 'maxSms', 204 field: 'maxSms',
168 label: '发送的最大短信数(0-无限制)', 205 label: '发送的最大短信数(0-无限制)',
169 colProps: { span: 24 }, 206 colProps: { span: 24 },
170 - component: 'InputNumber', 207 + component: 'Input',
  208 + rules: numberRule,
  209 +
171 componentProps: { 210 componentProps: {
172 placeholder: '请输入发送的最大短信数', 211 placeholder: '请输入发送的最大短信数',
173 }, 212 },
174 }, 213 },
175 { 214 {
176 field: 'maxCreatedAlarms', 215 field: 'maxCreatedAlarms',
177 - label: 'Maximum number of alarms created (0 - unlimited)', 216 + label: '创建的最大报警数 (0 - 无限制)',
178 colProps: { span: 24 }, 217 colProps: { span: 24 },
179 - component: 'InputNumber', 218 + component: 'Input',
  219 + rules: numberRule,
180 componentProps: { 220 componentProps: {
181 placeholder: '请输入maxCreatedAlarms', 221 placeholder: '请输入maxCreatedAlarms',
182 }, 222 },
@@ -186,6 +226,7 @@ export const formSchema: FormSchema[] = [ @@ -186,6 +226,7 @@ export const formSchema: FormSchema[] = [
186 label: '传输租户消息速率限制', 226 label: '传输租户消息速率限制',
187 colProps: { span: 24 }, 227 colProps: { span: 24 },
188 component: 'Input', 228 component: 'Input',
  229 +
189 componentProps: { 230 componentProps: {
190 placeholder: '请输入传输租户消息速率限制', 231 placeholder: '请输入传输租户消息速率限制',
191 }, 232 },
@@ -195,6 +236,7 @@ export const formSchema: FormSchema[] = [ @@ -195,6 +236,7 @@ export const formSchema: FormSchema[] = [
195 label: '租户遥测消息速率限制', 236 label: '租户遥测消息速率限制',
196 colProps: { span: 24 }, 237 colProps: { span: 24 },
197 component: 'Input', 238 component: 'Input',
  239 +
198 componentProps: { 240 componentProps: {
199 placeholder: '请输入租户遥测消息速率限制', 241 placeholder: '请输入租户遥测消息速率限制',
200 }, 242 },
@@ -204,6 +246,7 @@ export const formSchema: FormSchema[] = [ @@ -204,6 +246,7 @@ export const formSchema: FormSchema[] = [
204 label: '租户遥测数据点速率限制', 246 label: '租户遥测数据点速率限制',
205 colProps: { span: 24 }, 247 colProps: { span: 24 },
206 component: 'Input', 248 component: 'Input',
  249 +
207 componentProps: { 250 componentProps: {
208 placeholder: '请输入租户遥测数据点速率限制', 251 placeholder: '请输入租户遥测数据点速率限制',
209 }, 252 },
@@ -213,6 +256,7 @@ export const formSchema: FormSchema[] = [ @@ -213,6 +256,7 @@ export const formSchema: FormSchema[] = [
213 label: '传输设备消息速率限制', 256 label: '传输设备消息速率限制',
214 colProps: { span: 24 }, 257 colProps: { span: 24 },
215 component: 'Input', 258 component: 'Input',
  259 +
216 componentProps: { 260 componentProps: {
217 placeholder: '请输入传输设备消息速率限制', 261 placeholder: '请输入传输设备消息速率限制',
218 }, 262 },
@@ -222,6 +266,7 @@ export const formSchema: FormSchema[] = [ @@ -222,6 +266,7 @@ export const formSchema: FormSchema[] = [
222 label: '设备遥测消息速率限制', 266 label: '设备遥测消息速率限制',
223 colProps: { span: 24 }, 267 colProps: { span: 24 },
224 component: 'Input', 268 component: 'Input',
  269 +
225 componentProps: { 270 componentProps: {
226 placeholder: '请输入设备遥测消息速率限制', 271 placeholder: '请输入设备遥测消息速率限制',
227 }, 272 },
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 @register="registerDrawer" 5 @register="registerDrawer"
6 showFooter 6 showFooter
7 :title="getTitle" 7 :title="getTitle"
8 - width="500px" 8 + width="700px"
9 @ok="handleSubmit" 9 @ok="handleSubmit"
10 > 10 >
11 <BasicForm @register="registerForm" /> 11 <BasicForm @register="registerForm" />