Merge branch 'master' of http://47.115.223.229:8888/yangjun/hldy_yunwei_vue
# Conflicts: # src/views/iot/hs/electricity/components/DrawerModal.vue # src/views/iot/hs/electricity/index.vue
This commit is contained in:
commit
0a3937808e
|
|
@ -5,15 +5,15 @@
|
|||
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
|
||||
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
|
||||
</template>
|
||||
<ElectricityInfoDrawer v-if="visible" ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit"
|
||||
<ElectricityInfoForm v-if="visible" ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit"
|
||||
:formBpm="false">
|
||||
</ElectricityInfoDrawer>
|
||||
</ElectricityInfoForm>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import ElectricityInfoDrawer from './ElectricityInfoForm.vue'
|
||||
import ElectricityInfoForm from './ElectricityInfoForm.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
|
||||
const title = ref<string>('');
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import { useMessage } from '/@/hooks/web/useMessage';
|
|||
import { getValueType } from '/@/utils';
|
||||
import { save } from '../electricity.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
|
|
@ -121,13 +122,8 @@ async function submitForm() {
|
|||
}
|
||||
await save(model)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
createMessage.success(res.message);
|
||||
emit('ok');
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
})
|
||||
}).catch(() =>{})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ enum Api {
|
|||
save = '/iot/hs/dsElectricityMeter/add',
|
||||
delete = '/iot/hs/dsElectricityMeter/delete',
|
||||
eleReset = '/iot/hs/dsElectricityMeter/eleReset',
|
||||
eleCutOff = '/iot/hs/dsElectricityMeter/eleControl',
|
||||
eleConnected = '/iot/hs/dsElectricityMeter/eleControl',
|
||||
eleCutOff = '/iot/hs/dsElectricityMeter/eleCutOff',
|
||||
eleConnected = '/iot/hs/dsElectricityMeter/eleConnected',
|
||||
eleRead = '/iot/hs/dsElectricityMeter/eleRead',
|
||||
}
|
||||
|
||||
|
|
@ -20,13 +20,13 @@ export const list = (params) => defHttp.get({ url: Api.list, params });
|
|||
* 添加
|
||||
* @param params
|
||||
*/
|
||||
export const save = (params) => defHttp.post({ url: Api.save, params });
|
||||
export const save = (params) => defHttp.post({ url: Api.save, params }, { joinParamsToUrl: true });
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
*/
|
||||
export const deleteMeter = (id) => defHttp.delete({ url: Api.delete, params:{ id } }, { joinParamsToUrl: true });
|
||||
export const deleteMeter = (id) => defHttp.post({ url: Api.delete, params:{ id } });
|
||||
|
||||
/**
|
||||
* 电表清零
|
||||
|
|
|
|||
|
|
@ -33,7 +33,13 @@ export const columns: BasicColumn[] = [
|
|||
align: "center",
|
||||
dataIndex: 'relayState',
|
||||
customRender:({record})=>{
|
||||
return record.relayState?(record.relayState=='1'?'合闸':'拉闸'):'';
|
||||
if(record.relayState=='1'){
|
||||
return "合闸";
|
||||
}else if(record.relayState=='0'){
|
||||
return "拉闸";
|
||||
}else{
|
||||
return "未知";
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,11 +8,16 @@
|
|||
</template>
|
||||
<template #bodyCell="{ column, record, index, text }">
|
||||
<template v-if="column.dataIndex === 'relayState'">
|
||||
<span v-if="record.relayState ==null||record.relayState ===''" style="color:red">
|
||||
未知
|
||||
</span>
|
||||
<span v-else>
|
||||
<span v-if="record.relayState ==='1'" style="color:green">
|
||||
合闸
|
||||
</span>
|
||||
<span v-else style="color:red">
|
||||
拉闸
|
||||
<span v-if="record.relayState ==='0'" style="color:red">
|
||||
合闸
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
</template>
|
||||
|
|
@ -43,11 +48,10 @@
|
|||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import {Modal} from "ant-design-vue";
|
||||
import {list, deleteMeter, eleReset, eleCutOff, eleConnected, eleRead} from './electricity.api';
|
||||
import {list, save, deleteMeter, eleReset, eleCutOff, eleConnected, eleRead} from './electricity.api';
|
||||
import { columns, searchFormSchema } from './electricity.data';
|
||||
import {useModal} from "@/components/Modal";
|
||||
import ApiLogModal from "/@/views/iot/tq/electricity/apilog/ApiLogModal.vue";
|
||||
|
||||
import ApiLogModal from "./apilog/ApiLogModal.vue";
|
||||
import DrawerModal from "./components/DrawerModal.vue";
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
|
||||
|
|
@ -66,7 +70,7 @@
|
|||
api: list,
|
||||
columns,
|
||||
canResize:false,
|
||||
showIndexColumn: true,
|
||||
// showIndexColumn: true,
|
||||
formConfig: {
|
||||
//labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
|
|
@ -114,7 +118,11 @@
|
|||
return [
|
||||
{
|
||||
label: '删除',
|
||||
onClick: handleRead.bind(null, record),
|
||||
popConfirm: {
|
||||
title: '是否确认删除数据',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
ifShow: record.izAllocate != 'Y',
|
||||
},
|
||||
{
|
||||
|
|
@ -154,11 +162,16 @@
|
|||
]
|
||||
}
|
||||
|
||||
// 删除
|
||||
async function handleDelete(record: Recordable) {
|
||||
await deleteMeter(record.id);
|
||||
reload();
|
||||
}
|
||||
|
||||
// 抄电表
|
||||
async function handleRead(record: Recordable) {
|
||||
const params = {
|
||||
'cid' : record.cid,
|
||||
'address' : record.address,
|
||||
'sn' : record.sn,
|
||||
};
|
||||
await eleRead(params);
|
||||
reload();
|
||||
|
|
|
|||
Loading…
Reference in New Issue