Commit e6d4b04ca1e8a09b5964b982c487e54aa77183ba

Authored by ww
1 parent 7f314a80

feat: device list manage device certificate add refresh client id

... ... @@ -619,6 +619,7 @@ export const TokenSchemas: FormSchema[] = [
619 619 field: 'clientId',
620 620 required: true,
621 621 ifShow: false,
  622 + slot: 'clientId',
622 623 componentProps: {
623 624 maxLength: 36,
624 625 placeholder: '请输入客户端ID',
... ...
... ... @@ -8,7 +8,14 @@
8 8 centered
9 9 :canFullscreen="false"
10 10 >
11   - <BasicForm @register="registerForm" />
  11 + <BasicForm @register="registerForm">
  12 + <template #clientId="{ field, model }">
  13 + <div class="flex items-center">
  14 + <Input v-model:value="model[field]" placeholder="请输入客户端ID" />
  15 + <ReloadOutlined class="ml-3 !text-blue-600" @click="handleCreateUUID" />
  16 + </div>
  17 + </template>
  18 + </BasicForm>
12 19 </BasicModal>
13 20 </template>
14 21
... ... @@ -19,10 +26,15 @@
19 26 import { TokenSchemas, credentialTypeEnum } from '../../config/data';
20 27 import { saveDeviceToken } from '/@/api/device/deviceManager';
21 28 import { useMessage } from '/@/hooks/web/useMessage';
  29 + import { Input } from 'ant-design-vue';
  30 + import { buildUUID } from '/@/utils/uuid';
  31 + import { ReloadOutlined } from '@ant-design/icons-vue';
22 32 export default defineComponent({
23 33 components: {
24 34 BasicModal,
25 35 BasicForm,
  36 + Input,
  37 + ReloadOutlined,
26 38 },
27 39 emits: ['register'],
28 40 setup() {
... ... @@ -36,7 +48,7 @@
36 48 showSubmitButton: false,
37 49 showResetButton: false,
38 50 wrapperCol: {
39   - span: 12,
  51 + span: 16,
40 52 },
41 53 });
42 54 const [registerModal, { closeModal }] = useModalInner(async (data) => {
... ... @@ -208,12 +220,17 @@
208 220 })
209 221 .catch(() => {});
210 222 };
  223 +
  224 + const handleCreateUUID = () => {
  225 + setFieldsValue({ clientId: buildUUID() });
  226 + };
211 227 return {
212 228 registerModal,
213 229 registerForm,
214 230 checkedChange,
215 231 handleCancel,
216 232 handleOk,
  233 + handleCreateUUID,
217 234 };
218 235 },
219 236 });
... ...