Showing
6 changed files
with
24 additions
and
7 deletions
@@ -8,7 +8,7 @@ VITE_GLOB_PUBLIC_PATH = / | @@ -8,7 +8,7 @@ VITE_GLOB_PUBLIC_PATH = / | ||
8 | # Please note that no line breaks | 8 | # Please note that no line breaks |
9 | 9 | ||
10 | # 本地 | 10 | # 本地 |
11 | -VITE_PROXY = [["/api","http://localhost:8080/api"],["/thingskit-scada","http://localhost:3000/"],["/large-designer", "http://localhost:5555/large-designer/"]] | 11 | +VITE_PROXY = [["/api","http://localhost:8080/api"],["/thingskit-scada","http://localhost:5173/thingskit-scada"],["/large-designer", "http://localhost:5555/large-designer/"]] |
12 | 12 | ||
13 | # 实时数据的ws地址 | 13 | # 实时数据的ws地址 |
14 | VITE_GLOB_WEB_SOCKET = ws://localhost:8080/api/ws/plugins/telemetry?token= | 14 | VITE_GLOB_WEB_SOCKET = ws://localhost:8080/api/ws/plugins/telemetry?token= |
@@ -22,9 +22,11 @@ | @@ -22,9 +22,11 @@ | ||
22 | value: ModelOfMatterParams[]; | 22 | value: ModelOfMatterParams[]; |
23 | disabled: boolean; | 23 | disabled: boolean; |
24 | hasStructForm?: boolean; | 24 | hasStructForm?: boolean; |
25 | + hiddenAccessMode?: boolean; | ||
25 | }>(), | 26 | }>(), |
26 | { | 27 | { |
27 | value: () => [], | 28 | value: () => [], |
29 | + hiddenAccessMode: false, | ||
28 | hasStructForm: false, | 30 | hasStructForm: false, |
29 | } | 31 | } |
30 | ); | 32 | ); |
@@ -106,11 +108,12 @@ | @@ -106,11 +108,12 @@ | ||
106 | <span class="mr-2"> | 108 | <span class="mr-2"> |
107 | <PlusOutlined /> | 109 | <PlusOutlined /> |
108 | </span> | 110 | </span> |
109 | - <span @click="!$props.disabled && handleCreateParams()">增加参数</span> | 111 | + <span @click="!disabled && handleCreateParams()">增加参数</span> |
110 | </div> | 112 | </div> |
111 | </div> | 113 | </div> |
112 | <StructFormModel | 114 | <StructFormModel |
113 | - :has-struct-form="$props.hasStructForm!" | 115 | + :has-struct-form="hasStructForm!" |
116 | + :hidden-access-mode="hiddenAccessMode" | ||
114 | :disabled="$props.disabled" | 117 | :disabled="$props.disabled" |
115 | :value-list="getValue" | 118 | :value-list="getValue" |
116 | @register="registerModal" | 119 | @register="registerModal" |
@@ -23,6 +23,7 @@ | @@ -23,6 +23,7 @@ | ||
23 | disabled: boolean; | 23 | disabled: boolean; |
24 | hasStructForm: boolean; | 24 | hasStructForm: boolean; |
25 | valueList: StructRecord[]; | 25 | valueList: StructRecord[]; |
26 | + hiddenAccessMode: boolean; | ||
26 | }>(); | 27 | }>(); |
27 | 28 | ||
28 | const emit = defineEmits(['register', 'submit']); | 29 | const emit = defineEmits(['register', 'submit']); |
@@ -31,7 +32,7 @@ | @@ -31,7 +32,7 @@ | ||
31 | 32 | ||
32 | const [register, { validate, setFieldsValue, setProps }] = useForm({ | 33 | const [register, { validate, setFieldsValue, setProps }] = useForm({ |
33 | labelWidth: 100, | 34 | labelWidth: 100, |
34 | - schemas: formSchemas(props.hasStructForm), | 35 | + schemas: formSchemas(props.hasStructForm, props.hiddenAccessMode), |
35 | actionColOptions: { | 36 | actionColOptions: { |
36 | span: 14, | 37 | span: 14, |
37 | }, | 38 | }, |
@@ -28,7 +28,11 @@ export const validateJSON = (_rule, value = [] as ModelOfMatterParams[], _callba | @@ -28,7 +28,11 @@ export const validateJSON = (_rule, value = [] as ModelOfMatterParams[], _callba | ||
28 | return Promise.reject('JSON对象不能为空'); | 28 | return Promise.reject('JSON对象不能为空'); |
29 | }; | 29 | }; |
30 | 30 | ||
31 | -export const formSchemas = (hasStructForm: boolean, isTcp = false): FormSchema[] => { | 31 | +export const formSchemas = ( |
32 | + hasStructForm: boolean, | ||
33 | + hiddenAccessMode: boolean, | ||
34 | + isTcp = false | ||
35 | +): FormSchema[] => { | ||
32 | return [ | 36 | return [ |
33 | { | 37 | { |
34 | field: FormField.FUNCTION_NAME, | 38 | field: FormField.FUNCTION_NAME, |
@@ -299,7 +303,7 @@ export const formSchemas = (hasStructForm: boolean, isTcp = false): FormSchema[] | @@ -299,7 +303,7 @@ export const formSchemas = (hasStructForm: boolean, isTcp = false): FormSchema[] | ||
299 | colProps: { | 303 | colProps: { |
300 | span: 24, | 304 | span: 24, |
301 | }, | 305 | }, |
302 | - ifShow: () => !hasStructForm, | 306 | + ifShow: () => !hiddenAccessMode && !hasStructForm, |
303 | defaultValue: 'r', | 307 | defaultValue: 'r', |
304 | componentProps: { | 308 | componentProps: { |
305 | placeholder: '请选择读写类型', | 309 | placeholder: '请选择读写类型', |
@@ -19,7 +19,7 @@ | @@ -19,7 +19,7 @@ | ||
19 | 19 | ||
20 | const [register, { validate, resetFields, setFieldsValue, setProps }] = useForm({ | 20 | const [register, { validate, resetFields, setFieldsValue, setProps }] = useForm({ |
21 | labelWidth: 100, | 21 | labelWidth: 100, |
22 | - schemas: formSchemas(false, props.transportType === TransportTypeEnum.TCP), | 22 | + schemas: formSchemas(false, false, props.transportType === TransportTypeEnum.TCP), |
23 | actionColOptions: { | 23 | actionColOptions: { |
24 | span: 14, | 24 | span: 14, |
25 | }, | 25 | }, |
@@ -143,6 +143,9 @@ export const serviceSchemas = (tcpDeviceFlag: boolean): FormSchema[] => { | @@ -143,6 +143,9 @@ export const serviceSchemas = (tcpDeviceFlag: boolean): FormSchema[] => { | ||
143 | rules: [{ message: '输入参数为必填项', required: true, type: 'array' }], | 143 | rules: [{ message: '输入参数为必填项', required: true, type: 'array' }], |
144 | ifShow: !tcpDeviceFlag, | 144 | ifShow: !tcpDeviceFlag, |
145 | colProps: { span: 24 }, | 145 | colProps: { span: 24 }, |
146 | + componentProps: { | ||
147 | + hiddenAccessMode: true, | ||
148 | + }, | ||
146 | }, | 149 | }, |
147 | { | 150 | { |
148 | field: FormField.OUTPUT_PARAM, | 151 | field: FormField.OUTPUT_PARAM, |
@@ -151,6 +154,9 @@ export const serviceSchemas = (tcpDeviceFlag: boolean): FormSchema[] => { | @@ -151,6 +154,9 @@ export const serviceSchemas = (tcpDeviceFlag: boolean): FormSchema[] => { | ||
151 | valueField: 'value', | 154 | valueField: 'value', |
152 | changeEvent: 'update:value', | 155 | changeEvent: 'update:value', |
153 | colProps: { span: 24 }, | 156 | colProps: { span: 24 }, |
157 | + componentProps: { | ||
158 | + hiddenAccessMode: true, | ||
159 | + }, | ||
154 | }, | 160 | }, |
155 | { | 161 | { |
156 | field: FormField.REFARK, | 162 | field: FormField.REFARK, |
@@ -218,6 +224,9 @@ export const eventSchemas: FormSchema[] = [ | @@ -218,6 +224,9 @@ export const eventSchemas: FormSchema[] = [ | ||
218 | valueField: 'value', | 224 | valueField: 'value', |
219 | changeEvent: 'update:value', | 225 | changeEvent: 'update:value', |
220 | colProps: { span: 24 }, | 226 | colProps: { span: 24 }, |
227 | + componentProps: { | ||
228 | + hiddenAccessMode: true, | ||
229 | + }, | ||
221 | }, | 230 | }, |
222 | { | 231 | { |
223 | field: FormField.REFARK, | 232 | field: FormField.REFARK, |