|
|
@@ -49,12 +49,12 @@
|
|
|
@ok="ok"
|
|
|
footer
|
|
|
>
|
|
|
+ <a-form style="width: 100%;" :labelCol="{span: 3}" :wrapperCol="{span: 14}" >
|
|
|
<a-card title="基本信息" >
|
|
|
- <a-form style="width: 100%;" :labelCol="{span: 3}" :wrapperCol="{span: 14}" >
|
|
|
<a-form-item label="设备服务名称" v-bind="validateInfos.label" >
|
|
|
<InputTsx allowClear placeholder="请输入设备服务名称" v-model:value="deviceState.label" />
|
|
|
</a-form-item>
|
|
|
- <a-form-item label="设备id" v-bind="validateInfos.label" >
|
|
|
+ <a-form-item label="设备id" >
|
|
|
<a-select
|
|
|
:value="deviceState.deviceId"
|
|
|
style="width: 170px;"
|
|
|
@@ -74,7 +74,7 @@
|
|
|
<a-form-item label="设备方法" >
|
|
|
<a-input placeholder="请输入设备方法" v-model:value="deviceState.deviceMethod" />
|
|
|
</a-form-item>
|
|
|
- </a-form>
|
|
|
+
|
|
|
</a-card>
|
|
|
<a-card title="第三方服务参数" style="margin-top: 20px;" >
|
|
|
<a-form-item label="ak" >
|
|
|
@@ -109,6 +109,7 @@
|
|
|
<a-input placeholder="比如$.store.book[0].title" v-model:value="deviceState.thirdParam.attributeJsonPath" />
|
|
|
</a-form-item>
|
|
|
</a-card>
|
|
|
+ </a-form>
|
|
|
</RealView>
|
|
|
</template>
|
|
|
<script lang='ts' setup >
|
|
|
@@ -194,7 +195,7 @@ const initDeviceState = {
|
|
|
let deviceState = reactive<TPS.Device>(JSON.parse(JSON.stringify(initDeviceState)))
|
|
|
|
|
|
const { resetFields, validate, validateInfos } = useForm(deviceState, {
|
|
|
- label: [{ required: true, message: '请填写设备名称' }]
|
|
|
+ // label: [{ required: true, message: '请填写设备名称' }]
|
|
|
// thirdCode: [{ required: true, message: '请填写第三方服务code' }]
|
|
|
})
|
|
|
|
|
|
@@ -215,8 +216,11 @@ const search = () => {
|
|
|
const openModal = (type: 'add' | 'update', record?: TPS.Device) => {
|
|
|
opraState.value = type
|
|
|
visible.value = true
|
|
|
- if (opraState.value === 'add') deviceState = Object.assign({}, initDeviceState)
|
|
|
- else deviceState = Object.assign({}, record)
|
|
|
+ if (opraState.value === 'add') {
|
|
|
+ console.log('reactive(initDeviceState):', reactive(JSON.parse(JSON.stringify(initDeviceState))))
|
|
|
+
|
|
|
+ deviceState = reactive(JSON.parse(JSON.stringify(initDeviceState)))
|
|
|
+ } else deviceState = reactive(record)
|
|
|
}
|
|
|
|
|
|
const closeModal = () => {
|