Commit 3d766336d2526005f505a189c35fdf9c65d1cd43

Authored by ww
1 parent 5db2f698

perf: 优化组态跳转参数加解密,新增组态创建字段

... ... @@ -9,6 +9,7 @@ export interface ConfigurationCenterItemsModal {
9 9 publicId?: string;
10 10 organizationId?: string;
11 11 platform?: string;
  12 + productIds?: string;
12 13 }
13 14 export type queryPageParams = BasicPageParams & {
14 15 name?: Nullable<string>;
... ...
... ... @@ -4,6 +4,7 @@ import { createImgPreview } from '/@/components/Preview';
4 4 import { uploadThumbnail } from '/@/api/configuration/center/configurationCenter';
5 5 import { useComponentRegister } from '/@/components/Form';
6 6 import { OrgTreeSelect } from '../../common/OrgTreeSelect';
  7 +import { getDeviceProfile } from '/@/api/alarm/position';
7 8
8 9 useComponentRegister('OrgTreeSelect', OrgTreeSelect);
9 10 export enum Platform {
... ... @@ -136,6 +137,24 @@ export const formSchema: FormSchema[] = [
136 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 158 field: 'platform',
140 159 label: '平台',
141 160 required: true,
... ...
... ... @@ -3,11 +3,11 @@ const getRandomString = () => Number(Math.random().toString().substring(2)).toSt
3 3 export const encode = (record: Recordable) => {
4 4 let hash = JSON.stringify(record);
5 5 const mixinString = getRandomString()
  6 + .slice(0, 10)
6 7 .padEnd(10, getRandomString())
7 8 .split('')
8 9 .map((item) => (Math.random() > 0.5 ? item.toUpperCase() : item))
9 10 .join('');
10   -
11 11 hash = window.btoa(hash);
12 12 hash = hash.substring(0, 6) + mixinString + hash.substring(6);
13 13 hash = window.btoa(hash);
... ...