Showing
3 changed files
with
21 additions
and
1 deletions
@@ -9,6 +9,7 @@ export interface ConfigurationCenterItemsModal { | @@ -9,6 +9,7 @@ export interface ConfigurationCenterItemsModal { | ||
9 | publicId?: string; | 9 | publicId?: string; |
10 | organizationId?: string; | 10 | organizationId?: string; |
11 | platform?: string; | 11 | platform?: string; |
12 | + productIds?: string; | ||
12 | } | 13 | } |
13 | export type queryPageParams = BasicPageParams & { | 14 | export type queryPageParams = BasicPageParams & { |
14 | name?: Nullable<string>; | 15 | name?: Nullable<string>; |
@@ -4,6 +4,7 @@ import { createImgPreview } from '/@/components/Preview'; | @@ -4,6 +4,7 @@ import { createImgPreview } from '/@/components/Preview'; | ||
4 | import { uploadThumbnail } from '/@/api/configuration/center/configurationCenter'; | 4 | import { uploadThumbnail } from '/@/api/configuration/center/configurationCenter'; |
5 | import { useComponentRegister } from '/@/components/Form'; | 5 | import { useComponentRegister } from '/@/components/Form'; |
6 | import { OrgTreeSelect } from '../../common/OrgTreeSelect'; | 6 | import { OrgTreeSelect } from '../../common/OrgTreeSelect'; |
7 | +import { getDeviceProfile } from '/@/api/alarm/position'; | ||
7 | 8 | ||
8 | useComponentRegister('OrgTreeSelect', OrgTreeSelect); | 9 | useComponentRegister('OrgTreeSelect', OrgTreeSelect); |
9 | export enum Platform { | 10 | export enum Platform { |
@@ -136,6 +137,24 @@ export const formSchema: FormSchema[] = [ | @@ -136,6 +137,24 @@ export const formSchema: FormSchema[] = [ | ||
136 | component: 'OrgTreeSelect', | 137 | component: 'OrgTreeSelect', |
137 | }, | 138 | }, |
138 | { | 139 | { |
140 | + field: 'isTemplate', | ||
141 | + label: '模版', | ||
142 | + component: 'Switch', | ||
143 | + defaultValue: 0, | ||
144 | + }, | ||
145 | + { | ||
146 | + field: 'productIds', | ||
147 | + label: '产品', | ||
148 | + component: 'ApiSelect', | ||
149 | + required: true, | ||
150 | + componentProps: { | ||
151 | + api: getDeviceProfile, | ||
152 | + mode: 'multiple', | ||
153 | + labelField: 'name', | ||
154 | + valueField: 'tbProfileId', | ||
155 | + }, | ||
156 | + }, | ||
157 | + { | ||
139 | field: 'platform', | 158 | field: 'platform', |
140 | label: '平台', | 159 | label: '平台', |
141 | required: true, | 160 | required: true, |
@@ -3,11 +3,11 @@ const getRandomString = () => Number(Math.random().toString().substring(2)).toSt | @@ -3,11 +3,11 @@ const getRandomString = () => Number(Math.random().toString().substring(2)).toSt | ||
3 | export const encode = (record: Recordable) => { | 3 | export const encode = (record: Recordable) => { |
4 | let hash = JSON.stringify(record); | 4 | let hash = JSON.stringify(record); |
5 | const mixinString = getRandomString() | 5 | const mixinString = getRandomString() |
6 | + .slice(0, 10) | ||
6 | .padEnd(10, getRandomString()) | 7 | .padEnd(10, getRandomString()) |
7 | .split('') | 8 | .split('') |
8 | .map((item) => (Math.random() > 0.5 ? item.toUpperCase() : item)) | 9 | .map((item) => (Math.random() > 0.5 ? item.toUpperCase() : item)) |
9 | .join(''); | 10 | .join(''); |
10 | - | ||
11 | hash = window.btoa(hash); | 11 | hash = window.btoa(hash); |
12 | hash = hash.substring(0, 6) + mixinString + hash.substring(6); | 12 | hash = hash.substring(0, 6) + mixinString + hash.substring(6); |
13 | hash = window.btoa(hash); | 13 | hash = window.btoa(hash); |