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