Commit d4a291e0d10cce66469ad4377d92fcd8ff8604aa

Authored by xp.Huang
2 parents 68af1b08 0d3efb55

Merge branch 'ft-dev' into 'main'

fix:修复登录界面后端返回的错误信息,feat:个人中心接口联调,fix:待修复设备配置个别字段回显问题

See merge request huang/yun-teng-iot-front!62
  1 +import { UploadApiResult } from './model/uploadModel';
  2 +import { IPutPersonal } from './model/index';
  3 +import { defHttp } from '/@/utils/http/axios';
  4 +import { UploadFileParams } from '/#/axios';
  5 +
  6 +enum API {
  7 + BaseUploadUrl = '/api/yt/oss/upload',
  8 + PutPersonalUrl = '/user/center',
  9 + GetPersonalUrl = '/user/',
  10 +}
  11 +/**
  12 + * @description: Upload interface
  13 + */
  14 +export const uploadApi = (
  15 + params: UploadFileParams,
  16 + onUploadProgress: (progressEvent: ProgressEvent) => void
  17 +) => {
  18 + return defHttp.uploadFile<UploadApiResult>(
  19 + {
  20 + url: API.BaseUploadUrl,
  21 + onUploadProgress,
  22 + },
  23 + params
  24 + );
  25 +};
  26 +
  27 +export const personalGet = (id: string) => {
  28 + return defHttp.get({
  29 + url: `${API.GetPersonalUrl}${id}`,
  30 + });
  31 +};
  32 +
  33 +export const personalPut = (params: IPutPersonal) => {
  34 + return defHttp.put<IPutPersonal>({
  35 + url: API.PutPersonalUrl,
  36 + params,
  37 + });
  38 +};
  1 +export interface FileUploadResponse {
  2 + fileName: string;
  3 + fileDownloadUri: string;
  4 + fileType: string;
  5 + size: number;
  6 + fileStaticUri: string;
  7 +}
  8 +
  9 +export interface IPutPersonal {
  10 + accountExpireTime?: string;
  11 + activateToken?: string;
  12 + avatar?: string;
  13 + createTime?: string;
  14 + creator?: string;
  15 + deptId?: string;
  16 + email?: string;
  17 + enabled?: true;
  18 + hasPassword?: true;
  19 + id?: string;
  20 + level?: 0;
  21 + organizationIds?: [string];
  22 + password?: string;
  23 + phoneNumber?: string;
  24 + realName?: string;
  25 + roleIds?: [string];
  26 + roles?: [
  27 + {
  28 + roleId: string;
  29 + roleName: string;
  30 + }
  31 + ];
  32 + tenantId?: string;
  33 + tenantName?: string;
  34 + updateTime?: string;
  35 + updater?: string;
  36 + userStatusEnum?: string;
  37 + username?: string;
  38 +}
  1 +export interface UploadApiResult {
  2 + message: string;
  3 + code: number;
  4 + url: string;
  5 +}
@@ -91,7 +91,7 @@ @@ -91,7 +91,7 @@
91 } 91 }
92 ); 92 );
93 93
94 - function handleUploadSuccess({ source }) { 94 + function handleUploadSuccess(source) {
95 sourceValue.value = source; 95 sourceValue.value = source;
96 emit('change', source); 96 emit('change', source);
97 createMessage.success(t('component.cropper.uploadSuccess')); 97 createMessage.success(t('component.cropper.uploadSuccess'));
@@ -2,9 +2,9 @@ import { FormSchema } from '/@/components/Table'; @@ -2,9 +2,9 @@ import { FormSchema } from '/@/components/Table';
2 2
3 export const formSchema: FormSchema[] = [ 3 export const formSchema: FormSchema[] = [
4 { 4 {
5 - field: 'name', 5 + field: 'nickName',
6 label: '用户昵称', 6 label: '用户昵称',
7 - colProps: { span: 24 }, 7 + colProps: { span: 13 },
8 required: true, 8 required: true,
9 component: 'Input', 9 component: 'Input',
10 componentProps: { 10 componentProps: {
@@ -12,9 +12,9 @@ export const formSchema: FormSchema[] = [ @@ -12,9 +12,9 @@ export const formSchema: FormSchema[] = [
12 }, 12 },
13 }, 13 },
14 { 14 {
15 - field: 'phone', 15 + field: 'phoneNumber',
16 label: '手机号码', 16 label: '手机号码',
17 - colProps: { span: 24 }, 17 + colProps: { span: 13 },
18 required: true, 18 required: true,
19 component: 'Input', 19 component: 'Input',
20 componentProps: { 20 componentProps: {
@@ -24,31 +24,11 @@ export const formSchema: FormSchema[] = [ @@ -24,31 +24,11 @@ export const formSchema: FormSchema[] = [
24 { 24 {
25 field: 'email', 25 field: 'email',
26 label: '邮箱', 26 label: '邮箱',
27 - colProps: { span: 24 }, 27 + colProps: { span: 13 },
28 required: true, 28 required: true,
29 component: 'Input', 29 component: 'Input',
30 componentProps: { 30 componentProps: {
31 placeholder: '请输入邮箱', 31 placeholder: '请输入邮箱',
32 }, 32 },
33 }, 33 },
34 - {  
35 - field: 'sex',  
36 - component: 'RadioGroup',  
37 - label: '性别',  
38 - colProps: {  
39 - span: 24,  
40 - },  
41 - componentProps: {  
42 - options: [  
43 - {  
44 - label: '男',  
45 - value: 'male',  
46 - },  
47 - {  
48 - label: '女',  
49 - value: 'female',  
50 - },  
51 - ],  
52 - },  
53 - },  
54 ]; 34 ];
1 <template> 1 <template>
2 <BasicModal 2 <BasicModal
3 :useWrapper="true" 3 :useWrapper="true"
4 - width="65rem" 4 + width="80vw"
  5 + :height="compHeight"
5 v-bind="$attrs" 6 v-bind="$attrs"
6 @register="registerModal" 7 @register="registerModal"
7 @ok="handleSubmit" 8 @ok="handleSubmit"
8 > 9 >
9 <div 10 <div
10 style=" 11 style="
11 - margin-top: -20px;  
12 - width: 100vw;  
13 - height: 50vh; 12 + height: 62vh;
  13 + width: 120vw;
14 display: flex; 14 display: flex;
15 flex-direction: row; 15 flex-direction: row;
16 align-items: center; 16 align-items: center;
17 justify-content: space-between; 17 justify-content: space-between;
18 " 18 "
19 > 19 >
20 - <div style="width: 30vw; height: 20vh">  
21 - <p>个人信息</p>  
22 - <div class="change-avatar"> 20 + <div style="width: 29vw; height: 62vh; border: 1px solid #e9edf6; box-shadow: 0 0 5px -5px">
  21 + <div style="width: 29vw; height: 4vh; border: 1px solid #e9edf6"
  22 + ><p style="font-size: 17px; margin-top: 7px; margin-left: 10px">个人信息</p></div
  23 + >
  24 + <div class="change-avatar" style="text-align: center">
23 <div class="mb-2">头像</div> 25 <div class="mb-2">头像</div>
24 <CropperAvatar 26 <CropperAvatar
  27 + :uploadApi="uploadApi"
25 :value="avatar" 28 :value="avatar"
26 btnText="更换头像" 29 btnText="更换头像"
27 :btnProps="{ preIcon: 'ant-design:cloud-upload-outlined' }" 30 :btnProps="{ preIcon: 'ant-design:cloud-upload-outlined' }"
@@ -30,106 +33,137 @@ @@ -30,106 +33,137 @@
30 /> 33 />
31 </div> 34 </div>
32 <Description 35 <Description
33 - class="mt-4"  
34 - layout="vertical"  
35 - :collapseOptions="{ canExpand: true, helpMessage: 'help me' }"  
36 - :column="2" 36 + class="mt-8"
  37 + :column="1"
37 :schema="schema" 38 :schema="schema"
38 - :data="descData" 39 + :bordered="true"
  40 + :data="getPersonalDetailValue"
39 @register="registerDesc" 41 @register="registerDesc"
40 /> 42 />
41 </div> 43 </div>
42 - <div style="width: 70vw; height: 20vh">  
43 - <p>基本资料</p>  
44 - <BasicForm @register="registerForm" /> 44 + <div
  45 + style="
  46 + width: 90vw;
  47 + height: 60vh;
  48 + border: 1px solid #e9edf6;
  49 + margin-top: -15px;
  50 + box-shadow: 0 0 5px -5px;
  51 + "
  52 + >
  53 + <div style="width: 90vw; height: 4vh; border: 1px solid #e9edf6"
  54 + ><p style="font-size: 17px; margin-top: 7px; margin-left: 20px">基本资料</p></div
  55 + >
  56 + <div style="margin-left: 20px">
  57 + <BasicForm @register="registerForm" />
  58 + </div>
45 </div> 59 </div>
46 </div> 60 </div>
47 </BasicModal> 61 </BasicModal>
48 </template> 62 </template>
49 <script lang="ts"> 63 <script lang="ts">
50 - import { defineComponent, ref, computed } from 'vue'; 64 + import { defineComponent, ref, computed, onMounted } from 'vue';
51 import { BasicModal, useModalInner } from '/@/components/Modal/index'; 65 import { BasicModal, useModalInner } from '/@/components/Modal/index';
52 import { BasicForm, useForm } from '/@/components/Form/index'; 66 import { BasicForm, useForm } from '/@/components/Form/index';
53 import { formSchema } from './config'; 67 import { formSchema } from './config';
54 import { Description, DescItem, useDescription } from '/@/components/Description/index'; 68 import { Description, DescItem, useDescription } from '/@/components/Description/index';
55 import { CropperAvatar } from '/@/components/Cropper'; 69 import { CropperAvatar } from '/@/components/Cropper';
56 import defaultImage from '/@/assets/images/logo.png'; 70 import defaultImage from '/@/assets/images/logo.png';
  71 + import { uploadApi, personalPut } from '/@/api/personal/index';
  72 + import { useMessage } from '/@/hooks/web/useMessage';
  73 + import { USER_INFO_KEY } from '/@/enums/cacheEnum';
  74 + import { getAuthCache } from '/@/utils/auth';
  75 + import { useUserStore } from '/@/store/modules/user';
57 76
58 const schema: DescItem[] = [ 77 const schema: DescItem[] = [
59 { 78 {
60 - field: 'name',  
61 - label: '用户名称', 79 + field: 'username',
  80 + label: '用户名称:',
62 }, 81 },
63 { 82 {
64 - field: 'phone',  
65 - label: '手机号码',  
66 - render: (curVal, data) => {  
67 - return `${data.username}-${curVal}`;  
68 - }, 83 + field: 'phoneNumber',
  84 + label: '手机号码:',
69 }, 85 },
70 { 86 {
71 field: 'email', 87 field: 'email',
72 - label: '用户邮箱', 88 + label: '用户邮箱',
73 }, 89 },
74 { 90 {
75 - field: 'name1',  
76 - label: '用户昵称', 91 + field: 'realName',
  92 + label: '用户昵称:',
77 }, 93 },
78 { 94 {
79 - field: 'timeout',  
80 - label: '过期时间', 95 + field: 'accountExpireTime',
  96 + label: '过期时间:',
81 }, 97 },
82 { 98 {
83 field: 'createTime', 99 field: 'createTime',
84 - label: '创建时间', 100 + label: '创建时间',
85 }, 101 },
86 ]; 102 ];
87 -  
88 - const descData = {  
89 - name: '测试',  
90 - phone: 'xxxx',  
91 - email: 'dddddd',  
92 - name1: 'ddd',  
93 - timeout: '2021-90=90',  
94 - createTime: '2021-90=90',  
95 - };  
96 -  
97 export default defineComponent({ 103 export default defineComponent({
98 name: 'index', 104 name: 'index',
99 components: { BasicModal, BasicForm, Description, CropperAvatar }, 105 components: { BasicModal, BasicForm, Description, CropperAvatar },
100 setup() { 106 setup() {
  107 + const userStore = useUserStore();
  108 + const userInfo = getAuthCache(USER_INFO_KEY);
  109 + const { createMessage } = useMessage();
101 const getPersonalValue: any = ref({}); 110 const getPersonalValue: any = ref({});
  111 + const getPersonalDetailValue: any = ref({});
  112 + const avatarUrl: any = ref('');
  113 + const getBackendV: any = ref({});
102 const [registerDesc] = useDescription({ 114 const [registerDesc] = useDescription({
103 title: '个人详情', 115 title: '个人详情',
104 schema: schema, 116 schema: schema,
105 }); 117 });
106 118
107 - const [registerModal] = useModalInner();  
108 - const [registerForm, { validate }] = useForm({ 119 + const [registerModal, { closeModal }] = useModalInner();
  120 + const [registerForm, { validate, resetFields }] = useForm({
109 showActionButtonGroup: false, 121 showActionButtonGroup: false,
110 schemas: formSchema, 122 schemas: formSchema,
111 }); 123 });
112 const avatar = computed(() => { 124 const avatar = computed(() => {
113 - // :uploadApi="uploadApi"  
114 - // const { avatar } = userStore.getUserInfo;  
115 - return defaultImage; 125 + const { avatar } = userStore.getUserInfo;
  126 + return avatar || defaultImage;
116 }); 127 });
117 const handleSubmit = async () => { 128 const handleSubmit = async () => {
  129 + // console.log(userStore.getUserInfo);
  130 + const getUserInfo = await userInfo;
  131 + // console.log(getUserInfo);
118 getPersonalValue.value = await validate(); 132 getPersonalValue.value = await validate();
119 - console.log(getPersonalValue.value);  
120 - //TODO 后端接口 133 + getPersonalValue.value.id = getUserInfo.userId;
  134 + getPersonalValue.value.username = getBackendV.value.username;
  135 + getPersonalValue.value.avatar = avatarUrl.value;
  136 + await personalPut(getPersonalValue.value);
  137 + createMessage.success('修改成功');
  138 + closeModal();
  139 + resetFields();
121 }; 140 };
122 - const updateAvatar = (src: string) => {  
123 - console.log('src' + src);  
124 - // const userinfo = userStore.getUserInfo;  
125 - // userinfo.avatar = src;  
126 - // userStore.setUserInfo(userinfo); 141 + const updateAvatar = async (v) => {
  142 + avatarUrl.value = v.data.fileStaticUri;
  143 + console.log(avatarUrl.value);
  144 + // await personalPut({ avatar: v });
127 }; 145 };
  146 + const getPersonalDetail = async () => {
  147 + try {
  148 + const getUserInfo = await userInfo;
  149 + getPersonalDetailValue.value = getUserInfo;
  150 + } catch (e) {
  151 + return e;
  152 + }
  153 + };
  154 + onMounted(async () => {
  155 + getPersonalDetail();
  156 + });
  157 + const compHeight = computed(() => {
  158 + return 1000;
  159 + });
128 return { 160 return {
  161 + uploadApi,
  162 + compHeight,
129 updateAvatar, 163 updateAvatar,
130 avatar, 164 avatar,
131 handleSubmit, 165 handleSubmit,
132 - descData, 166 + getPersonalDetailValue,
133 registerDesc, 167 registerDesc,
134 schema, 168 schema,
135 registerModal, 169 registerModal,
@@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
32 <MenuItem 32 <MenuItem
33 key="personal" 33 key="personal"
34 :text="t('layout.header.dropdownItemPersonal')" 34 :text="t('layout.header.dropdownItemPersonal')"
35 - icon="ion:power-outline" 35 + icon="ion:build-outlined"
36 /> 36 />
37 </Menu> 37 </Menu>
38 </template> 38 </template>
@@ -121,7 +121,9 @@ @@ -121,7 +121,9 @@
121 } 121 }
122 122
123 const openPersonalFunc = () => { 123 const openPersonalFunc = () => {
124 - openModalPersonal(true); 124 + setTimeout(() => {
  125 + openModalPersonal(true);
  126 + }, 10);
125 }; 127 };
126 128
127 return { 129 return {
@@ -129,6 +129,7 @@ export const useUserStore = defineStore({ @@ -129,6 +129,7 @@ export const useUserStore = defineStore({
129 try { 129 try {
130 const { goHome = true, mode, ...loginParams } = params; 130 const { goHome = true, mode, ...loginParams } = params;
131 const data = await loginApi(loginParams, mode); 131 const data = await loginApi(loginParams, mode);
  132 + console.log(data);
132 return this.process(data, goHome); 133 return this.process(data, goHome);
133 } catch (error) { 134 } catch (error) {
134 return Promise.reject(error); 135 return Promise.reject(error);
@@ -15,18 +15,53 @@ import { setObjToUrlParams, deepMerge } from '/@/utils'; @@ -15,18 +15,53 @@ import { setObjToUrlParams, deepMerge } from '/@/utils';
15 import { useErrorLogStoreWithOut } from '/@/store/modules/errorLog'; 15 import { useErrorLogStoreWithOut } from '/@/store/modules/errorLog';
16 import { useI18n } from '/@/hooks/web/useI18n'; 16 import { useI18n } from '/@/hooks/web/useI18n';
17 import { joinTimestamp, formatRequestDate } from './helper'; 17 import { joinTimestamp, formatRequestDate } from './helper';
18 -// import { PageEnum } from '/@/enums/pageEnum'; 18 +import { PageEnum } from '/@/enums/pageEnum';
19 import { REFRESH_TOKEN_KEY } from '/@/enums/cacheEnum'; 19 import { REFRESH_TOKEN_KEY } from '/@/enums/cacheEnum';
20 import { router } from '/@/router'; 20 import { router } from '/@/router';
  21 +
21 // import { useUserStore } from '/@/store/modules/user'; 22 // import { useUserStore } from '/@/store/modules/user';
22 // const userStore = useUserStore(); 23 // const userStore = useUserStore();
23 // console.log(userStore.userInfo); 24 // console.log(userStore.userInfo);
24 25
25 // YUNTENG IOT__DEVELOPMENT__2.7.1__COMMON__LOCAL__KEY__ 26 // YUNTENG IOT__DEVELOPMENT__2.7.1__COMMON__LOCAL__KEY__
  27 +
  28 +function timestampToTime(timestamp) {
  29 + const date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
  30 + const Y = date.getFullYear() + '-';
  31 + const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
  32 + const D = date.getDate() + ' ';
  33 + const h = date.getHours() + ':';
  34 + const m = date.getMinutes() + ':';
  35 + const s = date.getSeconds();
  36 + return Y + M + D + h + m + s;
  37 +}
  38 +
  39 +function convertToDate() {
  40 + const date = new Date();
  41 + const y = date.getFullYear();
  42 + let m = date.getMonth() + 1;
  43 + let d = date.getDate();
  44 + let h = date.getHours();
  45 + let min = date.getMinutes();
  46 + let s = date.getSeconds();
  47 + m = m < 10 ? '0' + m : m; //月小于10,加0
  48 + d = d < 10 ? '0' + d : d; //day小于10,加0
  49 + h = h < 10 ? '0' + h : h;
  50 + min = min < 10 ? '0' + min : min;
  51 + s = s < 10 ? '0' + s : s;
  52 + return y + '-' + m + '-' + d + ' ' + h + ':' + min + ':' + s;
  53 +}
  54 +
26 const globSetting = useGlobSetting(); 55 const globSetting = useGlobSetting();
27 const urlPrefix = globSetting.urlPrefix; 56 const urlPrefix = globSetting.urlPrefix;
28 const { createMessage, createErrorModal } = useMessage(); 57 const { createMessage, createErrorModal } = useMessage();
29 const getJwtTokenInfo = getAuthCache(REFRESH_TOKEN_KEY); 58 const getJwtTokenInfo = getAuthCache(REFRESH_TOKEN_KEY);
  59 +const getExiper = window.localStorage.getItem(
  60 + 'UNDEFINED__DEVELOPMENT__2.7.1__COMMON__LOCAL__KEY__'
  61 +);
  62 +const getExiperValue = JSON.parse(getExiper);
  63 +const expireTime = timestampToTime(getExiperValue.expire);
  64 +const nowTime = convertToDate();
30 65
31 /** 66 /**
32 * @description: 数据处理,方便区分多种处理方式 67 * @description: 数据处理,方便区分多种处理方式
@@ -130,16 +165,25 @@ const transform: AxiosTransform = { @@ -130,16 +165,25 @@ const transform: AxiosTransform = {
130 165
131 try { 166 try {
132 if (response.data.code === '401' || response.data.msg === 'tenant has expired') { 167 if (response.data.code === '401' || response.data.msg === 'tenant has expired') {
133 - createMessage.error('token已过期,退回登录');  
134 - // router.push(PageEnum.BASE_LOGIN);  
135 - router.beforeEach((to, from, next) => {  
136 - if (getJwtTokenInfo) {  
137 - if (to.path === '/login' || to.path !== '/login') {  
138 - // doRefresh();  
139 - next({ path: '/' });  
140 - } 168 + if (expireTime < nowTime) {
  169 + // console.log('过期');
  170 + createMessage.error('token已经过期,请退回登录');
  171 + } else {
  172 + // console.log('未过期');
  173 + }
  174 + if (getJwtTokenInfo) {
  175 + if (PageEnum.BASE_LOGIN) {
  176 + router.push(PageEnum.BASE_LOGIN);
141 } 177 }
142 - }); 178 + }
  179 + // router.beforeEach((to, from, next) => {
  180 + // if (getJwtTokenInfo) {
  181 + // if (to.path !== '/login') {
  182 + // // doRefresh();
  183 + // next({ path: '/' });
  184 + // }
  185 + // }
  186 + // });
143 } else { 187 } else {
144 // doRefresh(); 188 // doRefresh();
145 } 189 }
@@ -78,12 +78,12 @@ @@ -78,12 +78,12 @@
78 step3ViewHighSetting, 78 step3ViewHighSetting,
79 step3CreateAlarm, 79 step3CreateAlarm,
80 alertContactsSchemas, 80 alertContactsSchemas,
81 - echoFormSchema,  
82 } from './step/data'; 81 } from './step/data';
83 82
84 import { formSchema as conditionFormSchema } from './step/cpns/alarmruleconditions/config'; 83 import { formSchema as conditionFormSchema } from './step/cpns/alarmruleconditions/config';
85 import { formSchema as enableSchema } from './step/cpns/enablerule/config'; 84 import { formSchema as enableSchema } from './step/cpns/enablerule/config';
86 import { formSchema as detailSchema } from './step/cpns/detailtemplate/config'; 85 import { formSchema as detailSchema } from './step/cpns/detailtemplate/config';
  86 + import { formSchema as echoFormSchema } from './step/cpns/alarmruleconditions/cpns/config';
87 87
88 export default defineComponent({ 88 export default defineComponent({
89 name: 'ConfigDrawer', 89 name: 'ConfigDrawer',
@@ -162,86 +162,73 @@ @@ -162,86 +162,73 @@
162 descInfo.value = await deviceConfigGetDetail(data.record.id); 162 descInfo.value = await deviceConfigGetDetail(data.record.id);
163 try { 163 try {
164 await setRegisterDetail({ ...descInfo.value }); 164 await setRegisterDetail({ ...descInfo.value });
165 - // await setRegisterTrans({  
166 - // transportType: descInfo.value.profileData.transportConfiguration.type,  
167 - // });  
168 - // await setRegisterStep3Schemas({  
169 - // alarmType: descInfo.value.profileData.alarms[0].alarmType,  
170 - // });  
171 - // await setRegisterStep3HighSetting({  
172 - // propagate: descInfo.value.profileData.alarms[0].propagate,  
173 - // propagateRelationTypes: descInfo.value.profileData.alarms[0].propagateRelationTypes[0],  
174 - // });  
175 - // await setRegisterStep3CreateAlarm({ ...descInfo.value });  
176 - // await setRegisterStep3RuleAlarm({ ...descInfo.value });  
177 - // await setRegisterContact({ ...descInfo.value });  
178 - // await setRegisterStep3Condition({ ...descInfo.value });  
179 - // await setRegisterStep3Enable({ ...descInfo.value });  
180 - // await setRegisterStep3TemplateDetail({ ...descInfo.value });  
181 } catch (e) { 165 } catch (e) {
182 return e; 166 return e;
183 } 167 }
184 }); 168 });
185 const handleChange = (v) => { 169 const handleChange = (v) => {
186 - switch (v) {  
187 - case '1':  
188 - setRegisterDetail({ ...descInfo.value });  
189 - break;  
190 - case '2':  
191 - setRegisterTrans({  
192 - transportType: descInfo.value.profileData?.transportConfiguration.type,  
193 - });  
194 - break;  
195 - case '3':  
196 - setRegisterStep3Schemas({  
197 - alarmType: descInfo.value.profileData?.alarms[0].alarmType,  
198 - });  
199 - setRegisterStep3HighSetting({  
200 - propagate: descInfo.value.profileData?.alarms[0].propagate,  
201 - propagateRelationTypes: descInfo.value.profileData?.alarms[0].propagateRelationTypes,  
202 - });  
203 - const getKey = Object.keys(descInfo.value.profileData?.alarms[0].createRules);  
204 - console.log(descInfo.value.profileData?.alarms[0].createRules[getKey[0]]);  
205 - // console.log(descInfo.value.profileData.alarms[0].createRules.MAJOR);  
206 - // console.log(descInfo.value.profileData.alarms[0].createRules['MAJOR']);  
207 - setRegisterStep3CreateAlarm({  
208 - WARNING: descInfo.value.profileData?.alarms[0].createRules[getKey[0]],  
209 - });  
210 - setRegisterStep3RuleAlarm({  
211 - type: descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition  
212 - .condition[0].key.type,  
213 - key: descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition  
214 - .condition[0].key.key,  
215 - valueType:  
216 - descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition.condition[0]  
217 - .valueType,  
218 - value:  
219 - descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition.condition[0]  
220 - .value,  
221 - predicate:  
222 - descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition.condition[0]  
223 - .predicate,  
224 - });  
225 - setRegisterStep3Condition({  
226 - conditionType:  
227 - descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition.spec.type,  
228 - });  
229 - setRegisterStep3Enable({  
230 - schedule: descInfo.value.profileData?.alarms[0].createRules[getKey[0]].schedule,  
231 - });  
232 - setRegisterStep3TemplateDetail({  
233 - alarmDetails:  
234 - descInfo.value.profileData?.alarms[0].createRules[getKey[0]].alarmDetails,  
235 - });  
236 - break;  
237 - case '4':  
238 - setRegisterContact({  
239 - alarmContactId: descInfo.value.alarmProfile.alarmContactId,  
240 - messageMode: descInfo.value.alarmProfile.messageMode,  
241 - });  
242 - break; 170 + try {
  171 + switch (v) {
  172 + case '1':
  173 + setRegisterDetail({ ...descInfo.value });
  174 + break;
  175 + case '2':
  176 + setRegisterTrans({
  177 + transportType: descInfo.value.profileData?.transportConfiguration.type,
  178 + });
  179 + break;
  180 + case '3':
  181 + setRegisterStep3Schemas({
  182 + alarmType: descInfo.value.profileData?.alarms[0].alarmType,
  183 + });
  184 + setRegisterStep3HighSetting({
  185 + propagate: descInfo.value.profileData?.alarms[0].propagate,
  186 + propagateRelationTypes:
  187 + descInfo.value.profileData?.alarms[0].propagateRelationTypes,
  188 + });
  189 + const getKey = Object.keys(descInfo.value.profileData?.alarms[0].createRules);
  190 + setRegisterStep3CreateAlarm({
  191 + default: getKey[0],
  192 + });
  193 + setRegisterStep3RuleAlarm({
  194 + type: descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition
  195 + .condition[0].key.type,
  196 + key: descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition
  197 + .condition[0].key.key,
  198 + valueType:
  199 + descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition
  200 + .condition[0].valueType,
  201 + value:
  202 + descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition
  203 + .condition[0].value,
  204 + operation:
  205 + descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition
  206 + .condition[0].predicate.operation,
  207 + });
  208 + setRegisterStep3Condition({
  209 + conditionType:
  210 + descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition.spec.type,
  211 + });
  212 + setRegisterStep3Enable({
  213 + schedule: descInfo.value.profileData?.alarms[0].createRules[getKey[0]].schedule,
  214 + });
  215 + setRegisterStep3TemplateDetail({
  216 + alarmDetails:
  217 + descInfo.value.profileData?.alarms[0].createRules[getKey[0]].alarmDetails,
  218 + });
  219 + break;
  220 + case '4':
  221 + setRegisterContact({
  222 + alarmContactId: descInfo.value.alarmProfile.alarmContactId,
  223 + messageMode: descInfo.value.alarmProfile.messageMode,
  224 + });
  225 + break;
  226 + }
  227 + } catch (e) {
  228 + return e;
243 } 229 }
244 }; 230 };
  231 +
245 watch( 232 watch(
246 () => activeKey.value, 233 () => activeKey.value,
247 (v) => { 234 (v) => {
1 -{  
2 - "name": "测试abcd",  
3 - "defaultRuleChainId": "354c7210-5d97-11ec-8ac9-f38ed935ea2a",  
4 - "defaultQueueName": "HighPriority",  
5 - "description": "测试abcd",  
6 - "transportType": "DEFAULT",  
7 - "profileData": {  
8 - "alarms": [  
9 - {  
10 - "alarmType": "测试abcd",  
11 - "propagate": true,  
12 - "propagateRelationTypes": [  
13 - "测试abcd"  
14 - ],  
15 - "createRules": {  
16 - "MAJOR": {  
17 - "alarmDetails": "测试abcd",  
18 - "schedule": {  
19 - "type": "ANY_TIME"  
20 - },  
21 - "condition": {  
22 - "condition": [  
23 - {  
24 - "key": {  
25 - "type": "TIME_SERIES",  
26 - "key": "temp"  
27 - },  
28 - "valueType": "NUMERIC",  
29 - "predicate": {  
30 - "operation": "EQUAL",  
31 - "value": {  
32 - "defaultValue": 1  
33 - },  
34 - "type": "NUMERIC"  
35 - }  
36 - }  
37 - ],  
38 - "spec": {  
39 - "type": "SIMPLE"  
40 - }  
41 - }  
42 - }  
43 - },  
44 - "clearRule": {  
45 - "alarmDetails": "测",  
46 - "schedule": {  
47 - "type": "ANY_TIME"  
48 - },  
49 - "condition": {  
50 - "condition": [  
51 - {  
52 - "key": {  
53 - "type": "TIME_SERIES",  
54 - "key": "CO2"  
55 - },  
56 - "valueType": "NUMERIC",  
57 - "predicate": {  
58 - "operation": "NOT_EQUAL",  
59 - "value": {  
60 - "defaultValue": 2  
61 - },  
62 - "type": "NUMERIC"  
63 - }  
64 - }  
65 - ],  
66 - "spec": {  
67 - "type": "SIMPLE"  
68 - }  
69 - }  
70 - },  
71 - "id": "4e299769-24d1-4cef-91ad-f206f5fb234b"  
72 - }  
73 - ]  
74 - },  
75 - "alarmProfile": {  
76 - "alarmContactId": "a3004ddd-db8f-487c-aea0-4f6f3efc59a9",  
77 - "messageMode": "EMAIL_MESSAGE"  
78 - }  
79 -}  
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <template v-for="(item, index) in profileData" :key="item.id"> 3 <template v-for="(item, index) in profileData" :key="item.id">
4 <CollapseContainer class="border mb-1" :canExpan="false"> 4 <CollapseContainer class="border mb-1" :canExpan="false">
5 <template #action> 5 <template #action>
6 - <div @click="deleteAlarmRule(index)" class="cursor-pointer"> 6 + <div class="cursor-pointer">
7 <img 7 <img
8 style="cursor: pointer" 8 style="cursor: pointer"
9 @click="deleteAlarmRule(index)" 9 @click="deleteAlarmRule(index)"
@@ -78,7 +78,7 @@ @@ -78,7 +78,7 @@
78 <div style="height: 20px"></div> 78 <div style="height: 20px"></div>
79 <p>清除报警规则</p> 79 <p>清除报警规则</p>
80 <template 80 <template
81 - v-for="(childClearItem, createIndex) in item.alarms[0].clearRule" 81 + v-for="(childClearItem, clearIndexItem) in item.alarms[clearIndex].clearRule"
82 :key="childClearItem.id" 82 :key="childClearItem.id"
83 > 83 >
84 <div class="aic mb-1" style="border: 1px solid #bfbfbf"> 84 <div class="aic mb-1" style="border: 1px solid #bfbfbf">
@@ -176,13 +176,7 @@ @@ -176,13 +176,7 @@
176 dashboardFormScheme, 176 dashboardFormScheme,
177 isWhereType, 177 isWhereType,
178 } from './data'; 178 } from './data';
179 - import {  
180 - DeleteOutlined,  
181 - // MinusCircleOutlined,  
182 - PlusCircleOutlined,  
183 - PlusOutlined,  
184 - EditOutlined,  
185 - } from '@ant-design/icons-vue'; 179 + import { PlusCircleOutlined } from '@ant-design/icons-vue';
186 import { Checkbox } from 'ant-design-vue'; 180 import { Checkbox } from 'ant-design-vue';
187 import { useModal } from '/@/components/Modal'; 181 import { useModal } from '/@/components/Modal';
188 import DetailTemplate from './cpns/detailtemplate/index.vue'; 182 import DetailTemplate from './cpns/detailtemplate/index.vue';
@@ -190,17 +184,14 @@ @@ -190,17 +184,14 @@
190 import AlarmRuleConditions from './cpns/alarmruleconditions/index.vue'; 184 import AlarmRuleConditions from './cpns/alarmruleconditions/index.vue';
191 import { Button } from '/@/components/Button'; 185 import { Button } from '/@/components/Button';
192 186
  187 + export const isWhereTypeValueDisabled = ref(false);
  188 +
193 export default defineComponent({ 189 export default defineComponent({
194 components: { 190 components: {
195 BasicForm, 191 BasicForm,
196 CollapseContainer, 192 CollapseContainer,
197 - DeleteOutlined,  
198 - // MinusCircleOutlined,  
199 PlusCircleOutlined, 193 PlusCircleOutlined,
200 - PlusOutlined,  
201 - EditOutlined,  
202 Checkbox, 194 Checkbox,
203 - // Tooltip,  
204 DetailTemplate, 195 DetailTemplate,
205 EnableRule, 196 EnableRule,
206 AlarmRuleConditions, 197 AlarmRuleConditions,
@@ -231,12 +222,13 @@ @@ -231,12 +222,13 @@
231 const ruleClearTemplateData: any = ref(null); 222 const ruleClearTemplateData: any = ref(null);
232 const enableClearTemplateData: any = ref(null); 223 const enableClearTemplateData: any = ref(null);
233 const detailClearTemplateData: any = ref(null); 224 const detailClearTemplateData: any = ref(null);
  225 + const clearIndex = ref(-1);
234 //告警列表 226 //告警列表
235 let profileData = ref<IProfileData[]>([]); 227 let profileData = ref<IProfileData[]>([]);
236 const log = (e) => { 228 const log = (e) => {
237 console.log(e); 229 console.log(e);
238 }; 230 };
239 - // 添加和删除告警配置 231 + //删除告警配置
240 const deleteAlarmRule = (index: number) => { 232 const deleteAlarmRule = (index: number) => {
241 unref(profileData).splice(index, 1); 233 unref(profileData).splice(index, 1);
242 }; 234 };
@@ -244,8 +236,9 @@ @@ -244,8 +236,9 @@
244 const prevStep = () => { 236 const prevStep = () => {
245 emit('prev'); 237 emit('prev');
246 }; 238 };
247 - 239 + //添加报警规则
248 const addAlarmRule = () => { 240 const addAlarmRule = () => {
  241 + clearIndex.value++;
249 unref(profileData).push({ 242 unref(profileData).push({
250 configuration: { 243 configuration: {
251 type: '', 244 type: '',
@@ -328,6 +321,7 @@ @@ -328,6 +321,7 @@
328 setFieldsValue: setRegisterFormCreateAlarm, 321 setFieldsValue: setRegisterFormCreateAlarm,
329 resetFields: resetRegisterFormCreateAlarm, 322 resetFields: resetRegisterFormCreateAlarm,
330 validate: validateRegisterFormCreateAlarm, 323 validate: validateRegisterFormCreateAlarm,
  324 + updateSchema,
331 }, 325 },
332 ] = useForm({ 326 ] = useForm({
333 labelWidth: 120, 327 labelWidth: 120,
@@ -358,8 +352,55 @@ @@ -358,8 +352,55 @@
358 const retryRegisterFormCreateAlarmFunc = (v) => { 352 const retryRegisterFormCreateAlarmFunc = (v) => {
359 setRegisterFormCreateAlarm(v); 353 setRegisterFormCreateAlarm(v);
360 }; 354 };
  355 + const tempValue1: string = ref<string>('');
361 // 添加‘创建条件’ 356 // 添加‘创建条件’
362 const addCreateRole = (index: number) => { 357 const addCreateRole = (index: number) => {
  358 + updateSchema({
  359 + field: 'default',
  360 + componentProps: ({ formModel }) => {
  361 + if (formModel.default == 'CRITICAL') {
  362 + tempValue1.value = formModel.default;
  363 + } else if (formModel.default == 'MAJOR') {
  364 + tempValue1.value = formModel.default;
  365 + } else if (formModel.default == 'MINOR') {
  366 + tempValue1.value = formModel.default;
  367 + } else if (formModel.default == 'WARNING') {
  368 + tempValue1.value = formModel.default;
  369 + } else if (formModel.default == 'INDETERMINATE') {
  370 + tempValue1.value = formModel.default;
  371 + }
  372 + return {
  373 + options: [
  374 + {
  375 + value: 'CRITICAL',
  376 + label: '危险',
  377 + disabled: tempValue1.value == 'CRITICAL',
  378 + },
  379 + {
  380 + value: 'MAJOR',
  381 + label: '重要',
  382 + disabled: tempValue1.value == 'MAJOR',
  383 + },
  384 + {
  385 + value: 'MINOR',
  386 + label: '次要',
  387 + disabled: tempValue1.value == 'MINOR',
  388 + },
  389 + {
  390 + value: 'WARNING',
  391 + label: '警告',
  392 + disabled: tempValue1.value == 'WARNING',
  393 + },
  394 + {
  395 + value: 'INDETERMINATE',
  396 + label: '不确定',
  397 + disabled: tempValue1.value == 'INDETERMINATE',
  398 + },
  399 + ],
  400 + };
  401 + },
  402 + });
  403 +
363 unref(profileData)[index].alarms.push({ 404 unref(profileData)[index].alarms.push({
364 id: Date.now() + Math.random() + '', 405 id: Date.now() + Math.random() + '',
365 alarmType: '', 406 alarmType: '',
@@ -390,13 +431,18 @@ @@ -390,13 +431,18 @@
390 }; 431 };
391 watch(isWhereType, (nV) => { 432 watch(isWhereType, (nV) => {
392 isWhereTypeValue.value = nV; 433 isWhereTypeValue.value = nV;
  434 + if (isWhereTypeValue.value == nV) {
  435 + isWhereTypeValueDisabled.value = true;
  436 + } else {
  437 + // isWhereTypeValueDisabled.value = false;
  438 + }
393 }); 439 });
394 //详情模板 440 //详情模板
395 const getAllFieldsFunc = (v) => { 441 const getAllFieldsFunc = (v) => {
396 detailObj.value = v; 442 detailObj.value = v;
397 detailTemplateData.value = ` 443 detailTemplateData.value = `
398 - 报警详细信息:${v.alarmDetails}  
399 - `; 444 + 报警详细信息:${v.alarmDetails}
  445 + `;
400 }; 446 };
401 //启用规则 447 //启用规则
402 const getAllFieldsEnabFunc = (v) => { 448 const getAllFieldsEnabFunc = (v) => {
@@ -440,10 +486,12 @@ @@ -440,10 +486,12 @@
440 console.log(e); 486 console.log(e);
441 } 487 }
442 }); 488 });
443 -  
444 - enableTemplateData.value = `  
445 - 开始时间:${v.startsOn}结束时间:${v.endsOn}天数:${findDayByValue}  
446 - `; 489 + enableTemplateData.value =
  490 + v.startsOn == undefined
  491 + ? `始终启用`
  492 + : `
  493 + 开始时间:${v.startsOn},结束时间:${v.endsOn},天数:${findDayByValue}
  494 + `;
447 }; 495 };
448 //规则条件 496 //规则条件
449 const getAllFieldsRuleFunc = (v, v1) => { 497 const getAllFieldsRuleFunc = (v, v1) => {
@@ -468,8 +516,8 @@ @@ -468,8 +516,8 @@
468 } 516 }
469 }); 517 });
470 ruleTemplateData.value = ` 518 ruleTemplateData.value = `
471 - 键名:${v.key1}...操作:${findRuleByValue?.label}...值:${v.value1}  
472 - `; 519 + 键名:${v.key1}...操作:${findRuleByValue?.label}...值:${v.value1}
  520 + `;
473 521
474 ruleLastObj.value = v1; 522 ruleLastObj.value = v1;
475 const predicate = { 523 const predicate = {
@@ -514,8 +562,8 @@ @@ -514,8 +562,8 @@
514 const getAllClearFieldsFunc = (v) => { 562 const getAllClearFieldsFunc = (v) => {
515 detailClearObj.value = v; 563 detailClearObj.value = v;
516 detailClearTemplateData.value = ` 564 detailClearTemplateData.value = `
517 - 报警详细信息:${v.alarmDetails}  
518 - `; 565 + 报警详细信息:${v.alarmDetails}
  566 + `;
519 }; 567 };
520 //启用规则 568 //启用规则
521 const getAllClearFieldsEnabFunc = (v) => { 569 const getAllClearFieldsEnabFunc = (v) => {
@@ -559,9 +607,11 @@ @@ -559,9 +607,11 @@
559 console.log(e); 607 console.log(e);
560 } 608 }
561 }); 609 });
562 - enableClearTemplateData.value = `  
563 - 开始时间:${v.startsOn}结束时间:${v.endsOn}天数:${findDayByValue}  
564 - `; 610 + enableClearTemplateData.value =
  611 + v.startsOn == undefined
  612 + ? `始终启用`
  613 + : `开始时间:${v.startsOn},结束时间:${v.endsOn},天数:${findDayByValue}
  614 + `;
565 }; 615 };
566 //规则条件 616 //规则条件
567 const getAllClearFieldsRuleFunc = (v, v1) => { 617 const getAllClearFieldsRuleFunc = (v, v1) => {
@@ -586,8 +636,8 @@ @@ -586,8 +636,8 @@
586 } 636 }
587 }); 637 });
588 ruleClearTemplateData.value = ` 638 ruleClearTemplateData.value = `
589 - 键名:${v.key1}...操作:${findRuleByValue?.label}...值:${v.value1}  
590 - `; 639 + 键名:${v.key1}...操作:${findRuleByValue?.label}...值:${v.value1}
  640 + `;
591 641
592 ruleLastObj.value = v1; 642 ruleLastObj.value = v1;
593 const predicate = { 643 const predicate = {
@@ -762,7 +812,9 @@ @@ -762,7 +812,9 @@
762 proxy.$refs.getChildData3.resetDataFunc(); 812 proxy.$refs.getChildData3.resetDataFunc();
763 }, 50); 813 }, 50);
764 }; 814 };
  815 +
765 return { 816 return {
  817 + clearIndex,
766 retryRegisterFormFunc, 818 retryRegisterFormFunc,
767 retryRegisterFormHighSettingmFunc, 819 retryRegisterFormHighSettingmFunc,
768 retryRegisterFormCreateAlarmFunc, 820 retryRegisterFormCreateAlarmFunc,
@@ -28,6 +28,7 @@ export const formSchema: FormSchema[] = [ @@ -28,6 +28,7 @@ export const formSchema: FormSchema[] = [
28 colProps: { span: 12 }, 28 colProps: { span: 12 },
29 required: true, 29 required: true,
30 component: 'Select', 30 component: 'Select',
  31 + defaultValue: 'ANY_TIME',
31 componentProps: { 32 componentProps: {
32 placeholder: '请选择报警日程表', 33 placeholder: '请选择报警日程表',
33 options: [ 34 options: [
@@ -146,39 +146,41 @@ export const isWhereType = ref(null); @@ -146,39 +146,41 @@ export const isWhereType = ref(null);
146 146
147 export const step3CreateAlarm: FormSchema[] = [ 147 export const step3CreateAlarm: FormSchema[] = [
148 { 148 {
149 - field: 'WARNING', 149 + field: 'default',
150 component: 'Select', 150 component: 'Select',
151 label: '严重程度', 151 label: '严重程度',
152 colProps: { 152 colProps: {
153 span: 16, 153 span: 16,
154 }, 154 },
155 - componentProps: {  
156 - placeholder: '请选择严重程度',  
157 - options: [  
158 - {  
159 - value: 'CRITICAL',  
160 - label: '危险',  
161 - },  
162 - {  
163 - value: 'MAJOR',  
164 - label: '重要',  
165 - },  
166 - {  
167 - value: 'MINOR',  
168 - label: '次要',  
169 - },  
170 - {  
171 - value: 'WARNING',  
172 - label: '警告',  
173 - },  
174 - {  
175 - value: 'INDETERMINATE',  
176 - label: '不确定', 155 + componentProps({ formModel }) {
  156 + return {
  157 + placeholder: '请选择严重程度',
  158 + options: [
  159 + {
  160 + value: 'CRITICAL',
  161 + label: '危险',
  162 + },
  163 + {
  164 + value: 'MAJOR',
  165 + label: '重要',
  166 + },
  167 + {
  168 + value: 'MINOR',
  169 + label: '次要',
  170 + },
  171 + {
  172 + value: 'WARNING',
  173 + label: '警告',
  174 + },
  175 + {
  176 + value: 'INDETERMINATE',
  177 + label: '不确定',
  178 + },
  179 + ],
  180 + onChange: (v) => {
  181 + isWhereType.value = v ? v : 'INDETERMINATE';
177 }, 182 },
178 - ],  
179 - onChange: (v) => {  
180 - isWhereType.value = v ? v : 'INDETERMINATE';  
181 - }, 183 + };
182 }, 184 },
183 }, 185 },
184 ]; 186 ];
@@ -236,195 +238,3 @@ export const alertContactsSchemas: FormSchema[] = [ @@ -236,195 +238,3 @@ export const alertContactsSchemas: FormSchema[] = [
236 }, 238 },
237 }, 239 },
238 ]; 240 ];
239 -  
240 -/**  
241 - * 所使用的枚举值  
242 - */  
243 -  
244 -export enum TriggerEnum {  
245 - IS_DEVICE_ACT = '属性',  
246 - IS_TIME_ACT = 'TIME_SERIES',  
247 - IS_SCENE_ACT = '常量',  
248 - IS_STRING = 'STRING',  
249 - IS_NUMERIC = 'NUMERIC',  
250 - IS_BOOLEAN = 'BOOLEAN',  
251 - IS_COMPLEX = 'COMPLEX',  
252 -}  
253 -  
254 -export const isShiDu = (type: string) => {  
255 - return type === TriggerEnum.IS_DEVICE_ACT;  
256 -};  
257 -export const isWenDu = (type: string) => {  
258 - return type === TriggerEnum.IS_TIME_ACT;  
259 -};  
260 -  
261 -export const isTimeAll = (type: string) => {  
262 - return type === TriggerEnum.IS_SCENE_ACT;  
263 -};  
264 -  
265 -export const isString = (type: string) => {  
266 - return type === TriggerEnum.IS_STRING;  
267 -};  
268 -  
269 -export const isNumeric = (type: string) => {  
270 - return type === TriggerEnum.IS_NUMERIC;  
271 -};  
272 -  
273 -export const isBoolean = (type: string) => {  
274 - return type === TriggerEnum.IS_BOOLEAN;  
275 -};  
276 -  
277 -export const isComplex = (type: string) => {  
278 - return type === TriggerEnum.IS_COMPLEX;  
279 -};  
280 -  
281 -export const echoFormSchema: FormSchema[] = [  
282 - {  
283 - field: 'type',  
284 - label: '键类型',  
285 - colProps: { span: 24 },  
286 - component: 'Select',  
287 - componentProps: {  
288 - placeholder: '请选择键类型',  
289 - options: [  
290 - { label: '属性', value: '属性' },  
291 - { label: 'Timeseries', value: 'TIME_SERIES' },  
292 - { label: '常量', value: '常量' },  
293 - ],  
294 - },  
295 - },  
296 - {  
297 - field: 'key',  
298 - label: '键名',  
299 - colProps: { span: 24 },  
300 - component: 'Select',  
301 - componentProps: {  
302 - placeholder: '请选择键名',  
303 - options: [  
304 - { label: 'active', value: 'active' },  
305 - { label: 'inactivityAlarmTime', value: 'inactivityAlarmTime' },  
306 - { label: 'lastActivityTime', value: 'lastActivityTime' },  
307 - { label: 'lastConnectTime', value: 'lastConnectTime' },  
308 - { label: 'lastDisconnectTime', value: 'lastDisconnectTime' },  
309 - ],  
310 - },  
311 - ifShow: ({ values }) => isShiDu(Reflect.get(values, 'type')),  
312 - },  
313 - {  
314 - field: 'key',  
315 - label: '键名',  
316 - colProps: { span: 24 },  
317 - component: 'Select',  
318 - componentProps: {  
319 - placeholder: '请选择键名',  
320 - options: [  
321 - { label: 'CO2', value: 'CO2' },  
322 - { label: 'temp', value: 'temp' },  
323 - { label: 'wet', value: 'wet' },  
324 - ],  
325 - },  
326 - ifShow: ({ values }) => isWenDu(Reflect.get(values, 'type')),  
327 - },  
328 - {  
329 - field: 'key',  
330 - label: '键名',  
331 - colProps: { span: 24 },  
332 - component: 'Input',  
333 - componentProps: {  
334 - placeholder: '请输入键名',  
335 - },  
336 - ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'type')),  
337 - },  
338 - {  
339 - field: 'type1',  
340 - label: '值类型',  
341 - colProps: { span: 24 },  
342 - component: 'Select',  
343 - componentProps: {  
344 - placeholder: '请选择值类型',  
345 - options: [  
346 - { label: '字符串', value: 'STRING' },  
347 - { label: '数字', value: 'NUMERIC' },  
348 - { label: '布尔值', value: 'BOOLEAN' },  
349 - { label: '日期时间', value: 'COMPLEX' },  
350 - ],  
351 - },  
352 - },  
353 - {  
354 - field: 'operation',  
355 - label: '操作',  
356 - colProps: { span: 24 },  
357 - component: 'Select',  
358 - componentProps: {  
359 - placeholder: '请选择操作',  
360 - options: [  
361 - { label: '等于', value: 'EQUAL' },  
362 - { label: '不等于', value: 'NOT_EQUAL' },  
363 - { label: '开始于', value: 'STARTS_WITH' },  
364 - { label: '结束于', value: 'ENDS_WITH' },  
365 - { label: '包含', value: 'CONTAINS' },  
366 - { label: '不包含', value: 'NOT_CONTAINS' },  
367 - ],  
368 - },  
369 - ifShow: ({ values }) => isString(Reflect.get(values, 'type1')),  
370 - },  
371 - {  
372 - field: 'operation',  
373 - label: '操作',  
374 - colProps: { span: 24 },  
375 - component: 'Select',  
376 - componentProps: {  
377 - placeholder: '请选择操作',  
378 - options: [  
379 - { label: '等于', value: 'EQUAL' },  
380 - { label: '不等于', value: 'NOT_EQUAL' },  
381 - { label: '大于', value: 'GREATER' },  
382 - { label: '小于', value: 'LESS' },  
383 - { label: '大于或等于', value: 'GREATER_OR_EQUAL' },  
384 - { label: '小于或等于', value: 'LESS_OR_EQUAL' },  
385 - ],  
386 - },  
387 - ifShow: ({ values }) => isNumeric(Reflect.get(values, 'type1')),  
388 - },  
389 - {  
390 - field: 'operation',  
391 - label: '操作',  
392 - colProps: { span: 24 },  
393 - component: 'Select',  
394 - componentProps: {  
395 - placeholder: '请选择操作',  
396 - options: [  
397 - { label: '等于', value: 'EQUAL' },  
398 - { label: '不等于', value: 'NOT_EQUAL' },  
399 - ],  
400 - },  
401 - ifShow: ({ values }) => isBoolean(Reflect.get(values, 'type1')),  
402 - },  
403 - {  
404 - field: 'operation',  
405 - label: '操作',  
406 - colProps: { span: 24 },  
407 - component: 'Select',  
408 - componentProps: {  
409 - placeholder: '请选择操作',  
410 - options: [  
411 - { label: '等于', value: 'EQUAL' },  
412 - { label: '不等于', value: 'NOT_EQUAL' },  
413 - { label: '大于', value: 'GREATER' },  
414 - { label: '小于', value: 'LESS' },  
415 - { label: '大于或等于', value: 'GREATER_OR_EQUAL' },  
416 - { label: '小于或等于', value: 'LESS_OR_EQUAL' },  
417 - ],  
418 - },  
419 - ifShow: ({ values }) => isComplex(Reflect.get(values, 'type1')),  
420 - },  
421 - {  
422 - field: 'value1',  
423 - label: '默认值',  
424 - colProps: { span: 24 },  
425 - component: 'Input',  
426 - componentProps: {  
427 - placeholder: '请输入默认值(数字)',  
428 - },  
429 - },  
430 -];  
@@ -133,7 +133,7 @@ @@ -133,7 +133,7 @@
133 title: t('sys.api.loginFailed'), 133 title: t('sys.api.loginFailed'),
134 content: 134 content:
135 error.response && error.response.status == 401 135 error.response && error.response.status == 401
136 - ? t('sys.api.passwordOrUserNameError') 136 + ? error.response.data.message
137 : error.code == 'ECONNABORTED' 137 : error.code == 'ECONNABORTED'
138 ? t('sys.api.timeoutMessage') 138 ? t('sys.api.timeoutMessage')
139 : t('sys.api.apiRequestFailed'), 139 : t('sys.api.apiRequestFailed'),