|
@@ -112,11 +112,16 @@
|
|
|
<up-text v-if="state.selectedService" :lines="1" align="right" :text="state.selectedService.name"/>
|
|
|
</template>
|
|
|
</up-cell>
|
|
|
- <up-cell v-if="state.selectedService && state.selectedService.inputData" :title="state.selectedService.inputData.name" :isLink="false">
|
|
|
+ <up-cell
|
|
|
+ v-if="state.selectedService && state.selectedService.inputData"
|
|
|
+ v-for="item in state.selectedService.inputData"
|
|
|
+ :title="item.name"
|
|
|
+ :isLink="false"
|
|
|
+ >
|
|
|
<template #value>
|
|
|
<up-input
|
|
|
- :placeholder="`请输入${state.selectedService.inputData.name}`"
|
|
|
- v-model="state.orderInfo"
|
|
|
+ :placeholder="`请输入${item.name}`"
|
|
|
+ v-model="state.orderInfo[item.identifier]"
|
|
|
></up-input>
|
|
|
</template>
|
|
|
</up-cell>
|
|
@@ -308,7 +313,7 @@ const state = reactive({
|
|
|
serviceDic: {},
|
|
|
serviceList: [],
|
|
|
selectedService: null,
|
|
|
- orderInfo: ""
|
|
|
+ orderInfo: {}
|
|
|
});
|
|
|
const deviceId = ref('')
|
|
|
onLoad((option) => {
|
|
@@ -345,7 +350,7 @@ const qryDeviceService = (metaId) => {
|
|
|
if (res && res.length > 0) {
|
|
|
state.serviceList = res.map((item) => {
|
|
|
const {identifier, inputData, name} = item;
|
|
|
- const inputDataFormat = JSON.parse(inputData)[0];
|
|
|
+ const inputDataFormat = JSON.parse(inputData);
|
|
|
state.serviceDic[identifier] = {
|
|
|
identifier,
|
|
|
name,
|
|
@@ -396,7 +401,7 @@ const submit = () => {
|
|
|
const selectClick = (e) => {
|
|
|
state.serviceShow = false;
|
|
|
state.selectedService = e;
|
|
|
- state.orderInfo = null;
|
|
|
+ state.orderInfo = {};
|
|
|
}
|
|
|
|
|
|
const onCommand = () => {
|
|
@@ -407,9 +412,7 @@ const onCommand = () => {
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- deviceServiceApply(deviceId.value, state.selectedService.value, {
|
|
|
- [state.selectedService.inputData.identifier]: state.orderInfo
|
|
|
- }).then(() => {
|
|
|
+ deviceServiceApply(deviceId.value, state.selectedService.value, state.orderInfo).then(() => {
|
|
|
uToastRef.value.show({
|
|
|
type: 'default',
|
|
|
message: "操作成功",
|