Commit ac80c5f45fd9cf25f397bf6ef379c5491394af40
Merge branch 'feat/account-role-manage' of http://git.yunteng.com/yunteng/things…
…kit-front into feat/account-role-manage
Showing
5 changed files
with
39 additions
and
23 deletions
@@ -8,22 +8,26 @@ | @@ -8,22 +8,26 @@ | ||
8 | '清除未确认: 只可处理,已经清除', | 8 | '清除未确认: 只可处理,已经清除', |
9 | '清除已确认: 不需要做处理和清除', | 9 | '清除已确认: 不需要做处理和清除', |
10 | ] --> | 10 | ] --> |
11 | - <a-button | ||
12 | - type="primary" | ||
13 | - class="mr-4" | ||
14 | - @click="handleAlarm" | ||
15 | - v-if="alarmStatus !== AlarmStatus.ACTIVE_ACK && alarmStatus !== AlarmStatus.CLEARED_ACK" | ||
16 | - > | ||
17 | - 处理 | ||
18 | - </a-button> | ||
19 | - <a-button | ||
20 | - danger | ||
21 | - type="primary" | ||
22 | - @click="clearAlarm" | ||
23 | - v-if="alarmStatus === AlarmStatus.ACTIVE_ACK" | ||
24 | - > | ||
25 | - 清除 | ||
26 | - </a-button> | 11 | + <Authority value="api:yt:alarm:single:handle"> |
12 | + <a-button | ||
13 | + type="primary" | ||
14 | + class="mr-4" | ||
15 | + @click="handleAlarm" | ||
16 | + v-if="alarmStatus !== AlarmStatus.ACTIVE_ACK && alarmStatus !== AlarmStatus.CLEARED_ACK" | ||
17 | + > | ||
18 | + 处理 | ||
19 | + </a-button> | ||
20 | + </Authority> | ||
21 | + <Authority value="api:yt:alarm:single:clear"> | ||
22 | + <a-button | ||
23 | + danger | ||
24 | + type="primary" | ||
25 | + @click="clearAlarm" | ||
26 | + v-if="alarmStatus === AlarmStatus.ACTIVE_ACK" | ||
27 | + > | ||
28 | + 清除 | ||
29 | + </a-button> | ||
30 | + </Authority> | ||
27 | </div> | 31 | </div> |
28 | </BasicDrawer> | 32 | </BasicDrawer> |
29 | </template> | 33 | </template> |
@@ -36,11 +40,13 @@ | @@ -36,11 +40,13 @@ | ||
36 | import { alarmLevel, statusType } from '/@/views/device/list/config/detail.config'; | 40 | import { alarmLevel, statusType } from '/@/views/device/list/config/detail.config'; |
37 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; | 41 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; |
38 | import { AlarmStatus } from '/@/enums/alarmEnum'; | 42 | import { AlarmStatus } from '/@/enums/alarmEnum'; |
43 | + import { Authority } from '/@/components/Authority'; | ||
39 | export default defineComponent({ | 44 | export default defineComponent({ |
40 | name: 'AlarmDetailDrawer', | 45 | name: 'AlarmDetailDrawer', |
41 | components: { | 46 | components: { |
42 | BasicForm, | 47 | BasicForm, |
43 | BasicDrawer, | 48 | BasicDrawer, |
49 | + Authority, | ||
44 | }, | 50 | }, |
45 | emits: ['success', 'register'], | 51 | emits: ['success', 'register'], |
46 | setup(_, { emit }) { | 52 | setup(_, { emit }) { |
@@ -19,12 +19,16 @@ | @@ -19,12 +19,16 @@ | ||
19 | </Button> | 19 | </Button> |
20 | </template> | 20 | </template> |
21 | <template #toolbar> | 21 | <template #toolbar> |
22 | - <Button @click="handleBatchClear" type="primary" :disabled="getCanBatchClear"> | ||
23 | - <span>批量清除</span> | ||
24 | - </Button> | ||
25 | - <Button @click="handleBatchAck" type="primary" :disabled="getCanBatchAck"> | ||
26 | - <span>批量处理</span> | ||
27 | - </Button> | 22 | + <Authority value=" api:yt:alarm:batch:clear"> |
23 | + <Button @click="handleBatchClear" type="primary" :disabled="getCanBatchClear"> | ||
24 | + <span>批量清除</span> | ||
25 | + </Button> | ||
26 | + </Authority> | ||
27 | + <Authority value="api:yt:alarm:batch:handle"> | ||
28 | + <Button @click="handleBatchAck" type="primary" :disabled="getCanBatchAck"> | ||
29 | + <span>批量处理</span> | ||
30 | + </Button> | ||
31 | + </Authority> | ||
28 | </template> | 32 | </template> |
29 | </BasicTable> | 33 | </BasicTable> |
30 | <AlarmDetailDrawer @register="registerDetailDrawer" @success="handleSuccess" /> | 34 | <AlarmDetailDrawer @register="registerDetailDrawer" @success="handleSuccess" /> |
@@ -49,6 +53,7 @@ | @@ -49,6 +53,7 @@ | ||
49 | import { AlarmLogItem } from '/@/api/device/model/deviceConfigModel'; | 53 | import { AlarmLogItem } from '/@/api/device/model/deviceConfigModel'; |
50 | import { AlarmStatus } from '/@/enums/alarmEnum'; | 54 | import { AlarmStatus } from '/@/enums/alarmEnum'; |
51 | import { useMessage } from '/@/hooks/web/useMessage'; | 55 | import { useMessage } from '/@/hooks/web/useMessage'; |
56 | + import { Authority } from '/@/components/Authority'; | ||
52 | 57 | ||
53 | const props = defineProps<{ | 58 | const props = defineProps<{ |
54 | deviceId?: string; | 59 | deviceId?: string; |
@@ -181,6 +181,7 @@ export const accountFormSchema: FormSchema[] = [ | @@ -181,6 +181,7 @@ export const accountFormSchema: FormSchema[] = [ | ||
181 | componentProps({ formActionType }) { | 181 | componentProps({ formActionType }) { |
182 | const { clearValidate } = formActionType; | 182 | const { clearValidate } = formActionType; |
183 | return { | 183 | return { |
184 | + maxlength: 11, | ||
184 | onChange(value) { | 185 | onChange(value) { |
185 | if (value == olderPhoneNumber) { | 186 | if (value == olderPhoneNumber) { |
186 | clearValidate('phoneNumber'); | 187 | clearValidate('phoneNumber'); |
@@ -260,8 +260,11 @@ | @@ -260,8 +260,11 @@ | ||
260 | async function handleSubmit() { | 260 | async function handleSubmit() { |
261 | setModalProps({ confirmLoading: true }); | 261 | setModalProps({ confirmLoading: true }); |
262 | try { | 262 | try { |
263 | - await validate(); | ||
264 | const values = getFieldsValue(); | 263 | const values = getFieldsValue(); |
264 | + if (!('organizationIds' in values)) { | ||
265 | + createMessage.error('组织必选'); | ||
266 | + } | ||
267 | + await validate(); | ||
265 | await addTenantList({ ...values, level: 4, tenantId: userInfo.getUserInfo.tenantId! }); | 268 | await addTenantList({ ...values, level: 4, tenantId: userInfo.getUserInfo.tenantId! }); |
266 | createMessage.success(unref(isAdd) ? '新增成功' : '编辑成功'); | 269 | createMessage.success(unref(isAdd) ? '新增成功' : '编辑成功'); |
267 | closeModal(); | 270 | closeModal(); |
@@ -162,6 +162,7 @@ export const accountFormSchema: FormSchema[] = [ | @@ -162,6 +162,7 @@ export const accountFormSchema: FormSchema[] = [ | ||
162 | componentProps({ formActionType }) { | 162 | componentProps({ formActionType }) { |
163 | const { clearValidate } = formActionType; | 163 | const { clearValidate } = formActionType; |
164 | return { | 164 | return { |
165 | + maxlength: 11, | ||
165 | onChange(value) { | 166 | onChange(value) { |
166 | if (value == olderPhoneNumber) { | 167 | if (value == olderPhoneNumber) { |
167 | clearValidate('phoneNumber'); | 168 | clearValidate('phoneNumber'); |