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 | 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 | 31 | </div> |
| 28 | 32 | </BasicDrawer> |
| 29 | 33 | </template> |
| ... | ... | @@ -36,11 +40,13 @@ |
| 36 | 40 | import { alarmLevel, statusType } from '/@/views/device/list/config/detail.config'; |
| 37 | 41 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; |
| 38 | 42 | import { AlarmStatus } from '/@/enums/alarmEnum'; |
| 43 | + import { Authority } from '/@/components/Authority'; | |
| 39 | 44 | export default defineComponent({ |
| 40 | 45 | name: 'AlarmDetailDrawer', |
| 41 | 46 | components: { |
| 42 | 47 | BasicForm, |
| 43 | 48 | BasicDrawer, |
| 49 | + Authority, | |
| 44 | 50 | }, |
| 45 | 51 | emits: ['success', 'register'], |
| 46 | 52 | setup(_, { emit }) { | ... | ... |
| ... | ... | @@ -19,12 +19,16 @@ |
| 19 | 19 | </Button> |
| 20 | 20 | </template> |
| 21 | 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 | 32 | </template> |
| 29 | 33 | </BasicTable> |
| 30 | 34 | <AlarmDetailDrawer @register="registerDetailDrawer" @success="handleSuccess" /> |
| ... | ... | @@ -49,6 +53,7 @@ |
| 49 | 53 | import { AlarmLogItem } from '/@/api/device/model/deviceConfigModel'; |
| 50 | 54 | import { AlarmStatus } from '/@/enums/alarmEnum'; |
| 51 | 55 | import { useMessage } from '/@/hooks/web/useMessage'; |
| 56 | + import { Authority } from '/@/components/Authority'; | |
| 52 | 57 | |
| 53 | 58 | const props = defineProps<{ |
| 54 | 59 | deviceId?: string; | ... | ... |
| ... | ... | @@ -181,6 +181,7 @@ export const accountFormSchema: FormSchema[] = [ |
| 181 | 181 | componentProps({ formActionType }) { |
| 182 | 182 | const { clearValidate } = formActionType; |
| 183 | 183 | return { |
| 184 | + maxlength: 11, | |
| 184 | 185 | onChange(value) { |
| 185 | 186 | if (value == olderPhoneNumber) { |
| 186 | 187 | clearValidate('phoneNumber'); | ... | ... |
| ... | ... | @@ -260,8 +260,11 @@ |
| 260 | 260 | async function handleSubmit() { |
| 261 | 261 | setModalProps({ confirmLoading: true }); |
| 262 | 262 | try { |
| 263 | - await validate(); | |
| 264 | 263 | const values = getFieldsValue(); |
| 264 | + if (!('organizationIds' in values)) { | |
| 265 | + createMessage.error('组织必选'); | |
| 266 | + } | |
| 267 | + await validate(); | |
| 265 | 268 | await addTenantList({ ...values, level: 4, tenantId: userInfo.getUserInfo.tenantId! }); |
| 266 | 269 | createMessage.success(unref(isAdd) ? '新增成功' : '编辑成功'); |
| 267 | 270 | closeModal(); | ... | ... |
| ... | ... | @@ -162,6 +162,7 @@ export const accountFormSchema: FormSchema[] = [ |
| 162 | 162 | componentProps({ formActionType }) { |
| 163 | 163 | const { clearValidate } = formActionType; |
| 164 | 164 | return { |
| 165 | + maxlength: 11, | |
| 165 | 166 | onChange(value) { |
| 166 | 167 | if (value == olderPhoneNumber) { |
| 167 | 168 | clearValidate('phoneNumber'); | ... | ... |