Commit 490a39e6d671cce88a680ed6f4b0deb907cd16bd
Merge branch 'ft_local_dev' into 'main'
fix:修改Teanbition上问题 See merge request huang/yun-teng-iot-front!385
Showing
15 changed files
with
659 additions
and
728 deletions
.vscode/settings.json
0 → 100644
... | ... | @@ -186,7 +186,7 @@ export const getGATEWAYdevice = async (params: { organization: string }) => { |
186 | 186 | params, |
187 | 187 | }); |
188 | 188 | return Promise.resolve<{ label: string; value: string }[]>( |
189 | - res.map((item) => ({ label: item.name, value: item.tbDeviceId })) | |
189 | + res.map((item) => ({ label: item.name, value: item.id })) | |
190 | 190 | ); |
191 | 191 | }; |
192 | 192 | ... | ... |
... | ... | @@ -25,6 +25,8 @@ |
25 | 25 | import { useI18n } from '/@/hooks/web/useI18n'; |
26 | 26 | import { JWT_TOKEN_KEY } from '/@/enums/cacheEnum'; |
27 | 27 | import { getAuthCache } from '/@/utils/auth'; |
28 | + import { useMessage } from '/@/hooks/web/useMessage'; | |
29 | + | |
28 | 30 | export default defineComponent({ |
29 | 31 | name: 'TinymceImageUpload', |
30 | 32 | components: { Upload }, |
... | ... | @@ -39,6 +41,7 @@ |
39 | 41 | }, |
40 | 42 | emits: ['uploading', 'done', 'error'], |
41 | 43 | setup(props, { emit }) { |
44 | + const { createMessage } = useMessage(); | |
42 | 45 | let uploading = false; |
43 | 46 | const token: string = getAuthCache(JWT_TOKEN_KEY); |
44 | 47 | const { uploadUrl } = useGlobSetting(); |
... | ... | @@ -55,7 +58,6 @@ |
55 | 58 | }); |
56 | 59 | |
57 | 60 | function handleChange(info: Recordable) { |
58 | - console.log(info); | |
59 | 61 | const file = info.file; |
60 | 62 | const status = file?.status; |
61 | 63 | const url = file?.response?.fileStaticUri; |
... | ... | @@ -72,6 +74,7 @@ |
72 | 74 | loading.value = false; |
73 | 75 | uploading = false; |
74 | 76 | } else if (status === 'error') { |
77 | + createMessage.error('图片上传失败'); | |
75 | 78 | emit('error'); |
76 | 79 | loading.value = false; |
77 | 80 | uploading = false; | ... | ... |
... | ... | @@ -10,9 +10,8 @@ |
10 | 10 | <BasicForm @register="registerForm"> |
11 | 11 | <template #alarmContactSlot="{ model, field }"> |
12 | 12 | <p style="display: none">{{ field }}</p> |
13 | - <p>{{ orgFunc(model['organizationId']) }}</p> | |
13 | + <p style="display: none">{{ orgFunc(model['organizationId']) }}</p> | |
14 | 14 | <a-select |
15 | - style="top: -13px" | |
16 | 15 | placeholder="请选择告警联系人" |
17 | 16 | mode="multiple" |
18 | 17 | v-model:value="model[field]" | ... | ... |
... | ... | @@ -16,8 +16,8 @@ |
16 | 16 | /> |
17 | 17 | </template> |
18 | 18 | <div style="display: flex" :class="{ 'mt-2': outputParamData.length > 0 }"> |
19 | - <span style="color: #0170cc; cursor: pointer">+</span> | |
20 | - <span style="color: #0170cc; cursor: pointer" @click="handleAddOutParam">增加参数</span> | |
19 | + <span class="add-style">+</span> | |
20 | + <span class="add-style" @click="handleAddOutParam">增加参数</span> | |
21 | 21 | </div> |
22 | 22 | </div> |
23 | 23 | </template> |
... | ... | @@ -40,7 +40,9 @@ |
40 | 40 | const dynamicBindRef = { |
41 | 41 | outputParamItemRef: ref([]), |
42 | 42 | }; |
43 | + | |
43 | 44 | const [registerModal, { openModal }] = useModal(); |
45 | + | |
44 | 46 | const [register, { validate, setFieldsValue, resetFields }] = useForm({ |
45 | 47 | labelWidth: 100, |
46 | 48 | schemas: attrSchemas, |
... | ... | @@ -51,6 +53,7 @@ |
51 | 53 | submitOnReset: false, |
52 | 54 | showActionButtonGroup: false, |
53 | 55 | }); |
56 | + | |
54 | 57 | const getData = (d, f) => { |
55 | 58 | if (f == 'output') { |
56 | 59 | if (d.id !== null) { |
... | ... | @@ -83,33 +86,38 @@ |
83 | 86 | }); |
84 | 87 | }; |
85 | 88 | |
89 | + const setTypeData = (T, D) => { | |
90 | + if (T === 'INT' || T === 'DOUBLE' || T === 'TEXT') { | |
91 | + return { | |
92 | + ...D?.dataSpecs, | |
93 | + valueRange: D?.dataSpecs, | |
94 | + }; | |
95 | + } else if (T === 'BOOL') { | |
96 | + return { | |
97 | + boolClose: D?.dataSpecsList[0]?.name, | |
98 | + boolOpen: D?.dataSpecsList[1]?.name, | |
99 | + }; | |
100 | + } | |
101 | + }; | |
102 | + | |
86 | 103 | //回显数据 |
87 | 104 | const setFormData = (v) => { |
88 | - setFieldsValue(v[0]); | |
89 | - setFieldsValue({ | |
90 | - ...v[0].dataSpecs, | |
91 | - valueRange: v[0].dataSpecs, | |
92 | - boolClose: | |
93 | - v[0].dataSpecsList !== undefined || v[0].dataSpecsList !== null | |
94 | - ? v[0].dataSpecsList[0].name | |
95 | - : '', | |
96 | - boolOpen: | |
97 | - v[0].dataSpecsList !== undefined || v[0].dataSpecsList !== null | |
98 | - ? v[0].dataSpecsList[1].name | |
99 | - : '', | |
100 | - }); | |
105 | + setFieldsValue({ ...v[0] }); | |
106 | + setFieldsValue(setTypeData(v[0].dataType, v[0])); | |
101 | 107 | const { dataSpecsList } = v[0]; |
102 | 108 | if (dataSpecsList !== undefined) { |
103 | 109 | outputParamData.value = [...new Array(dataSpecsList.length).keys()]; |
104 | 110 | outputParamData.value = dataSpecsList; |
105 | 111 | } |
106 | 112 | }; |
113 | + | |
107 | 114 | //获取结构体数据 |
108 | 115 | const getStructList = () => { |
109 | 116 | const val = unref(dynamicBindRef.outputParamItemRef)?.map((item: any) => item.getFormData()); |
110 | 117 | return val; |
111 | 118 | }; |
112 | - const getBoolOrStruct = (T, S, B) => { | |
119 | + | |
120 | + const getBoolOrStructData = (T, S, B) => { | |
113 | 121 | if (T === 'STRUCT') { |
114 | 122 | return S; |
115 | 123 | } else { |
... | ... | @@ -126,20 +134,23 @@ |
126 | 134 | } |
127 | 135 | const dataSpecs = useChangeTypeGetTypeForm(values.dataType, values); |
128 | 136 | const dataSpecsListBool = useChangeTypeGetTypeForm(values.dataType, values); |
129 | - const { valueRange = null, step = null, unit = null, outputParam = null, ...value } = values; | |
130 | - console.log(outputParam); | |
131 | - console.log(step); | |
132 | - console.log(unit); | |
133 | - console.log(valueRange); | |
137 | + const { valueRange, step, unit, outputParam, ...value } = values; | |
138 | + const none = { | |
139 | + ...outputParam, | |
140 | + ...step, | |
141 | + ...unit, | |
142 | + ...valueRange, | |
143 | + }; | |
144 | + console.log(none); | |
134 | 145 | return { |
135 | 146 | ...value, |
136 | 147 | ...{ dataSpecs }, |
137 | 148 | ...{ |
138 | - dataSpecsList: getBoolOrStruct(values.dataType, dataSpecsList, dataSpecsListBool), | |
149 | + dataSpecsList: getBoolOrStructData(values.dataType, dataSpecsList, dataSpecsListBool), | |
139 | 150 | }, |
140 | 151 | }; |
141 | 152 | } |
142 | - //清空数据 | |
153 | + | |
143 | 154 | const resetFormData = () => { |
144 | 155 | resetFields(); |
145 | 156 | outputParamData.value = []; |
... | ... | @@ -151,4 +162,9 @@ |
151 | 162 | getFormData, |
152 | 163 | }); |
153 | 164 | </script> |
154 | -<style lang="less" scoped></style> | |
165 | +<style lang="less" scoped> | |
166 | + .add-style { | |
167 | + color: #0170cc; | |
168 | + cursor: pointer; | |
169 | + } | |
170 | +</style> | ... | ... |
... | ... | @@ -15,9 +15,9 @@ |
15 | 15 | @edit="editOutParItem" |
16 | 16 | /> |
17 | 17 | </template> |
18 | - <div style="display: flex" class="mt-2"> | |
19 | - <span style="color: #0170cc; cursor: pointer">+</span> | |
20 | - <span style="color: #0170cc; cursor: pointer" @click="handleAddOutParam">增加参数</span> | |
18 | + <div style="display: flex" :class="{ 'mt-2': outputParamData.length > 0 }"> | |
19 | + <span class="add-style">+</span> | |
20 | + <span class="add-style" @click="handleAddOutParam">增加参数</span> | |
21 | 21 | </div> |
22 | 22 | </div> |
23 | 23 | </template> |
... | ... | @@ -38,7 +38,9 @@ |
38 | 38 | const dynamicBindRef = { |
39 | 39 | outputParamItemRef: ref([]), |
40 | 40 | }; |
41 | + | |
41 | 42 | const [registerModal, { openModal }] = useModal(); |
43 | + | |
42 | 44 | const [register, { validate, setFieldsValue, resetFields }] = useForm({ |
43 | 45 | labelWidth: 100, |
44 | 46 | schemas: eventSchemas, |
... | ... | @@ -49,6 +51,7 @@ |
49 | 51 | submitOnReset: false, |
50 | 52 | showActionButtonGroup: false, |
51 | 53 | }); |
54 | + | |
52 | 55 | const getData = (d, f) => { |
53 | 56 | if (f == 'output') { |
54 | 57 | if (d.id !== null) { |
... | ... | @@ -59,6 +62,7 @@ |
59 | 62 | } |
60 | 63 | } |
61 | 64 | }; |
65 | + | |
62 | 66 | const handleAddOutParam = () => { |
63 | 67 | openModal(true, { |
64 | 68 | isUpdate: true, |
... | ... | @@ -66,9 +70,11 @@ |
66 | 70 | excludeStruct: false, |
67 | 71 | }); |
68 | 72 | }; |
73 | + | |
69 | 74 | const deleteOutParItem = (index) => { |
70 | 75 | unref(outputParamData).splice(index, 1); |
71 | 76 | }; |
77 | + | |
72 | 78 | const editOutParItem = (item) => { |
73 | 79 | openModal(true, { |
74 | 80 | isUpdate: false, |
... | ... | @@ -77,6 +83,7 @@ |
77 | 83 | excludeStruct: false, |
78 | 84 | }); |
79 | 85 | }; |
86 | + | |
80 | 87 | //回显数据 |
81 | 88 | const setFormData = (v) => { |
82 | 89 | setFieldsValue(v[0]); |
... | ... | @@ -86,6 +93,7 @@ |
86 | 93 | outputParamData.value = outputData; |
87 | 94 | } |
88 | 95 | }; |
96 | + | |
89 | 97 | //获取数据 |
90 | 98 | const getStructList = () => { |
91 | 99 | const val = unref(dynamicBindRef.outputParamItemRef)?.map((item: any) => item.getFormData()); |
... | ... | @@ -96,13 +104,14 @@ |
96 | 104 | const values = await validate(); |
97 | 105 | if (!values) return; |
98 | 106 | const outputData = getStructList(); |
99 | - const { outputParam = null, ...value } = values; | |
107 | + const { outputParam, ...value } = values; | |
100 | 108 | console.log(outputParam); |
101 | 109 | return { |
102 | 110 | ...value, |
103 | 111 | ...{ outputData }, |
104 | 112 | }; |
105 | 113 | } |
114 | + | |
106 | 115 | //清空数据 |
107 | 116 | const resetFormData = () => { |
108 | 117 | resetFields(); |
... | ... | @@ -115,4 +124,9 @@ |
115 | 124 | getFormData, |
116 | 125 | }); |
117 | 126 | </script> |
118 | -<style lang="less" scoped></style> | |
127 | +<style lang="less" scoped> | |
128 | + .add-style { | |
129 | + color: #0170cc; | |
130 | + cursor: pointer; | |
131 | + } | |
132 | +</style> | ... | ... |
... | ... | @@ -3,7 +3,7 @@ |
3 | 3 | <BasicForm @register="register"> |
4 | 4 | <template #inputParamSlot> |
5 | 5 | <div> |
6 | - <template v-for="(item, index) in inputParamData" :key="item"> | |
6 | + <template v-for="(item, index) in inputParamData" :key="item.id"> | |
7 | 7 | <span style="display: none">{{ item }}</span> |
8 | 8 | <InputParamItem |
9 | 9 | :title="item.name" |
... | ... | @@ -15,15 +15,15 @@ |
15 | 15 | @edit="editInParItem" |
16 | 16 | /> |
17 | 17 | </template> |
18 | - <div style="display: flex" class="mt-2"> | |
19 | - <span style="color: #0170cc; cursor: pointer">+</span> | |
20 | - <span style="color: #0170cc; cursor: pointer" @click="handleAddInParam">增加参数</span> | |
18 | + <div style="display: flex" :class="{ 'mt-2': inputParamData.length > 0 }"> | |
19 | + <span class="add-style">+</span> | |
20 | + <span class="add-style" @click="handleAddInParam">增加参数</span> | |
21 | 21 | </div> |
22 | 22 | </div> |
23 | 23 | </template> |
24 | 24 | <template #outputParamSlot> |
25 | 25 | <div> |
26 | - <template v-for="(item, index) in outputParamData" :key="item"> | |
26 | + <template v-for="(item, index) in outputParamData" :key="item.id"> | |
27 | 27 | <span style="display: none">{{ item }}</span> |
28 | 28 | <InputParamItem |
29 | 29 | :title="item.name" |
... | ... | @@ -35,9 +35,9 @@ |
35 | 35 | @edit="editOutParItem" |
36 | 36 | /> |
37 | 37 | </template> |
38 | - <div style="display: flex" class="mt-2"> | |
39 | - <span style="color: #0170cc; cursor: pointer">+</span> | |
40 | - <span style="color: #0170cc; cursor: pointer" @click="handleAddOutParam">增加参数</span> | |
38 | + <div style="display: flex" :class="{ 'mt-2': outputParamData.length > 0 }"> | |
39 | + <span class="add-style">+</span> | |
40 | + <span class="add-style" @click="handleAddOutParam">增加参数</span> | |
41 | 41 | </div> |
42 | 42 | </div> |
43 | 43 | </template> |
... | ... | @@ -60,6 +60,7 @@ |
60 | 60 | inputParamItemRef: ref([]), |
61 | 61 | outputParamItemRef: ref([]), |
62 | 62 | }; |
63 | + | |
63 | 64 | const [registerModal, { openModal }] = useModal(); |
64 | 65 | |
65 | 66 | const [register, { validate, setFieldsValue, resetFields }] = useForm({ |
... | ... | @@ -98,17 +99,11 @@ |
98 | 99 | excludeStruct: false, |
99 | 100 | }); |
100 | 101 | }; |
101 | - const handleAddOutParam = () => { | |
102 | - openModal(true, { | |
103 | - isUpdate: true, | |
104 | - flag: 'output', | |
105 | - excludeStruct: false, | |
106 | - }); | |
107 | - }; | |
108 | 102 | |
109 | 103 | const deleteInParItem = (index) => { |
110 | 104 | unref(inputParamData).splice(index, 1); |
111 | 105 | }; |
106 | + | |
112 | 107 | const editInParItem = (item) => { |
113 | 108 | openModal(true, { |
114 | 109 | isUpdate: false, |
... | ... | @@ -117,9 +112,19 @@ |
117 | 112 | excludeStruct: false, |
118 | 113 | }); |
119 | 114 | }; |
115 | + | |
116 | + const handleAddOutParam = () => { | |
117 | + openModal(true, { | |
118 | + isUpdate: true, | |
119 | + flag: 'output', | |
120 | + excludeStruct: false, | |
121 | + }); | |
122 | + }; | |
123 | + | |
120 | 124 | const deleteOutParItem = (index) => { |
121 | 125 | unref(outputParamData).splice(index, 1); |
122 | 126 | }; |
127 | + | |
123 | 128 | const editOutParItem = (item) => { |
124 | 129 | openModal(true, { |
125 | 130 | isUpdate: false, |
... | ... | @@ -142,10 +147,12 @@ |
142 | 147 | inputParamData.value = inputParams; |
143 | 148 | } |
144 | 149 | }; |
150 | + | |
145 | 151 | const getInputStructList = () => { |
146 | 152 | const val = unref(dynamicBindRef.inputParamItemRef)?.map((item: any) => item.getFormData()); |
147 | 153 | return val; |
148 | 154 | }; |
155 | + | |
149 | 156 | const getOutputStructList = () => { |
150 | 157 | const val = unref(dynamicBindRef.outputParamItemRef)?.map((item: any) => item.getFormData()); |
151 | 158 | return val; |
... | ... | @@ -157,7 +164,7 @@ |
157 | 164 | if (!values) return; |
158 | 165 | const inputParams = getInputStructList(); |
159 | 166 | const outputParams = getOutputStructList(); |
160 | - const { inputParam = null, outputParam = null, ...value } = values; | |
167 | + const { inputParam, outputParam, ...value } = values; | |
161 | 168 | console.log(inputParam); |
162 | 169 | console.log(outputParam); |
163 | 170 | return { |
... | ... | @@ -166,6 +173,7 @@ |
166 | 173 | ...{ outputParams }, |
167 | 174 | }; |
168 | 175 | } |
176 | + | |
169 | 177 | //清空数据 |
170 | 178 | const resetFormData = () => { |
171 | 179 | resetFields(); |
... | ... | @@ -179,4 +187,9 @@ |
179 | 187 | getFormData, |
180 | 188 | }); |
181 | 189 | </script> |
182 | -<style lang="less" scoped></style> | |
190 | +<style lang="less" scoped> | |
191 | + .add-style { | |
192 | + color: #0170cc; | |
193 | + cursor: pointer; | |
194 | + } | |
195 | +</style> | ... | ... |
... | ... | @@ -15,9 +15,9 @@ |
15 | 15 | @edit="editOutParItem" |
16 | 16 | /> |
17 | 17 | </template> |
18 | - <div style="display: flex" class="mt-2"> | |
19 | - <span style="color: #0170cc; cursor: pointer">+</span> | |
20 | - <span style="color: #0170cc; cursor: pointer" @click="handleAddOutParam">增加参数</span> | |
18 | + <div style="display: flex" :class="{ 'mt-2': outputParamData.length > 0 }"> | |
19 | + <span class="add-style">+</span> | |
20 | + <span class="add-style" @click="handleAddOutParam">增加参数</span> | |
21 | 21 | </div> |
22 | 22 | </div> |
23 | 23 | </template> |
... | ... | @@ -32,9 +32,8 @@ |
32 | 32 | import { useModal } from '/@/components/Modal'; |
33 | 33 | import InputParamItem from './InputParamItem.vue'; |
34 | 34 | import AddParamsModal from './AddParamsModal.vue'; |
35 | - import { findDictItemByCode } from '/@/api/system/dict'; | |
36 | 35 | import { buildUUID } from '/@/utils/uuid'; |
37 | - import { useChangeTypeGetTypeForm } from '../../hook/useTypeGetForm'; | |
36 | + import { useChangeTypeGetTypeForm, useUpdateFormExcludeStruct } from '../../hook/useTypeGetForm'; | |
38 | 37 | |
39 | 38 | defineEmits(['register']); |
40 | 39 | const outputParamData: any = ref([]); |
... | ... | @@ -53,6 +52,7 @@ |
53 | 52 | submitOnReset: false, |
54 | 53 | showActionButtonGroup: false, |
55 | 54 | }); |
55 | + | |
56 | 56 | const getData = (d, f) => { |
57 | 57 | if (f == 'output') { |
58 | 58 | if (d.id !== null) { |
... | ... | @@ -75,6 +75,7 @@ |
75 | 75 | const deleteOutParItem = (index) => { |
76 | 76 | unref(outputParamData).splice(index, 1); |
77 | 77 | }; |
78 | + | |
78 | 79 | const editOutParItem = (item) => { |
79 | 80 | openModal(true, { |
80 | 81 | isUpdate: false, |
... | ... | @@ -84,37 +85,11 @@ |
84 | 85 | }); |
85 | 86 | }; |
86 | 87 | |
87 | - const updateFormExcludeStruct = async (flag) => { | |
88 | - const res: any = await findDictItemByCode({ dictCode: 'data_type' }); | |
89 | - const optionTrue = res | |
90 | - .map((m) => { | |
91 | - if (flag) { | |
92 | - if (m.itemValue !== 'STRUCT') { | |
93 | - return { | |
94 | - value: m.itemValue, | |
95 | - label: m.itemText, | |
96 | - }; | |
97 | - } | |
98 | - } else { | |
99 | - return { | |
100 | - value: m.itemValue, | |
101 | - label: m.itemText, | |
102 | - }; | |
103 | - } | |
104 | - }) | |
105 | - .filter(Boolean); | |
106 | - updateSchema({ | |
107 | - field: 'dataType', | |
108 | - componentProps: { | |
109 | - options: optionTrue, | |
110 | - }, | |
111 | - }); | |
112 | - }; | |
88 | + const updateFormExcludeStruct = (flag) => useUpdateFormExcludeStruct(flag, updateSchema); | |
89 | + | |
90 | + const getOutputStructList = () => | |
91 | + unref(dynamicBindRef.outputParamItemRef)?.map((item: any) => item.getFormData()); | |
113 | 92 | |
114 | - const getOutputStructList = () => { | |
115 | - const val = unref(dynamicBindRef.outputParamItemRef)?.map((item: any) => item.getFormData()); | |
116 | - return val; | |
117 | - }; | |
118 | 93 | const getBoolOrStruct = (T, S, B) => { |
119 | 94 | if (T === 'STRUCT') { |
120 | 95 | return S; |
... | ... | @@ -124,6 +99,7 @@ |
124 | 99 | return B; |
125 | 100 | } |
126 | 101 | }; |
102 | + | |
127 | 103 | const getIntOrText = (T, D) => { |
128 | 104 | if (T === 'STRUCT') { |
129 | 105 | return null; |
... | ... | @@ -131,41 +107,46 @@ |
131 | 107 | return D; |
132 | 108 | } |
133 | 109 | }; |
110 | + | |
134 | 111 | const getFormData = async () => { |
135 | 112 | const values = await validate(); |
136 | 113 | if (!values) return; |
137 | 114 | const outputParams = getOutputStructList(); |
138 | 115 | outputParams.forEach((f) => { |
139 | 116 | f.dataType = 'STRUCT'; |
117 | + f.childDataType = values.dataType; | |
118 | + f.childName = values.name; | |
140 | 119 | }); |
141 | - const childSpecsDTO = useChangeTypeGetTypeForm(values.dataType, values); | |
142 | - const dataSpecs = childSpecsDTO; | |
143 | - const childEnumSpecsDTO = useChangeTypeGetTypeForm(values.dataType, values); | |
144 | - const dataSpecsList = childEnumSpecsDTO; | |
120 | + const dataSpecs = useChangeTypeGetTypeForm(values.dataType, values); | |
121 | + const dataSpecsList = useChangeTypeGetTypeForm(values.dataType, values); | |
145 | 122 | const { boolClose, boolOpen, step, unit, valueRange, ...value } = values; |
146 | - console.log(boolClose); | |
147 | - console.log(boolOpen); | |
148 | - console.log(step); | |
149 | - console.log(unit); | |
150 | - console.log(valueRange); | |
123 | + const none = { | |
124 | + ...boolClose, | |
125 | + ...boolOpen, | |
126 | + ...step, | |
127 | + ...unit, | |
128 | + ...valueRange, | |
129 | + }; | |
130 | + console.log(none); | |
151 | 131 | return { |
152 | 132 | ...value, |
153 | 133 | ...{ |
154 | 134 | dataSpecs: getIntOrText(values.dataType, dataSpecs), |
155 | 135 | }, |
156 | - ...{ | |
157 | - childSpecsDTO: getIntOrText(values.dataType, childSpecsDTO), | |
158 | - }, | |
136 | + // ...{ | |
137 | + // childSpecsDTO: getIntOrText(values.dataType, dataSpecs), | |
138 | + // }, | |
159 | 139 | ...{ |
160 | 140 | dataSpecsList: getBoolOrStruct(values.dataType, outputParams, dataSpecsList), |
161 | 141 | }, |
162 | - ...{ childEnumSpecsDTO: getBoolOrStruct(values.dataType, outputParams, childEnumSpecsDTO) }, | |
163 | - ...{ | |
164 | - childDataType: values.dataType, | |
165 | - childName: values.name, | |
166 | - }, | |
142 | + // ...{ childEnumSpecsDTO: getBoolOrStruct(values.dataType, outputParams, dataSpecsList) }, | |
143 | + // ...{ | |
144 | + // childDataType: values.dataType, | |
145 | + // childName: values.name, | |
146 | + // }, | |
167 | 147 | }; |
168 | 148 | }; |
149 | + | |
169 | 150 | const setFormData = (v) => { |
170 | 151 | setFieldsValue(v); |
171 | 152 | setFieldsValue({ |
... | ... | @@ -197,6 +178,7 @@ |
197 | 178 | console.log(e); |
198 | 179 | } |
199 | 180 | }; |
181 | + | |
200 | 182 | const resetFormData = () => { |
201 | 183 | resetFields(); |
202 | 184 | outputParamData.value = []; |
... | ... | @@ -210,4 +192,9 @@ |
210 | 192 | }); |
211 | 193 | </script> |
212 | 194 | |
213 | -<style lang="less" scope></style> | |
195 | +<style lang="less" scope> | |
196 | + .add-style { | |
197 | + color: #0170cc; | |
198 | + cursor: pointer; | |
199 | + } | |
200 | +</style> | ... | ... |
... | ... | @@ -51,6 +51,7 @@ |
51 | 51 | closeModal(); |
52 | 52 | } |
53 | 53 | }; |
54 | + | |
54 | 55 | const handleSubmit = async () => { |
55 | 56 | const value = await AddParamFormRef.value?.getFormData(); |
56 | 57 | if (!value) return; |
... | ... | @@ -68,7 +69,5 @@ |
68 | 69 | ); |
69 | 70 | handleCancel(true); |
70 | 71 | }; |
71 | - defineExpose({}); | |
72 | 72 | </script> |
73 | - | |
74 | 73 | <style lang="less" scope></style> | ... | ... |
... | ... | @@ -30,9 +30,11 @@ |
30 | 30 | default: () => {}, |
31 | 31 | }, |
32 | 32 | }); |
33 | + | |
33 | 34 | const handleDelete = (index) => { |
34 | 35 | emit('delete', index); |
35 | 36 | }; |
37 | + | |
36 | 38 | const handleEdit = (item, index) => { |
37 | 39 | const value = { |
38 | 40 | ...item, |
... | ... | @@ -44,6 +46,7 @@ |
44 | 46 | const getFormData = () => { |
45 | 47 | return props.item; |
46 | 48 | }; |
49 | + | |
47 | 50 | defineExpose({ |
48 | 51 | getFormData, |
49 | 52 | }); | ... | ... |
... | ... | @@ -146,6 +146,68 @@ export const mockData = { |
146 | 146 | ], |
147 | 147 | productKey: 'hsrnXEfGFDv', |
148 | 148 | properties: [ |
149 | + // { | |
150 | + // createTs: 1667876342551, | |
151 | + // custom: true, | |
152 | + // customFlag: true, | |
153 | + // dataSpecs: { | |
154 | + // dataType: 'TEXT', | |
155 | + // length: 10240, | |
156 | + // }, | |
157 | + // dataType: 'TEXT', | |
158 | + // description: '内容推荐', | |
159 | + // identifier: 'Brightness', | |
160 | + // name: '亮度百分比', | |
161 | + // productKey: 'hsrnXEfGFDv', | |
162 | + // required: false, | |
163 | + // rwFlag: 'READ_WRITE', | |
164 | + // std: false, | |
165 | + // }, | |
166 | + // { | |
167 | + // createTs: 1667876342551, | |
168 | + // custom: true, | |
169 | + // customFlag: true, | |
170 | + // dataSpecsList: [ | |
171 | + // { | |
172 | + // dataType: 'BOOL', | |
173 | + // name: '开', | |
174 | + // value: 0, | |
175 | + // }, | |
176 | + // { | |
177 | + // dataType: 'BOOL', | |
178 | + // name: '关', | |
179 | + // value: 1, | |
180 | + // }, | |
181 | + // ], | |
182 | + // dataType: 'BOOL', | |
183 | + // description: '内容推荐', | |
184 | + // identifier: 'Brightness', | |
185 | + // name: '亮度百分比', | |
186 | + // productKey: 'hsrnXEfGFDv', | |
187 | + // required: false, | |
188 | + // rwFlag: 'READ_WRITE', | |
189 | + // std: false, | |
190 | + // }, | |
191 | + // { | |
192 | + // createTs: 1667876342551, | |
193 | + // custom: true, | |
194 | + // customFlag: true, | |
195 | + // dataSpecs: { | |
196 | + // dataType: 'INT', | |
197 | + // max: '1024', | |
198 | + // min: '-1024', | |
199 | + // step: '1', | |
200 | + // unit: 'var', | |
201 | + // }, | |
202 | + // dataType: 'INT', | |
203 | + // description: '内容推荐。0:未知状态,1:熄屏,2:亮屏', | |
204 | + // identifier: 'RunningState', | |
205 | + // name: '运行状态', | |
206 | + // productKey: 'hsrnXEfGFDv', | |
207 | + // required: false, | |
208 | + // rwFlag: 'READ_WRITE', | |
209 | + // std: false, | |
210 | + // }, | |
149 | 211 | { |
150 | 212 | createTs: 1666604372638, |
151 | 213 | custom: true, |
... | ... | @@ -272,14 +334,13 @@ export const mockData = { |
272 | 334 | ], |
273 | 335 | services: [ |
274 | 336 | { |
275 | - callType: 'SYNC', | |
276 | - createTs: 1666603858325, | |
337 | + callType: 'ASYNC', | |
338 | + createTs: 1667963835032, | |
277 | 339 | custom: true, |
278 | - description: '更新模型', | |
279 | - identifier: 'UpdateModel', | |
340 | + description: '配置模型', | |
341 | + identifier: 'ConfigModel', | |
280 | 342 | inputParams: [ |
281 | 343 | { |
282 | - id: buildUUID(), | |
283 | 344 | custom: true, |
284 | 345 | dataSpecs: { |
285 | 346 | dataType: 'TEXT', |
... | ... | @@ -287,314 +348,479 @@ export const mockData = { |
287 | 348 | }, |
288 | 349 | dataType: 'TEXT', |
289 | 350 | direction: 'PARAM_INPUT', |
290 | - identifier: 'UpdateTaskID', | |
291 | - name: '更新任务ID', | |
351 | + identifier: 'AlgorithmID', | |
352 | + name: '算法任务-人脸识别', | |
292 | 353 | paraOrder: 0, |
293 | 354 | }, |
294 | 355 | { |
295 | - id: buildUUID(), | |
296 | 356 | custom: true, |
297 | 357 | dataSpecs: { |
298 | - dataType: 'TEXT', | |
299 | - length: 128, | |
358 | + dataType: 'DOUBLE', | |
359 | + max: '22', | |
360 | + min: '11', | |
361 | + step: '3', | |
362 | + unit: 'mm/hour', | |
363 | + unitName: '降雨量', | |
300 | 364 | }, |
301 | - dataType: 'TEXT', | |
365 | + dataType: 'DOUBLE', | |
302 | 366 | direction: 'PARAM_INPUT', |
303 | - identifier: 'AlgorithmID', | |
304 | - name: '算法任务唯一标识', | |
367 | + identifier: 'Threshold', | |
368 | + name: '结果置信度阈值', | |
305 | 369 | paraOrder: 1, |
306 | 370 | }, |
307 | 371 | { |
308 | - id: buildUUID(), | |
309 | - | |
310 | - custom: true, | |
311 | - dataSpecs: { | |
312 | - dataType: 'TEXT', | |
313 | - length: 64, | |
314 | - }, | |
315 | - dataType: 'TEXT', | |
316 | - direction: 'PARAM_INPUT', | |
317 | - identifier: 'AlgorithmName', | |
318 | - name: '算法名称', | |
319 | - paraOrder: 2, | |
320 | - }, | |
321 | - { | |
322 | - id: buildUUID(), | |
323 | - | |
324 | 372 | custom: true, |
325 | 373 | dataSpecs: { |
326 | 374 | dataType: 'INT', |
327 | - max: '128', | |
328 | - min: '0', | |
329 | - precise: 0, | |
375 | + max: '1024', | |
376 | + min: '-1024', | |
330 | 377 | step: '1', |
331 | - unit: '', | |
332 | - unitName: '无', | |
378 | + unit: 'W/㎡', | |
379 | + unitName: '太阳总辐射', | |
333 | 380 | }, |
334 | 381 | dataType: 'INT', |
335 | 382 | direction: 'PARAM_INPUT', |
336 | - identifier: 'NumThreads', | |
337 | - name: '使用线程数', | |
338 | - paraOrder: 4, | |
339 | - }, | |
340 | - { | |
341 | - id: buildUUID(), | |
342 | - | |
343 | - custom: true, | |
344 | - dataSpecs: { | |
345 | - dataType: 'TEXT', | |
346 | - length: 128, | |
347 | - }, | |
348 | - dataType: 'TEXT', | |
349 | - direction: 'PARAM_INPUT', | |
350 | - identifier: 'ModelID', | |
351 | - name: '模型唯一标识', | |
352 | - paraOrder: 5, | |
353 | - }, | |
354 | - { | |
355 | - id: buildUUID(), | |
356 | - | |
357 | - custom: true, | |
358 | - dataSpecs: { | |
359 | - dataType: 'TEXT', | |
360 | - length: 64, | |
361 | - }, | |
362 | - dataType: 'TEXT', | |
363 | - direction: 'PARAM_INPUT', | |
364 | - identifier: 'ModelName', | |
365 | - name: '模型名称', | |
366 | - paraOrder: 6, | |
367 | - }, | |
368 | - { | |
369 | - id: buildUUID(), | |
370 | - | |
371 | - custom: true, | |
372 | - dataSpecs: { | |
373 | - dataType: 'TEXT', | |
374 | - length: 64, | |
375 | - }, | |
376 | - dataType: 'TEXT', | |
377 | - direction: 'PARAM_INPUT', | |
378 | - identifier: 'ModelVersion', | |
379 | - name: '模型版本', | |
380 | - paraOrder: 7, | |
381 | - }, | |
382 | - { | |
383 | - id: buildUUID(), | |
384 | - | |
385 | - custom: true, | |
386 | - dataSpecs: { | |
387 | - dataType: 'TEXT', | |
388 | - length: 1024, | |
389 | - }, | |
390 | - dataType: 'TEXT', | |
391 | - direction: 'PARAM_INPUT', | |
392 | - identifier: 'ModelURL', | |
393 | - name: '模型地址', | |
394 | - paraOrder: 8, | |
395 | - }, | |
396 | - { | |
397 | - id: buildUUID(), | |
398 | - | |
399 | - custom: true, | |
400 | - dataSpecs: { | |
401 | - dataType: 'TEXT', | |
402 | - length: 128, | |
403 | - }, | |
404 | - dataType: 'TEXT', | |
405 | - direction: 'PARAM_INPUT', | |
406 | - identifier: 'ModelMD5', | |
407 | - name: '模型文件MD5', | |
408 | - paraOrder: 9, | |
409 | - }, | |
410 | - { | |
411 | - id: buildUUID(), | |
412 | - | |
413 | - custom: true, | |
414 | - dataSpecs: { | |
415 | - dataType: 'TEXT', | |
416 | - length: 64, | |
417 | - }, | |
418 | - dataType: 'TEXT', | |
419 | - direction: 'PARAM_INPUT', | |
420 | - identifier: 'ModelPlatform', | |
421 | - name: '模型平台', | |
422 | - paraOrder: 10, | |
423 | - }, | |
424 | - { | |
425 | - id: buildUUID(), | |
426 | - | |
427 | - custom: true, | |
428 | - dataSpecs: { | |
429 | - dataType: 'TEXT', | |
430 | - length: 128, | |
431 | - }, | |
432 | - dataType: 'TEXT', | |
433 | - direction: 'PARAM_INPUT', | |
434 | - identifier: 'ModelTaskID', | |
435 | - name: '模型生成任务ID', | |
436 | - paraOrder: 11, | |
437 | - }, | |
438 | - { | |
439 | - id: buildUUID(), | |
440 | - | |
441 | - custom: true, | |
442 | - dataSpecs: { | |
443 | - dataType: 'TEXT', | |
444 | - length: 64, | |
445 | - }, | |
446 | - dataType: 'TEXT', | |
447 | - direction: 'PARAM_INPUT', | |
448 | - identifier: 'ModelEncryptType', | |
449 | - name: '模型加密方式', | |
450 | - paraOrder: 12, | |
383 | + identifier: 'Switch', | |
384 | + name: '功能开关', | |
385 | + paraOrder: 2, | |
451 | 386 | }, |
452 | 387 | { |
453 | - id: buildUUID(), | |
454 | - | |
455 | 388 | custom: true, |
456 | - dataSpecs: { | |
457 | - dataType: 'TEXT', | |
458 | - length: 2048, | |
459 | - }, | |
460 | - dataType: 'TEXT', | |
389 | + dataSpecsList: [ | |
390 | + { | |
391 | + dataType: 'BOOL', | |
392 | + name: '关', | |
393 | + value: 0, | |
394 | + }, | |
395 | + { | |
396 | + dataType: 'BOOL', | |
397 | + name: '开', | |
398 | + value: 1, | |
399 | + }, | |
400 | + ], | |
401 | + dataType: 'BOOL', | |
461 | 402 | direction: 'PARAM_INPUT', |
462 | - identifier: 'ModelExtension', | |
463 | - name: '扩展信息', | |
464 | - paraOrder: 13, | |
403 | + identifier: 'NumThreads', | |
404 | + name: '使用线程数', | |
405 | + paraOrder: 3, | |
465 | 406 | }, |
466 | 407 | { |
467 | - id: buildUUID(), | |
468 | - | |
469 | 408 | custom: true, |
470 | 409 | dataSpecsList: [ |
471 | 410 | { |
472 | - id: buildUUID(), | |
473 | - | |
474 | - childDataType: 'TEXT', | |
475 | - childName: '模型结构体参数1', | |
476 | - childSpecsDTO: { | |
477 | - dataType: 'TEXT', | |
478 | - length: 10240, | |
479 | - }, | |
480 | - custom: true, | |
481 | - dataSpecs: { | |
482 | - dataType: 'TEXT', | |
483 | - length: 10240, | |
484 | - }, | |
485 | - dataType: 'STRUCT', | |
486 | - identifier: 'ModelParams1', | |
487 | - isStd: 0, | |
488 | - name: '模型结构体参数1', | |
489 | - }, | |
490 | - { | |
491 | - id: buildUUID(), | |
492 | - | |
493 | 411 | childDataType: 'BOOL', |
494 | 412 | childEnumSpecsDTO: [ |
495 | 413 | { |
496 | 414 | dataType: 'BOOL', |
497 | - name: '1', | |
415 | + name: '关1', | |
498 | 416 | value: 0, |
499 | 417 | }, |
500 | 418 | { |
501 | 419 | dataType: 'BOOL', |
502 | - name: '0', | |
420 | + name: '开1', | |
503 | 421 | value: 1, |
504 | 422 | }, |
505 | 423 | ], |
506 | - childName: '模型结构体参数2', | |
424 | + childName: '结构体里面1', | |
507 | 425 | custom: true, |
508 | 426 | dataSpecsList: [ |
509 | 427 | { |
510 | - id: buildUUID(), | |
511 | - | |
512 | 428 | dataType: 'BOOL', |
513 | - name: '1', | |
429 | + name: '关1', | |
514 | 430 | value: 0, |
515 | 431 | }, |
516 | 432 | { |
517 | - id: buildUUID(), | |
518 | - | |
519 | 433 | dataType: 'BOOL', |
520 | - name: '0', | |
434 | + name: '开1', | |
521 | 435 | value: 1, |
522 | 436 | }, |
523 | 437 | ], |
524 | 438 | dataType: 'STRUCT', |
525 | - identifier: 'ModelParams2', | |
439 | + identifier: 's11', | |
526 | 440 | isStd: 0, |
527 | - name: '模型结构体参数2', | |
441 | + name: '结构体里面1', | |
528 | 442 | }, |
529 | - ], | |
530 | - dataType: 'STRUCT', | |
531 | - direction: 'PARAM_INPUT', | |
532 | - identifier: 'ModelStruct', | |
533 | - name: '模型结构体', | |
534 | - paraOrder: 3, | |
535 | - }, | |
536 | - ], | |
537 | - outputParams: [ | |
538 | - { | |
539 | - id: buildUUID(), | |
540 | - | |
541 | - custom: true, | |
542 | - dataSpecs: { | |
543 | - dataType: 'TEXT', | |
544 | - length: 10240, | |
545 | - }, | |
546 | - dataType: 'TEXT', | |
547 | - direction: 'PARAM_OUTPUT', | |
548 | - identifier: 'Django', | |
549 | - name: 'django', | |
550 | - paraOrder: 0, | |
551 | - }, | |
552 | - { | |
553 | - id: buildUUID(), | |
554 | - | |
555 | - custom: true, | |
556 | - dataSpecsList: [ | |
557 | 443 | { |
558 | - id: buildUUID(), | |
559 | - | |
560 | - dataType: 'BOOL', | |
561 | - name: '1', | |
562 | - value: 0, | |
444 | + childDataType: 'TEXT', | |
445 | + childName: '结构体里面2', | |
446 | + childSpecsDTO: { | |
447 | + dataType: 'TEXT', | |
448 | + length: 10240, | |
449 | + }, | |
450 | + custom: true, | |
451 | + dataSpecs: { | |
452 | + dataType: 'TEXT', | |
453 | + length: 10240, | |
454 | + }, | |
455 | + dataType: 'STRUCT', | |
456 | + identifier: 's2', | |
457 | + isStd: 0, | |
458 | + name: '结构体里面2', | |
563 | 459 | }, |
564 | 460 | { |
565 | - id: buildUUID(), | |
566 | - dataType: 'BOOL', | |
567 | - name: '0', | |
568 | - value: 1, | |
461 | + childDataType: 'DOUBLE', | |
462 | + childName: '结构体里面3', | |
463 | + childSpecsDTO: { | |
464 | + dataType: 'DOUBLE', | |
465 | + max: '22', | |
466 | + min: '11', | |
467 | + step: '3', | |
468 | + unit: 'mm/s', | |
469 | + unitName: '毫米每秒', | |
470 | + }, | |
471 | + custom: true, | |
472 | + dataSpecs: { | |
473 | + dataType: 'DOUBLE', | |
474 | + max: '22', | |
475 | + min: '11', | |
476 | + step: '3', | |
477 | + unit: 'mm/s', | |
478 | + unitName: '毫米每秒', | |
479 | + }, | |
480 | + dataType: 'STRUCT', | |
481 | + identifier: 's3', | |
482 | + isStd: 0, | |
483 | + name: '结构体里面3', | |
569 | 484 | }, |
570 | 485 | ], |
571 | - dataType: 'BOOL', | |
572 | - direction: 'PARAM_OUTPUT', | |
573 | - identifier: 'Flask', | |
574 | - name: 'flask', | |
575 | - paraOrder: 1, | |
576 | - }, | |
577 | - { | |
578 | - id: buildUUID(), | |
579 | - custom: true, | |
580 | - dataSpecs: { | |
581 | - dataType: 'INT', | |
582 | - max: '22', | |
583 | - min: '11', | |
584 | - step: '3', | |
585 | - unit: '只', | |
586 | - unitName: '只', | |
587 | - }, | |
588 | - dataType: 'INT', | |
589 | - direction: 'PARAM_OUTPUT', | |
590 | - identifier: 'Tornado', | |
591 | - name: 'tornado', | |
592 | - paraOrder: 2, | |
486 | + dataType: 'STRUCT', | |
487 | + direction: 'PARAM_INPUT', | |
488 | + identifier: 's1', | |
489 | + name: '结构体1', | |
490 | + paraOrder: 4, | |
593 | 491 | }, |
594 | 492 | ], |
493 | + outputParams: [], | |
595 | 494 | productKey: 'hsrnXEfGFDv', |
596 | 495 | required: false, |
597 | - serviceName: '更新模型', | |
496 | + serviceName: '配置模型', | |
598 | 497 | }, |
599 | 498 | ], |
499 | + // services: [ | |
500 | + // { | |
501 | + // callType: 'SYNC', | |
502 | + // createTs: 1666603858325, | |
503 | + // custom: true, | |
504 | + // description: '更新模型', | |
505 | + // identifier: 'UpdateModel', | |
506 | + // inputParams: [ | |
507 | + // { | |
508 | + // id: buildUUID(), | |
509 | + // custom: true, | |
510 | + // dataSpecs: { | |
511 | + // dataType: 'TEXT', | |
512 | + // length: 128, | |
513 | + // }, | |
514 | + // dataType: 'TEXT', | |
515 | + // direction: 'PARAM_INPUT', | |
516 | + // identifier: 'UpdateTaskID', | |
517 | + // name: '更新任务ID', | |
518 | + // paraOrder: 0, | |
519 | + // }, | |
520 | + // { | |
521 | + // id: buildUUID(), | |
522 | + // custom: true, | |
523 | + // dataSpecs: { | |
524 | + // dataType: 'TEXT', | |
525 | + // length: 128, | |
526 | + // }, | |
527 | + // dataType: 'TEXT', | |
528 | + // direction: 'PARAM_INPUT', | |
529 | + // identifier: 'AlgorithmID', | |
530 | + // name: '算法任务唯一标识', | |
531 | + // paraOrder: 1, | |
532 | + // }, | |
533 | + // { | |
534 | + // id: buildUUID(), | |
535 | + | |
536 | + // custom: true, | |
537 | + // dataSpecs: { | |
538 | + // dataType: 'TEXT', | |
539 | + // length: 64, | |
540 | + // }, | |
541 | + // dataType: 'TEXT', | |
542 | + // direction: 'PARAM_INPUT', | |
543 | + // identifier: 'AlgorithmName', | |
544 | + // name: '算法名称', | |
545 | + // paraOrder: 2, | |
546 | + // }, | |
547 | + // { | |
548 | + // id: buildUUID(), | |
549 | + | |
550 | + // custom: true, | |
551 | + // dataSpecs: { | |
552 | + // dataType: 'INT', | |
553 | + // max: '128', | |
554 | + // min: '0', | |
555 | + // precise: 0, | |
556 | + // step: '1', | |
557 | + // unit: '', | |
558 | + // unitName: '无', | |
559 | + // }, | |
560 | + // dataType: 'INT', | |
561 | + // direction: 'PARAM_INPUT', | |
562 | + // identifier: 'NumThreads', | |
563 | + // name: '使用线程数', | |
564 | + // paraOrder: 4, | |
565 | + // }, | |
566 | + // { | |
567 | + // id: buildUUID(), | |
568 | + | |
569 | + // custom: true, | |
570 | + // dataSpecs: { | |
571 | + // dataType: 'TEXT', | |
572 | + // length: 128, | |
573 | + // }, | |
574 | + // dataType: 'TEXT', | |
575 | + // direction: 'PARAM_INPUT', | |
576 | + // identifier: 'ModelID', | |
577 | + // name: '模型唯一标识', | |
578 | + // paraOrder: 5, | |
579 | + // }, | |
580 | + // { | |
581 | + // id: buildUUID(), | |
582 | + | |
583 | + // custom: true, | |
584 | + // dataSpecs: { | |
585 | + // dataType: 'TEXT', | |
586 | + // length: 64, | |
587 | + // }, | |
588 | + // dataType: 'TEXT', | |
589 | + // direction: 'PARAM_INPUT', | |
590 | + // identifier: 'ModelName', | |
591 | + // name: '模型名称', | |
592 | + // paraOrder: 6, | |
593 | + // }, | |
594 | + // { | |
595 | + // id: buildUUID(), | |
596 | + | |
597 | + // custom: true, | |
598 | + // dataSpecs: { | |
599 | + // dataType: 'TEXT', | |
600 | + // length: 64, | |
601 | + // }, | |
602 | + // dataType: 'TEXT', | |
603 | + // direction: 'PARAM_INPUT', | |
604 | + // identifier: 'ModelVersion', | |
605 | + // name: '模型版本', | |
606 | + // paraOrder: 7, | |
607 | + // }, | |
608 | + // { | |
609 | + // id: buildUUID(), | |
610 | + | |
611 | + // custom: true, | |
612 | + // dataSpecs: { | |
613 | + // dataType: 'TEXT', | |
614 | + // length: 1024, | |
615 | + // }, | |
616 | + // dataType: 'TEXT', | |
617 | + // direction: 'PARAM_INPUT', | |
618 | + // identifier: 'ModelURL', | |
619 | + // name: '模型地址', | |
620 | + // paraOrder: 8, | |
621 | + // }, | |
622 | + // { | |
623 | + // id: buildUUID(), | |
624 | + | |
625 | + // custom: true, | |
626 | + // dataSpecs: { | |
627 | + // dataType: 'TEXT', | |
628 | + // length: 128, | |
629 | + // }, | |
630 | + // dataType: 'TEXT', | |
631 | + // direction: 'PARAM_INPUT', | |
632 | + // identifier: 'ModelMD5', | |
633 | + // name: '模型文件MD5', | |
634 | + // paraOrder: 9, | |
635 | + // }, | |
636 | + // { | |
637 | + // id: buildUUID(), | |
638 | + | |
639 | + // custom: true, | |
640 | + // dataSpecs: { | |
641 | + // dataType: 'TEXT', | |
642 | + // length: 64, | |
643 | + // }, | |
644 | + // dataType: 'TEXT', | |
645 | + // direction: 'PARAM_INPUT', | |
646 | + // identifier: 'ModelPlatform', | |
647 | + // name: '模型平台', | |
648 | + // paraOrder: 10, | |
649 | + // }, | |
650 | + // { | |
651 | + // id: buildUUID(), | |
652 | + | |
653 | + // custom: true, | |
654 | + // dataSpecs: { | |
655 | + // dataType: 'TEXT', | |
656 | + // length: 128, | |
657 | + // }, | |
658 | + // dataType: 'TEXT', | |
659 | + // direction: 'PARAM_INPUT', | |
660 | + // identifier: 'ModelTaskID', | |
661 | + // name: '模型生成任务ID', | |
662 | + // paraOrder: 11, | |
663 | + // }, | |
664 | + // { | |
665 | + // id: buildUUID(), | |
666 | + | |
667 | + // custom: true, | |
668 | + // dataSpecs: { | |
669 | + // dataType: 'TEXT', | |
670 | + // length: 64, | |
671 | + // }, | |
672 | + // dataType: 'TEXT', | |
673 | + // direction: 'PARAM_INPUT', | |
674 | + // identifier: 'ModelEncryptType', | |
675 | + // name: '模型加密方式', | |
676 | + // paraOrder: 12, | |
677 | + // }, | |
678 | + // { | |
679 | + // id: buildUUID(), | |
680 | + | |
681 | + // custom: true, | |
682 | + // dataSpecs: { | |
683 | + // dataType: 'TEXT', | |
684 | + // length: 2048, | |
685 | + // }, | |
686 | + // dataType: 'TEXT', | |
687 | + // direction: 'PARAM_INPUT', | |
688 | + // identifier: 'ModelExtension', | |
689 | + // name: '扩展信息', | |
690 | + // paraOrder: 13, | |
691 | + // }, | |
692 | + // { | |
693 | + // id: buildUUID(), | |
694 | + | |
695 | + // custom: true, | |
696 | + // dataSpecsList: [ | |
697 | + // { | |
698 | + // id: buildUUID(), | |
699 | + | |
700 | + // childDataType: 'TEXT', | |
701 | + // childName: '模型结构体参数1', | |
702 | + // childSpecsDTO: { | |
703 | + // dataType: 'TEXT', | |
704 | + // length: 10240, | |
705 | + // }, | |
706 | + // custom: true, | |
707 | + // dataSpecs: { | |
708 | + // dataType: 'TEXT', | |
709 | + // length: 10240, | |
710 | + // }, | |
711 | + // dataType: 'STRUCT', | |
712 | + // identifier: 'ModelParams1', | |
713 | + // isStd: 0, | |
714 | + // name: '模型结构体参数1', | |
715 | + // }, | |
716 | + // { | |
717 | + // id: buildUUID(), | |
718 | + | |
719 | + // childDataType: 'BOOL', | |
720 | + // childEnumSpecsDTO: [ | |
721 | + // { | |
722 | + // dataType: 'BOOL', | |
723 | + // name: '1', | |
724 | + // value: 0, | |
725 | + // }, | |
726 | + // { | |
727 | + // dataType: 'BOOL', | |
728 | + // name: '0', | |
729 | + // value: 1, | |
730 | + // }, | |
731 | + // ], | |
732 | + // childName: '模型结构体参数2', | |
733 | + // custom: true, | |
734 | + // dataSpecsList: [ | |
735 | + // { | |
736 | + // id: buildUUID(), | |
737 | + | |
738 | + // dataType: 'BOOL', | |
739 | + // name: '1', | |
740 | + // value: 0, | |
741 | + // }, | |
742 | + // { | |
743 | + // id: buildUUID(), | |
744 | + | |
745 | + // dataType: 'BOOL', | |
746 | + // name: '0', | |
747 | + // value: 1, | |
748 | + // }, | |
749 | + // ], | |
750 | + // dataType: 'STRUCT', | |
751 | + // identifier: 'ModelParams2', | |
752 | + // isStd: 0, | |
753 | + // name: '模型结构体参数2', | |
754 | + // }, | |
755 | + // ], | |
756 | + // dataType: 'STRUCT', | |
757 | + // direction: 'PARAM_INPUT', | |
758 | + // identifier: 'ModelStruct', | |
759 | + // name: '模型结构体', | |
760 | + // paraOrder: 3, | |
761 | + // }, | |
762 | + // ], | |
763 | + // outputParams: [ | |
764 | + // { | |
765 | + // id: buildUUID(), | |
766 | + | |
767 | + // custom: true, | |
768 | + // dataSpecs: { | |
769 | + // dataType: 'TEXT', | |
770 | + // length: 10240, | |
771 | + // }, | |
772 | + // dataType: 'TEXT', | |
773 | + // direction: 'PARAM_OUTPUT', | |
774 | + // identifier: 'Django', | |
775 | + // name: 'django', | |
776 | + // paraOrder: 0, | |
777 | + // }, | |
778 | + // { | |
779 | + // id: buildUUID(), | |
780 | + | |
781 | + // custom: true, | |
782 | + // dataSpecsList: [ | |
783 | + // { | |
784 | + // id: buildUUID(), | |
785 | + | |
786 | + // dataType: 'BOOL', | |
787 | + // name: '1', | |
788 | + // value: 0, | |
789 | + // }, | |
790 | + // { | |
791 | + // id: buildUUID(), | |
792 | + // dataType: 'BOOL', | |
793 | + // name: '0', | |
794 | + // value: 1, | |
795 | + // }, | |
796 | + // ], | |
797 | + // dataType: 'BOOL', | |
798 | + // direction: 'PARAM_OUTPUT', | |
799 | + // identifier: 'Flask', | |
800 | + // name: 'flask', | |
801 | + // paraOrder: 1, | |
802 | + // }, | |
803 | + // { | |
804 | + // id: buildUUID(), | |
805 | + // custom: true, | |
806 | + // dataSpecs: { | |
807 | + // dataType: 'INT', | |
808 | + // max: '22', | |
809 | + // min: '11', | |
810 | + // step: '3', | |
811 | + // unit: '只', | |
812 | + // unitName: '只', | |
813 | + // }, | |
814 | + // dataType: 'INT', | |
815 | + // direction: 'PARAM_OUTPUT', | |
816 | + // identifier: 'Tornado', | |
817 | + // name: 'tornado', | |
818 | + // paraOrder: 2, | |
819 | + // }, | |
820 | + // ], | |
821 | + // productKey: 'hsrnXEfGFDv', | |
822 | + // required: false, | |
823 | + // serviceName: '更新模型', | |
824 | + // }, | |
825 | + // ], | |
600 | 826 | }; | ... | ... |
src/views/device/profiles/step/cpns/physical/cpns/mock.json
deleted
100644 → 0
1 | -// { | |
2 | -// "_ppk": {}, | |
3 | -// "events": [], | |
4 | -// "productKey": "hsrnXEfGFDv", | |
5 | -// "properties": [ | |
6 | -// { | |
7 | -// "createTs": 1667876342551, | |
8 | -// "custom": true, | |
9 | -// "customFlag": true, | |
10 | -// "dataSpecs": { | |
11 | -// "dataType": "INT", | |
12 | -// "max": "1024", | |
13 | -// "min": "-1024", | |
14 | -// "step": "1", | |
15 | -// "unit": "" | |
16 | -// }, | |
17 | -// "dataType": "INT", | |
18 | -// "description": "内容推荐。0:未知状态,1:熄屏,2:亮屏", | |
19 | -// "identifier": "RunningState", | |
20 | -// "name": "运行状态", | |
21 | -// "productKey": "hsrnXEfGFDv", | |
22 | -// "required": false, | |
23 | -// "rwFlag": "READ_WRITE", | |
24 | -// "std": false | |
25 | -// } | |
26 | -// ], | |
27 | -// "services": [] | |
28 | -// } | |
29 | - | |
30 | -// { | |
31 | -// "_ppk": {}, | |
32 | -// "events": [], | |
33 | -// "productKey": "hsrnXEfGFDv", | |
34 | -// "properties": [ | |
35 | -// { | |
36 | -// "createTs": 1667876342551, | |
37 | -// "custom": true, | |
38 | -// "customFlag": true, | |
39 | -// "dataSpecs": { | |
40 | -// "dataType": "DOUBLE", | |
41 | -// "max": "20", | |
42 | -// "min": "10", | |
43 | -// "step": "3", | |
44 | -// "unit": "var", | |
45 | -// "unitName": "乏" | |
46 | -// }, | |
47 | -// "dataType": "DOUBLE", | |
48 | -// "description": "内容推荐", | |
49 | -// "identifier": "Brightness", | |
50 | -// "name": "亮度百分比", | |
51 | -// "productKey": "hsrnXEfGFDv", | |
52 | -// "required": false, | |
53 | -// "rwFlag": "READ_WRITE", | |
54 | -// "std": false | |
55 | -// } | |
56 | -// ], | |
57 | -// "services": [] | |
58 | -// } | |
59 | - | |
60 | -// { | |
61 | -// "_ppk": {}, | |
62 | -// "events": [], | |
63 | -// "productKey": "hsrnXEfGFDv", | |
64 | -// "properties": [ | |
65 | -// { | |
66 | -// "createTs": 1667876342551, | |
67 | -// "custom": true, | |
68 | -// "customFlag": true, | |
69 | -// "dataSpecs": { | |
70 | -// "dataType": "TEXT", | |
71 | -// "length": 10240 | |
72 | -// }, | |
73 | -// "dataType": "TEXT", | |
74 | -// "description": "内容推荐", | |
75 | -// "identifier": "Brightness", | |
76 | -// "name": "亮度百分比", | |
77 | -// "productKey": "hsrnXEfGFDv", | |
78 | -// "required": false, | |
79 | -// "rwFlag": "READ_WRITE", | |
80 | -// "std": false | |
81 | -// } | |
82 | -// ], | |
83 | -// "services": [] | |
84 | -// } | |
85 | - | |
86 | -// { | |
87 | -// "_ppk": {}, | |
88 | -// "events": [], | |
89 | -// "productKey": "hsrnXEfGFDv", | |
90 | -// "properties": [ | |
91 | -// { | |
92 | -// "createTs": 1667876342551, | |
93 | -// "custom": true, | |
94 | -// "customFlag": true, | |
95 | -// "dataSpecsList": [ | |
96 | -// { | |
97 | -// "childDataType": "INT", | |
98 | -// "childName": "int类型", | |
99 | -// "childSpecsDTO": { | |
100 | -// "dataType": "INT", | |
101 | -// "max": "22", | |
102 | -// "min": "11", | |
103 | -// "step": "3", | |
104 | -// "unit": "mg/kg", | |
105 | -// "unitName": "毫克每千克" | |
106 | -// }, | |
107 | -// "custom": true, | |
108 | -// "dataSpecs": { | |
109 | -// "dataType": "INT", | |
110 | -// "max": "22", | |
111 | -// "min": "11", | |
112 | -// "step": "3", | |
113 | -// "unit": "mg/kg", | |
114 | -// "unitName": "毫克每千克" | |
115 | -// }, | |
116 | -// "dataType": "STRUCT", | |
117 | -// "identifier": "int", | |
118 | -// "isStd": 0, | |
119 | -// "name": "int类型" | |
120 | -// }, | |
121 | -// { | |
122 | -// "childDataType": "BOOL", | |
123 | -// "childEnumSpecsDTO": [ | |
124 | -// { | |
125 | -// "dataType": "BOOL", | |
126 | -// "name": "222", | |
127 | -// "value": 0 | |
128 | -// }, | |
129 | -// { | |
130 | -// "dataType": "BOOL", | |
131 | -// "name": "1111", | |
132 | -// "value": 1 | |
133 | -// } | |
134 | -// ], | |
135 | -// "childName": "bool类型", | |
136 | -// "custom": true, | |
137 | -// "dataSpecsList": [ | |
138 | -// { | |
139 | -// "dataType": "BOOL", | |
140 | -// "name": "222", | |
141 | -// "value": 0 | |
142 | -// }, | |
143 | -// { | |
144 | -// "dataType": "BOOL", | |
145 | -// "name": "1111", | |
146 | -// "value": 1 | |
147 | -// } | |
148 | -// ], | |
149 | -// "dataType": "STRUCT", | |
150 | -// "identifier": "bool", | |
151 | -// "isStd": 0, | |
152 | -// "name": "bool类型" | |
153 | -// }, | |
154 | -// { | |
155 | -// "childDataType": "TEXT", | |
156 | -// "childName": "text类型", | |
157 | -// "childSpecsDTO": { | |
158 | -// "dataType": "TEXT", | |
159 | -// "length": 10240 | |
160 | -// }, | |
161 | -// "custom": true, | |
162 | -// "dataSpecs": { | |
163 | -// "dataType": "TEXT", | |
164 | -// "length": 10240 | |
165 | -// }, | |
166 | -// "dataType": "STRUCT", | |
167 | -// "identifier": "text", | |
168 | -// "isStd": 0, | |
169 | -// "name": "text类型" | |
170 | -// } | |
171 | -// ], | |
172 | -// "dataType": "STRUCT", | |
173 | -// "description": "内容推荐", | |
174 | -// "identifier": "Brightness", | |
175 | -// "name": "亮度百分比", | |
176 | -// "productKey": "hsrnXEfGFDv", | |
177 | -// "required": false, | |
178 | -// "rwFlag": "READ_WRITE", | |
179 | -// "std": false | |
180 | -// } | |
181 | -// ], | |
182 | -// "services": [] | |
183 | -// } | |
184 | - | |
185 | - | |
186 | -{ | |
187 | - "_ppk": {}, | |
188 | - "events": [], | |
189 | - "productKey": "hsrnXEfGFDv", | |
190 | - "properties": [ | |
191 | - { | |
192 | - "createTs": 1667876342551, | |
193 | - "custom": true, | |
194 | - "customFlag": true, | |
195 | - "dataSpecsList": [ | |
196 | - { | |
197 | - "childDataType": "INT", | |
198 | - "childName": "int类型", | |
199 | - "childSpecsDTO": { | |
200 | - "dataType": "INT", | |
201 | - "max": "22", | |
202 | - "min": "11", | |
203 | - "step": "3", | |
204 | - "unit": "mg/kg", | |
205 | - "unitName": "毫克每千克" | |
206 | - }, | |
207 | - "custom": true, | |
208 | - "dataSpecs": { | |
209 | - "dataType": "INT", | |
210 | - "max": "22", | |
211 | - "min": "11", | |
212 | - "step": "3", | |
213 | - "unit": "mg/kg", | |
214 | - "unitName": "毫克每千克" | |
215 | - }, | |
216 | - "dataType": "STRUCT", | |
217 | - "identifier": "int", | |
218 | - "isStd": 0, | |
219 | - "name": "int类型" | |
220 | - }, | |
221 | - { | |
222 | - "childDataType": "BOOL", | |
223 | - "childEnumSpecsDTO": [ | |
224 | - { | |
225 | - "dataType": "BOOL", | |
226 | - "name": "222", | |
227 | - "value": 0 | |
228 | - }, | |
229 | - { | |
230 | - "dataType": "BOOL", | |
231 | - "name": "1111", | |
232 | - "value": 1 | |
233 | - } | |
234 | - ], | |
235 | - "childName": "bool类型", | |
236 | - "custom": true, | |
237 | - "dataSpecsList": [ | |
238 | - { | |
239 | - "dataType": "BOOL", | |
240 | - "name": "222", | |
241 | - "value": 0 | |
242 | - }, | |
243 | - { | |
244 | - "dataType": "BOOL", | |
245 | - "name": "1111", | |
246 | - "value": 1 | |
247 | - } | |
248 | - ], | |
249 | - "dataType": "STRUCT", | |
250 | - "identifier": "bool", | |
251 | - "isStd": 0, | |
252 | - "name": "bool类型" | |
253 | - }, | |
254 | - { | |
255 | - "childDataType": "TEXT", | |
256 | - "childName": "text类型", | |
257 | - "childSpecsDTO": { | |
258 | - "dataType": "TEXT", | |
259 | - "length": 10240 | |
260 | - }, | |
261 | - "custom": true, | |
262 | - "dataSpecs": { | |
263 | - "dataType": "TEXT", | |
264 | - "length": 10240 | |
265 | - }, | |
266 | - "dataType": "STRUCT", | |
267 | - "identifier": "text", | |
268 | - "isStd": 0, | |
269 | - "name": "text类型" | |
270 | - } | |
271 | - ], | |
272 | - "dataType": "STRUCT", | |
273 | - "description": "内容推荐", | |
274 | - "identifier": "Brightness", | |
275 | - "name": "亮度百分比", | |
276 | - "productKey": "hsrnXEfGFDv", | |
277 | - "required": false, | |
278 | - "rwFlag": "READ_WRITE", | |
279 | - "std": false | |
280 | - } | |
281 | - ], | |
282 | - "services": [ | |
283 | - { | |
284 | - "callType": "SYNC", | |
285 | - "createTs": 1667901147172, | |
286 | - "custom": true, | |
287 | - "identifier": "DeleteModel", | |
288 | - "inputParams": [ | |
289 | - { | |
290 | - "custom": true, | |
291 | - "dataSpecsList": [ | |
292 | - { | |
293 | - "childDataType": "INT", | |
294 | - "childName": "a", | |
295 | - "childSpecsDTO": { | |
296 | - "dataType": "INT", | |
297 | - "max": "22", | |
298 | - "min": "11", | |
299 | - "step": "3", | |
300 | - "unit": "W/㎡", | |
301 | - "unitName": "太阳总辐射" | |
302 | - }, | |
303 | - "custom": true, | |
304 | - "dataSpecs": { | |
305 | - "dataType": "INT", | |
306 | - "max": "22", | |
307 | - "min": "11", | |
308 | - "step": "3", | |
309 | - "unit": "W/㎡", | |
310 | - "unitName": "太阳总辐射" | |
311 | - }, | |
312 | - "dataType": "STRUCT", | |
313 | - "identifier": "a", | |
314 | - "isStd": 0, | |
315 | - "name": "a" | |
316 | - }, | |
317 | - { | |
318 | - "childDataType": "BOOL", | |
319 | - "childEnumSpecsDTO": [ | |
320 | - { | |
321 | - "dataType": "BOOL", | |
322 | - "name": "2", | |
323 | - "value": 0 | |
324 | - }, | |
325 | - { | |
326 | - "dataType": "BOOL", | |
327 | - "name": "3", | |
328 | - "value": 1 | |
329 | - } | |
330 | - ], | |
331 | - "childName": "b", | |
332 | - "custom": true, | |
333 | - "dataSpecsList": [ | |
334 | - { | |
335 | - "dataType": "BOOL", | |
336 | - "name": "2", | |
337 | - "value": 0 | |
338 | - }, | |
339 | - { | |
340 | - "dataType": "BOOL", | |
341 | - "name": "3", | |
342 | - "value": 1 | |
343 | - } | |
344 | - ], | |
345 | - "dataType": "STRUCT", | |
346 | - "identifier": "b", | |
347 | - "isStd": 0, | |
348 | - "name": "b" | |
349 | - } | |
350 | - ], | |
351 | - "dataType": "STRUCT", | |
352 | - "direction": "PARAM_INPUT", | |
353 | - "identifier": "AlgorithmID", | |
354 | - "name": "算法任务唯一标识", | |
355 | - "paraOrder": 0 | |
356 | - } | |
357 | - ], | |
358 | - "outputParams": [], | |
359 | - "productKey": "hsrnXEfGFDv", | |
360 | - "required": false, | |
361 | - "serviceName": "删除模型" | |
362 | - } | |
363 | - ] | |
364 | -} | |
\ No newline at end of file |
1 | 1 | import { validateValueBool, validateValueRangeAndStep } from './useValidateParital'; |
2 | +import { findDictItemByCode } from '/@/api/system/dict'; | |
2 | 3 | |
3 | 4 | ///根据不同数据类型得到不同表单数据 |
4 | 5 | type TForm = { |
... | ... | @@ -49,13 +50,13 @@ export const useChangeTypeGetTypeForm = (type, options: TForm) => { |
49 | 50 | return [ |
50 | 51 | { |
51 | 52 | dataType: options?.dataType, |
52 | - name: '0', | |
53 | - value: options?.boolClose, | |
53 | + name: options?.boolClose, | |
54 | + value: '0', | |
54 | 55 | }, |
55 | 56 | { |
56 | 57 | dataType: options?.dataType, |
57 | - name: '1', | |
58 | - value: options?.boolOpen, | |
58 | + name: options?.boolOpen, | |
59 | + value: '1', | |
59 | 60 | }, |
60 | 61 | ]; |
61 | 62 | case 'TEXT': |
... | ... | @@ -65,3 +66,31 @@ export const useChangeTypeGetTypeForm = (type, options: TForm) => { |
65 | 66 | }; |
66 | 67 | } |
67 | 68 | }; |
69 | + | |
70 | +//是否排除结构体 | |
71 | +export const useUpdateFormExcludeStruct = async (F, U) => { | |
72 | + const res: any = await findDictItemByCode({ dictCode: 'data_type' }); | |
73 | + const optionTrue = res | |
74 | + .map((m) => { | |
75 | + if (F) { | |
76 | + if (m.itemValue !== 'STRUCT') { | |
77 | + return { | |
78 | + value: m.itemValue, | |
79 | + label: m.itemText, | |
80 | + }; | |
81 | + } | |
82 | + } else { | |
83 | + return { | |
84 | + value: m.itemValue, | |
85 | + label: m.itemText, | |
86 | + }; | |
87 | + } | |
88 | + }) | |
89 | + .filter(Boolean); | |
90 | + U({ | |
91 | + field: 'dataType', | |
92 | + componentProps: { | |
93 | + options: optionTrue, | |
94 | + }, | |
95 | + }); | |
96 | +}; | ... | ... |
... | ... | @@ -142,6 +142,7 @@ |
142 | 142 | }; |
143 | 143 | updateOrCreateTenant(req) |
144 | 144 | .then((res) => { |
145 | + console.log(res); | |
145 | 146 | closeDrawer(); //关闭侧框 |
146 | 147 | emit('success'); |
147 | 148 | setTimeout(() => { |
... | ... | @@ -159,9 +160,11 @@ |
159 | 160 | }); |
160 | 161 | } catch (e) { |
161 | 162 | } finally { |
163 | + setTimeout(() => { | |
164 | + setDrawerProps({ confirmLoading: false }); | |
165 | + }, 300); | |
162 | 166 | } |
163 | 167 | } |
164 | - | |
165 | 168 | return { |
166 | 169 | registerDrawer, |
167 | 170 | tenantForm, | ... | ... |