Showing
15 changed files
with
164 additions
and
55 deletions
| ... | ... | @@ -25,11 +25,28 @@ |
| 25 | 25 | </div> |
| 26 | 26 | </Upload> |
| 27 | 27 | </template> |
| 28 | + <template #videoPlatformIdSlot="{ model, field }"> | |
| 29 | + <a-select | |
| 30 | + placeholder="请选择流媒体配置" | |
| 31 | + v-model:value="model[field]" | |
| 32 | + :options="streamConfigOptions.map((item) => ({ value: item.value, label: item.label }))" | |
| 33 | + > | |
| 34 | + <template #dropdownRender="{ menuNode: menu }"> | |
| 35 | + <v-nodes :vnodes="menu" /> | |
| 36 | + <a-divider style="margin: 4px 0" /> | |
| 37 | + <div @click="handleOpenStreamConfig" style="padding: 4px 8px; cursor: pointer"> | |
| 38 | + <plus-outlined /> | |
| 39 | + 新增流媒体配置 | |
| 40 | + </div> | |
| 41 | + </template> | |
| 42 | + </a-select> | |
| 43 | + </template> | |
| 28 | 44 | </BasicForm> |
| 29 | 45 | </BasicDrawer> |
| 46 | + <SteramingDrawer @register="registerSteramingDrawer" @success="handleSuccess" /> | |
| 30 | 47 | </template> |
| 31 | 48 | <script lang="ts"> |
| 32 | - import { defineComponent, ref, computed, unref, nextTick } from 'vue'; | |
| 49 | + import { defineComponent, ref, computed, unref, nextTick, onMounted } from 'vue'; | |
| 33 | 50 | import { BasicForm, useForm } from '/@/components/Form'; |
| 34 | 51 | import { formSchema } from './config.data'; |
| 35 | 52 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; |
| ... | ... | @@ -39,14 +56,27 @@ |
| 39 | 56 | import { PlusOutlined, LoadingOutlined } from '@ant-design/icons-vue'; |
| 40 | 57 | import { upload } from '/@/api/oss/ossFileUploader'; |
| 41 | 58 | import { FileItem } from '/@/components/Upload/src/typing'; |
| 59 | + import { getStreamingMediaList } from '/@/api/camera/cameraManager'; | |
| 60 | + import SteramingDrawer from '../streaming/SteramingDrawer.vue'; | |
| 61 | + import { useDrawer } from '/@/components/Drawer'; | |
| 42 | 62 | |
| 43 | 63 | export default defineComponent({ |
| 44 | 64 | name: 'ContactDrawer', |
| 45 | - components: { BasicDrawer, BasicForm, Upload, PlusOutlined, LoadingOutlined }, | |
| 65 | + components: { | |
| 66 | + BasicDrawer, | |
| 67 | + BasicForm, | |
| 68 | + Upload, | |
| 69 | + PlusOutlined, | |
| 70 | + LoadingOutlined, | |
| 71 | + SteramingDrawer, | |
| 72 | + VNodes: (_, { attrs }) => { | |
| 73 | + return attrs.vnodes; | |
| 74 | + }, | |
| 75 | + }, | |
| 46 | 76 | emits: ['success', 'register'], |
| 47 | 77 | setup(_, { emit }) { |
| 48 | 78 | const loading = ref(false); |
| 49 | - | |
| 79 | + const streamConfigOptions: any = ref([]); | |
| 50 | 80 | const isUpdate = ref(true); |
| 51 | 81 | const editId = ref(''); |
| 52 | 82 | const [registerForm, { validate, setFieldsValue, resetFields }] = useForm({ |
| ... | ... | @@ -54,7 +84,32 @@ |
| 54 | 84 | schemas: formSchema, |
| 55 | 85 | showActionButtonGroup: false, |
| 56 | 86 | }); |
| 87 | + onMounted(async () => { | |
| 88 | + const res = await getStreamingMediaList({}); | |
| 89 | + streamConfigOptions.value = res.map((m) => { | |
| 90 | + return { | |
| 91 | + label: m.host, | |
| 92 | + value: m.id, | |
| 93 | + }; | |
| 94 | + }); | |
| 95 | + }); | |
| 96 | + const [registerSteramingDrawer, { openDrawer }] = useDrawer(); | |
| 57 | 97 | |
| 98 | + const handleOpenStreamConfig = () => { | |
| 99 | + openDrawer(true, { | |
| 100 | + createFlag: true, | |
| 101 | + }); | |
| 102 | + }; | |
| 103 | + async function handleSuccess() { | |
| 104 | + const res = await getStreamingMediaList({}); | |
| 105 | + if (res) { | |
| 106 | + streamConfigOptions.value = res.map((m) => { | |
| 107 | + return { label: m.host, value: m.id }; | |
| 108 | + }); | |
| 109 | + } else { | |
| 110 | + streamConfigOptions.value = []; | |
| 111 | + } | |
| 112 | + } | |
| 58 | 113 | const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { |
| 59 | 114 | await resetFields(); |
| 60 | 115 | setDrawerProps({ confirmLoading: false }); |
| ... | ... | @@ -136,6 +191,10 @@ |
| 136 | 191 | beforeUpload, |
| 137 | 192 | tenantLogo, |
| 138 | 193 | loading, |
| 194 | + streamConfigOptions, | |
| 195 | + registerSteramingDrawer, | |
| 196 | + handleOpenStreamConfig, | |
| 197 | + handleSuccess, | |
| 139 | 198 | }; |
| 140 | 199 | }, |
| 141 | 200 | }); | ... | ... |
| ... | ... | @@ -4,7 +4,6 @@ import { copyTransFun } from '/@/utils/fnUtils'; |
| 4 | 4 | import type { FormSchema as QFormSchema } from '/@/components/Form/index'; |
| 5 | 5 | |
| 6 | 6 | import { CameraVideoUrl, CameraMaxLength, MediaTypeValidate } from '/@/utils/rules'; |
| 7 | -import { getStreamingMediaList } from '/@/api/camera/cameraManager'; | |
| 8 | 7 | import { h } from 'vue'; |
| 9 | 8 | import SnHelpMessage from './SnHelpMessage.vue'; |
| 10 | 9 | export enum AccessMode { |
| ... | ... | @@ -154,6 +153,7 @@ export const formSchema: QFormSchema[] = [ |
| 154 | 153 | return values.accessMode === AccessMode.ManuallyEnter; |
| 155 | 154 | }, |
| 156 | 155 | componentProps: { |
| 156 | + maxLength: 36, | |
| 157 | 157 | placeholder: '请输入视频厂家', |
| 158 | 158 | }, |
| 159 | 159 | }, |
| ... | ... | @@ -167,6 +167,7 @@ export const formSchema: QFormSchema[] = [ |
| 167 | 167 | return values.accessMode === AccessMode.ManuallyEnter; |
| 168 | 168 | }, |
| 169 | 169 | componentProps: { |
| 170 | + maxLength: 36, | |
| 170 | 171 | placeholder: '请输入摄像头编号', |
| 171 | 172 | }, |
| 172 | 173 | }, |
| ... | ... | @@ -188,15 +189,13 @@ export const formSchema: QFormSchema[] = [ |
| 188 | 189 | { |
| 189 | 190 | field: 'videoPlatformId', |
| 190 | 191 | label: '流媒体配置', |
| 191 | - component: 'ApiSelect', | |
| 192 | + component: 'Select', | |
| 192 | 193 | ifShow({ values }) { |
| 193 | 194 | return values.accessMode === AccessMode.Streaming; |
| 194 | 195 | }, |
| 196 | + slot: 'videoPlatformIdSlot', | |
| 195 | 197 | componentProps: { |
| 196 | 198 | placeholder: '请选择流媒体配置', |
| 197 | - api: getStreamingMediaList, | |
| 198 | - labelField: 'host', | |
| 199 | - valueField: 'id', | |
| 200 | 199 | }, |
| 201 | 200 | }, |
| 202 | 201 | { | ... | ... |
| ... | ... | @@ -9,7 +9,7 @@ |
| 9 | 9 | import { useMessage } from '/@/hooks/web/useMessage'; |
| 10 | 10 | import { PlayProtocol } from '../manage/config.data'; |
| 11 | 11 | |
| 12 | - const emit = defineEmits(['success','register']); | |
| 12 | + const emit = defineEmits(['success', 'register']); | |
| 13 | 13 | |
| 14 | 14 | const createFlag = ref(false); |
| 15 | 15 | |
| ... | ... | @@ -23,7 +23,7 @@ |
| 23 | 23 | showActionButtonGroup: false, |
| 24 | 24 | }); |
| 25 | 25 | |
| 26 | - const [registerDrawer, { setDrawerProps }] = useDrawerInner((data: DrawerParams) => { | |
| 26 | + const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner((data: DrawerParams) => { | |
| 27 | 27 | createFlag.value = data.createFlag; |
| 28 | 28 | if (!unref(createFlag)) { |
| 29 | 29 | id = data.record!.id; |
| ... | ... | @@ -48,6 +48,7 @@ |
| 48 | 48 | const { createMessage } = useMessage(); |
| 49 | 49 | createMessage.success(message); |
| 50 | 50 | emit('success'); |
| 51 | + closeDrawer(); | |
| 51 | 52 | } catch (e) { |
| 52 | 53 | } finally { |
| 53 | 54 | setDrawerProps({ | ... | ... |
| ... | ... | @@ -101,6 +101,7 @@ export const formDetailSchema: FormSchema[] = [ |
| 101 | 101 | helpMessage: ['平台IP + 端口'], |
| 102 | 102 | rules: [{ required: true, message: '平台地址为必填项' }], |
| 103 | 103 | componentProps: { |
| 104 | + maxLength: 36, | |
| 104 | 105 | placeholder: '请输入平台地址', |
| 105 | 106 | }, |
| 106 | 107 | }, |
| ... | ... | @@ -110,6 +111,7 @@ export const formDetailSchema: FormSchema[] = [ |
| 110 | 111 | component: 'Input', |
| 111 | 112 | rules: [{ required: true, message: '用户Key为必填项' }], |
| 112 | 113 | componentProps: { |
| 114 | + maxLength: 36, | |
| 113 | 115 | placeholder: '请输入用户Key', |
| 114 | 116 | }, |
| 115 | 117 | }, |
| ... | ... | @@ -122,6 +124,7 @@ export const formDetailSchema: FormSchema[] = [ |
| 122 | 124 | { required: true, min: 20, message: '用户密钥不能少于20位字符' }, |
| 123 | 125 | ], |
| 124 | 126 | componentProps: { |
| 127 | + maxLength: 36, | |
| 125 | 128 | placeholder: '请输入用户密钥', |
| 126 | 129 | }, |
| 127 | 130 | }, | ... | ... |
| ... | ... | @@ -135,12 +135,10 @@ export const step1Schemas: FormSchema[] = [ |
| 135 | 135 | required: true, |
| 136 | 136 | component: 'Input', |
| 137 | 137 | colProps: { span: 14 }, |
| 138 | - componentProps() { | |
| 139 | - return { | |
| 140 | - disabled: false, | |
| 141 | - ength: 255, | |
| 142 | - placeholder: '请输入产品名称', | |
| 143 | - }; | |
| 138 | + componentProps: { | |
| 139 | + disabled: false, | |
| 140 | + maxLength: 63, | |
| 141 | + placeholder: '请输入产品名称', | |
| 144 | 142 | }, |
| 145 | 143 | }, |
| 146 | 144 | { | ... | ... |
| ... | ... | @@ -87,7 +87,7 @@ export const formSchema: FormSchema[] = [ |
| 87 | 87 | component: 'Input', |
| 88 | 88 | componentProps: { |
| 89 | 89 | placeholder: '请输入标题', |
| 90 | - maxLength: 200, | |
| 90 | + maxLength: 36, | |
| 91 | 91 | }, |
| 92 | 92 | }, |
| 93 | 93 | { |
| ... | ... | @@ -96,6 +96,9 @@ export const formSchema: FormSchema[] = [ |
| 96 | 96 | colProps: { span: 24 }, |
| 97 | 97 | label: '通知内容', |
| 98 | 98 | required: true, |
| 99 | + componentProps: { | |
| 100 | + maxLength: 255, | |
| 101 | + }, | |
| 99 | 102 | render: ({ model, field }) => { |
| 100 | 103 | return h(Tinymce, { |
| 101 | 104 | value: model[field], | ... | ... |
| ... | ... | @@ -59,6 +59,7 @@ export const formSchema: FormSchema[] = [ |
| 59 | 59 | const { setFieldsValue } = formActionType; |
| 60 | 60 | return { |
| 61 | 61 | placeholder: '请输入标题', |
| 62 | + maxLength: 36, | |
| 62 | 63 | onChange: (value: Event) => { |
| 63 | 64 | setFieldsValue({ |
| 64 | 65 | [PackageField.VERSION_TAG]: getVersionTag( |
| ... | ... | @@ -79,6 +80,7 @@ export const formSchema: FormSchema[] = [ |
| 79 | 80 | const { setFieldsValue } = formActionType; |
| 80 | 81 | return { |
| 81 | 82 | placeholder: '请输入版本', |
| 83 | + maxLength: 36, | |
| 82 | 84 | onChange: (value: Event) => { |
| 83 | 85 | setFieldsValue({ |
| 84 | 86 | [PackageField.VERSION_TAG]: getVersionTag( |
| ... | ... | @@ -97,6 +99,7 @@ export const formSchema: FormSchema[] = [ |
| 97 | 99 | helpMessage: ['自定义标签应与您设备报告的软件包版本相匹配'], |
| 98 | 100 | componentProps: () => { |
| 99 | 101 | return { |
| 102 | + maxLength: 36, | |
| 100 | 103 | placeholder: '请输入版本标签', |
| 101 | 104 | }; |
| 102 | 105 | }, |
| ... | ... | @@ -191,6 +194,7 @@ export const formSchema: FormSchema[] = [ |
| 191 | 194 | }, |
| 192 | 195 | rules: [{ required: true, message: '外部URL为必填项' }], |
| 193 | 196 | componentProps: { |
| 197 | + maxLength: 36, | |
| 194 | 198 | placeholder: '请输入外部URL', |
| 195 | 199 | }, |
| 196 | 200 | }, |
| ... | ... | @@ -238,6 +242,7 @@ export const formSchema: FormSchema[] = [ |
| 238 | 242 | }, |
| 239 | 243 | helpMessage: ['如果校验和为空,会自动生成'], |
| 240 | 244 | componentProps: { |
| 245 | + maxLength: 36, | |
| 241 | 246 | placeholder: '请输入校验和', |
| 242 | 247 | }, |
| 243 | 248 | }, |
| ... | ... | @@ -246,6 +251,7 @@ export const formSchema: FormSchema[] = [ |
| 246 | 251 | label: '描述', |
| 247 | 252 | component: 'InputTextArea', |
| 248 | 253 | componentProps: { |
| 254 | + maxLength: 255, | |
| 249 | 255 | placeholder: '请输入描述', |
| 250 | 256 | }, |
| 251 | 257 | }, | ... | ... |
| ... | ... | @@ -30,6 +30,7 @@ export enum SchemaFiled { |
| 30 | 30 | ORDER_BY = 'orderBy', |
| 31 | 31 | } |
| 32 | 32 | export const organizationId = ref(''); |
| 33 | + | |
| 33 | 34 | // 表格配置 |
| 34 | 35 | export const columns: BasicColumn[] = [ |
| 35 | 36 | { |
| ... | ... | @@ -147,7 +148,7 @@ export const formSchema: QFormSchema[] = [ |
| 147 | 148 | required: true, |
| 148 | 149 | component: 'Input', |
| 149 | 150 | componentProps: { |
| 150 | - maxLength: 255, | |
| 151 | + maxLength: 64, | |
| 151 | 152 | placeholder: '请输入报表名称', |
| 152 | 153 | }, |
| 153 | 154 | }, |
| ... | ... | @@ -185,6 +186,11 @@ export const formSchema: QFormSchema[] = [ |
| 185 | 186 | { |
| 186 | 187 | field: 'executeWay', |
| 187 | 188 | component: 'RadioGroup', |
| 189 | + helpMessage: [ | |
| 190 | + `立即执行,在创建完报表配置后,启用配置即执行。 | |
| 191 | + 定时执行,用户定义执行时间,启用后, | |
| 192 | + 在满足执行时间条件后,自动执行。`, | |
| 193 | + ], | |
| 188 | 194 | label: '执行方式', |
| 189 | 195 | colProps: { |
| 190 | 196 | span: 24, |
| ... | ... | @@ -225,6 +231,8 @@ export const formSchema: QFormSchema[] = [ |
| 225 | 231 | }); |
| 226 | 232 | } else { |
| 227 | 233 | setFieldsValue({ queryMode: QueryWay.LATEST }); |
| 234 | + setFieldsValue({ startTs: 5000 }); | |
| 235 | + setFieldsValue({ interval: 1000 }); | |
| 228 | 236 | dataCompareOpions = [{ label: '固定周期', value: QueryWay.LATEST }]; |
| 229 | 237 | updateSchema({ |
| 230 | 238 | defaultValue: QueryWay.LATEST, |
| ... | ... | @@ -313,7 +321,6 @@ export const formSchema: QFormSchema[] = [ |
| 313 | 321 | { |
| 314 | 322 | field: 'devices', |
| 315 | 323 | label: '设备', |
| 316 | - helpMessage: ['报表配置只对拥有"数值型"属性的设备才能配置'], | |
| 317 | 324 | component: 'Select', |
| 318 | 325 | slot: 'devices', |
| 319 | 326 | colProps: { span: 24 }, |
| ... | ... | @@ -437,7 +444,7 @@ export const formSchema: QFormSchema[] = [ |
| 437 | 444 | }, |
| 438 | 445 | { |
| 439 | 446 | field: SchemaFiled.START_TS, |
| 440 | - label: '时间周期', | |
| 447 | + label: '最近时间', | |
| 441 | 448 | component: 'Select', |
| 442 | 449 | required: true, |
| 443 | 450 | ifShow({ values }) { |
| ... | ... | @@ -447,7 +454,7 @@ export const formSchema: QFormSchema[] = [ |
| 447 | 454 | const { setFieldsValue } = formActionType; |
| 448 | 455 | return { |
| 449 | 456 | defaultValue: 1000, |
| 450 | - placeholder: '请选择时间周期', | |
| 457 | + placeholder: '请选择近期时间', | |
| 451 | 458 | options: intervalOption, |
| 452 | 459 | onChange() { |
| 453 | 460 | setFieldsValue({ [SchemaFiled.INTERVAL]: null }); | ... | ... |
| ... | ... | @@ -279,19 +279,28 @@ export const trigger_condition_schema: FormSchema[] = [ |
| 279 | 279 | component: 'ApiSelect', |
| 280 | 280 | componentProps: ({ formModel }) => { |
| 281 | 281 | const deviceProfileId = formModel['deviceProfileId']; |
| 282 | - if (unref(organizationId)) { | |
| 283 | - return { | |
| 284 | - placeholder: '请选择设备', | |
| 285 | - mode: 'multiple', | |
| 286 | - api: byOrganizationIdGetMasterDevice, | |
| 287 | - params: { | |
| 288 | - organizationId: unref(organizationId), | |
| 289 | - deviceProfileId, | |
| 290 | - }, | |
| 291 | - labelField: 'name', | |
| 292 | - valueField: 'tbDeviceId', | |
| 293 | - }; | |
| 294 | - } | |
| 282 | + return { | |
| 283 | + mode: 'multiple', | |
| 284 | + api: async () => { | |
| 285 | + if (unref(organizationId)) { | |
| 286 | + try { | |
| 287 | + const data = await byOrganizationIdGetMasterDevice({ | |
| 288 | + organizationId: unref(organizationId), | |
| 289 | + deviceProfileId, | |
| 290 | + }); | |
| 291 | + if (data) | |
| 292 | + return data.map((item) => ({ | |
| 293 | + ...item, | |
| 294 | + label: item.alias || item.name, | |
| 295 | + value: item.tbDeviceId, | |
| 296 | + })); | |
| 297 | + } catch (error) {} | |
| 298 | + } | |
| 299 | + return []; | |
| 300 | + }, | |
| 301 | + placeholder: '请选择设备', | |
| 302 | + getPopupContainer: () => document.body, | |
| 303 | + }; | |
| 295 | 304 | }, |
| 296 | 305 | ifShow: ({ values }) => isPart(values.device), |
| 297 | 306 | colProps: { span: 6 }, |
| ... | ... | @@ -473,19 +482,28 @@ export const actionSchema: FormSchema[] = [ |
| 473 | 482 | component: 'ApiSelect', |
| 474 | 483 | componentProps: ({ formModel }) => { |
| 475 | 484 | const deviceProfileId = formModel['deviceProfileId']; |
| 476 | - if (unref(organizationId)) { | |
| 477 | - return { | |
| 478 | - placeholder: '请选择设备', | |
| 479 | - mode: 'multiple', | |
| 480 | - api: byOrganizationIdGetMasterDevice, | |
| 481 | - params: { | |
| 482 | - organizationId: unref(organizationId), | |
| 483 | - deviceProfileId, | |
| 484 | - }, | |
| 485 | - labelField: 'name', | |
| 486 | - valueField: 'tbDeviceId', | |
| 487 | - }; | |
| 488 | - } | |
| 485 | + return { | |
| 486 | + mode: 'multiple', | |
| 487 | + api: async () => { | |
| 488 | + if (unref(organizationId)) { | |
| 489 | + try { | |
| 490 | + const data = await byOrganizationIdGetMasterDevice({ | |
| 491 | + organizationId: unref(organizationId), | |
| 492 | + deviceProfileId, | |
| 493 | + }); | |
| 494 | + if (data) | |
| 495 | + return data.map((item) => ({ | |
| 496 | + ...item, | |
| 497 | + label: item.alias || item.name, | |
| 498 | + value: item.tbDeviceId, | |
| 499 | + })); | |
| 500 | + } catch (error) {} | |
| 501 | + } | |
| 502 | + return []; | |
| 503 | + }, | |
| 504 | + placeholder: '请选择设备', | |
| 505 | + getPopupContainer: () => document.body, | |
| 506 | + }; | |
| 489 | 507 | }, |
| 490 | 508 | ifShow: ({ values }) => isPart(values.device) && isDeviceOut(values.outTarget), |
| 491 | 509 | colProps: { span: 6 }, | ... | ... |
| ... | ... | @@ -13,7 +13,12 @@ |
| 13 | 13 | :name="ifAdd ? 'name' : 'params'" |
| 14 | 14 | :rules="[{ required: true, message: ifAdd ? '请输入脚本名称' : '请输入参数' }]" |
| 15 | 15 | > |
| 16 | - <a-input v-if="ifAdd" v-model:value="scriptForm.name" placeholder="请输入脚本名称" /> | |
| 16 | + <a-input | |
| 17 | + v-if="ifAdd" | |
| 18 | + :maxlength="36" | |
| 19 | + v-model:value="scriptForm.name" | |
| 20 | + placeholder="请输入脚本名称" | |
| 21 | + /> | |
| 17 | 22 | <a-input |
| 18 | 23 | @change="handleInputChange" |
| 19 | 24 | v-else |
| ... | ... | @@ -65,12 +70,14 @@ |
| 65 | 70 | v-if="ifAdd" |
| 66 | 71 | v-model:value="scriptForm.description" |
| 67 | 72 | placeholder="请输入备注" |
| 73 | + :maxlength="255" | |
| 68 | 74 | /> |
| 69 | 75 | <a-textarea |
| 70 | 76 | :rows="3" |
| 71 | 77 | v-else |
| 72 | 78 | v-model:value="scriptForm.output" |
| 73 | 79 | placeholder="输出参数为服务端返回的内容" |
| 80 | + :maxlength="255" | |
| 74 | 81 | /> |
| 75 | 82 | </a-form-item> |
| 76 | 83 | </a-form> |
| ... | ... | @@ -109,7 +116,7 @@ |
| 109 | 116 | typeOptions: [], |
| 110 | 117 | originalOptions: [], |
| 111 | 118 | }); |
| 112 | - const { typeOptions, originalOptions } = toRefs(reportTypeOptions); | |
| 119 | + const { originalOptions, typeOptions } = toRefs(reportTypeOptions); | |
| 113 | 120 | const { createMessage } = useMessage(); |
| 114 | 121 | const { clipboardRef, copiedRef } = useCopyToClipboard(); |
| 115 | 122 | const aceEditor = ref(); |
| ... | ... | @@ -149,7 +156,7 @@ |
| 149 | 156 | }); |
| 150 | 157 | aceEditor.value.setValue(); |
| 151 | 158 | beautify(aceEditor.value.session); |
| 152 | - scriptForm.convertJs = aceEditor.value.getValue(); | |
| 159 | + // scriptForm.convertJs = aceEditor.value.getValue(); | |
| 153 | 160 | }; |
| 154 | 161 | const handleCopy = () => { |
| 155 | 162 | const valueRef = aceEditor.value.getValue(); |
| ... | ... | @@ -184,6 +191,10 @@ |
| 184 | 191 | const trimParams = scriptForm.params.replace(/\s*/g, ''); |
| 185 | 192 | Reflect.set(value, 'params', trimParams); |
| 186 | 193 | } |
| 194 | + if (scriptForm.convertJs.length > 1000) { | |
| 195 | + createMessage.error('脚本内容长度不能大于1000'); | |
| 196 | + throw '脚本内容长度不能大于1000'; | |
| 197 | + } | |
| 187 | 198 | return { |
| 188 | 199 | ...value, |
| 189 | 200 | ...{ convertJs: props.ifAdd ? scriptForm.convertJs : null }, | ... | ... |
| ... | ... | @@ -127,7 +127,7 @@ export const accountFormSchema: FormSchema[] = [ |
| 127 | 127 | colProps: { span: 12 }, |
| 128 | 128 | required: true, |
| 129 | 129 | componentProps: { |
| 130 | - maxLength: 255, | |
| 130 | + maxLength: 10, | |
| 131 | 131 | }, |
| 132 | 132 | }, |
| 133 | 133 | { |
| ... | ... | @@ -224,6 +224,10 @@ export const accountFormSchema: FormSchema[] = [ |
| 224 | 224 | label: '备注', |
| 225 | 225 | component: 'InputTextArea', |
| 226 | 226 | colProps: { span: 24 }, |
| 227 | + componentProps: { | |
| 228 | + maxLength: 255, | |
| 229 | + placeholder: '请输入备注', | |
| 230 | + }, | |
| 227 | 231 | }, |
| 228 | 232 | { |
| 229 | 233 | field: 'organizationIds', | ... | ... |