zhaohy 3 months ago
parent
commit
8b746a307d
  1. BIN
      hx-ai-intelligent/public/asset/file/carbonAssets.xlsx
  2. BIN
      hx-ai-intelligent/public/asset/image/bulbLogo/fault.png
  3. BIN
      hx-ai-intelligent/public/asset/image/bulbLogo/fault1.png
  4. BIN
      hx-ai-intelligent/public/asset/image/bulbLogo/repair.png
  5. 5
      hx-ai-intelligent/src/App.vue
  6. 322
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue
  7. 181
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index1.vue
  8. 8
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/config.ts
  9. 24
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue
  10. 5
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/config.ts
  11. 18
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue
  12. 5
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue
  13. 1
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/config.ts
  14. 76
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue
  15. 30
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue
  16. 17
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/all/index.vue
  17. 33
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/categoryDeatil.vue
  18. 44
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/index.vue
  19. 57
      hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/device.vue
  20. 37
      hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/tabs1.vue
  21. 14
      hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/tabs2.vue
  22. 32
      hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/tabs3.vue
  23. 26
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue
  24. 84
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/light.vue
  25. 37
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/lightPosition.ts
  26. 44
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue
  27. 14
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs2.vue
  28. 31
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs3.vue
  29. 4
      hx-ai-intelligent/src/view/equipmentControl/style/dialogStyle.less
  30. 39
      hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/fanControl.vue
  31. 28
      hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/fanLog.vue
  32. 14
      hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/fanPlant.vue
  33. 14
      lib/component/form/input/input.vue

BIN
hx-ai-intelligent/public/asset/file/carbonAssets.xlsx

Binary file not shown.

BIN
hx-ai-intelligent/public/asset/image/bulbLogo/fault.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
hx-ai-intelligent/public/asset/image/bulbLogo/fault1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
hx-ai-intelligent/public/asset/image/bulbLogo/repair.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

5
hx-ai-intelligent/src/App.vue

@ -1,6 +1,8 @@
<template> <template>
<a-config-provider :locale="locale"> <a-config-provider :locale="locale">
<a-spin :spinning="state.isLoading" size="large">
<router-view /> <router-view />
</a-spin>
</a-config-provider> </a-config-provider>
</template> </template>
@ -10,6 +12,7 @@
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import { items } from '/@/store/item';
export default defineComponent({ export default defineComponent({
name: 'App', name: 'App',
@ -37,6 +40,8 @@
return { return {
cachedViews, cachedViews,
locale: zhCN, locale: zhCN,
//
state: items(),
}; };
}, },
}); });

322
hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue

@ -48,68 +48,27 @@
</div> </div>
<div style="display: flex; margin-top: 20px; height: calc(84% - 20px)"> <div style="display: flex; margin-top: 20px; height: calc(84% - 20px)">
<div class="detailTable"> <div class="detailTable">
<div class="ns-form-title"> <ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" :scroll="{ x: 2000 }">
<div class="title">交易明细</div>
<div class="operation" style="display: flex">
<a-button type="primary" @click="addDetail">新增</a-button>
<a-upload
v-model:file-list="importFileList"
name="file"
accept=".xlsx"
:showUploadList="false"
:custom-request="importFile">
<a-button type="primary" style="margin-left: 6px">导入</a-button>
</a-upload>
<a-button type="primary" style="margin-left: 6px" @click="exportFile">导出</a-button>
<a-button
type="primary"
style="margin-left: 6px"
:disabled="selectedRowKeys.length === 0"
@click="deleteMore"
>批量删除</a-button
>
</div>
</div>
<a-table
:columns="columns"
:data-source="data"
rowKey="id"
@change="onChange"
:rowSelection="{
selectedRowKeys: selectedRowKeys,
onChange: onSelectionChange,
}"
:scroll="{ x: 1500, y: 400 }"
:pagination="false">
<template #bodyCell="{ column, text, record }"> <template #bodyCell="{ column, text, record }">
<template v-if="column.dataIndex === 'accountType'"> <template v-if="column.dataIndex === 'accountType'">
<span v-if="record.accountType">{{ record.accountType.label }}</span> <span v-if="record.accountType">{{ record.accountType.label }}</span>
</template> </template>
<template v-if="column.key === 'action'">
<span>
<a @click="editData(record)">编辑</a>
<a-divider type="vertical" />
<a @click="delData(record)">删除</a>
</span>
</template>
</template> </template>
</a-table> </ns-view-list-table>
<a-pagination
:current="queryParams.pageNum"
:total="total"
:page-size="queryParams.pageSize"
style="display: flex; justify-content: center; margin-top: 16px"
:show-size-changer="true"
:show-quick-jumper="true"
@change="onChange" />
</div> </div>
<div class="total"> <div class="total">
<div class="ns-form-title"> <div class="ns-form-title">
<div class="title">配额统计</div> <div class="title">配额统计</div>
<div class="operation" style="display: flex; justify-content: space-around; width: 63%"> <div class="operation" style="display: flex; justify-content: flex-end; width: 63%">
<a-button type="primary" @click="getTotalTable(1)">全国配额</a-button> <a-button type="primary" v-if="parentId === 1" @click="getTotalTable(1)"
<a-button type="primary" @click="getTotalTable(2)">地方配额</a-button> >全国配额</a-button
<a-button type="primary" @click="getTotalTable(3)">CCER配额</a-button> >
<a-button type="primary" v-if="parentId === 2" @click="getTotalTable(2)"
>地方配额</a-button
>
<a-button type="primary" v-if="parentId === 3" @click="getTotalTable(3)"
>CCER配额</a-button
>
</div> </div>
</div> </div>
<a-table :columns="totalColumns" :data-source="totalData" bordered :pagination="false"> <a-table :columns="totalColumns" :data-source="totalData" bordered :pagination="false">
@ -155,13 +114,25 @@
<a-date-picker v-model:value="formState.transactionDate" valueFormat="YYYY-MM-DD" /> <a-date-picker v-model:value="formState.transactionDate" valueFormat="YYYY-MM-DD" />
</a-form-item> </a-form-item>
<a-form-item ref="name" label="交易数量" name="transactionQuantity"> <a-form-item ref="name" label="交易数量" name="transactionQuantity">
<a-input v-model:value="formState.transactionQuantity" placeholder="请输入交易数量" /> <a-input-number
v-model:value="formState.transactionQuantity"
:maxlength="11"
@keydown="handleKeyDown"
placeholder="请输入交易数量" />
</a-form-item> </a-form-item>
<a-form-item ref="name" label="发生金额" name="amountIncurred"> <a-form-item ref="name" label="发生金额" name="amountIncurred">
<a-input v-model:value="formState.amountIncurred" placeholder="请输入发生金额" /> <a-input-number
v-model:value="formState.amountIncurred"
:maxlength="16"
@keydown="handleKeyDown"
placeholder="请输入发生金额" />
</a-form-item> </a-form-item>
<a-form-item ref="name" label="交易对象" name="tradingPartner"> <a-form-item ref="name" label="交易对象" name="tradingPartner">
<a-input v-model:value="formState.tradingPartner" placeholder="请输入交易对象" /> <a-input
v-model:value="formState.tradingPartner"
:maxlength="20"
@keydown="handleKeyDown"
placeholder="请输入交易对象" />
</a-form-item> </a-form-item>
<a-form-item ref="name" label="交易凭证"> <a-form-item ref="name" label="交易凭证">
<a-upload <a-upload
@ -221,16 +192,20 @@
selectedRowKeys.value = selectedKeys; selectedRowKeys.value = selectedKeys;
}; };
const total = ref<number>(); const total = ref<number>();
const thisYear = ref(new Date().getFullYear().toString()); const year = ref(new Date().getFullYear().toString());
const queryParams = ref({ const queryParams = ref({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
orgId: orgId.value, orgId: orgId.value,
accountType: props.parentId, accountType: props.parentId,
year: thisYear.value, year: year.value,
}); });
const searchTableList = () => { const searchTableList = () => {
getDetailList(); year.value = queryParams.value.year;
transactionType.value = queryParams.value.transactionType;
accountType.value = queryParams.value.accountType;
mainRef.value?.nsTableRef.reload();
// getDetailList();
}; };
// //
const getDetailList = () => { const getDetailList = () => {
@ -239,10 +214,11 @@
total.value = res.data.total; total.value = res.data.total;
}); });
}; };
getDetailList(); // getDetailList();
const columns = [ const columns = [
{ {
title: '序号', title: '序号',
width: 80,
customRender: (text: any) => { customRender: (text: any) => {
return text.index + 1; return text.index + 1;
}, },
@ -298,9 +274,14 @@
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
orgId: orgId.value, orgId: orgId.value,
year: new Date().getFullYear(), accountType: props.parentId,
year: new Date().getFullYear().toString(),
}; };
getDetailList(); accountType.value = props.parentId;
year.value = new Date().getFullYear();
transactionType.value = '';
mainRef.value?.nsTableRef.reload();
// getDetailList();
}; };
const editData = (record) => { const editData = (record) => {
getDictList(); getDictList();
@ -378,6 +359,196 @@
}, },
}); });
}; };
const mainRef = ref();
const transactionType = ref();
const accountType = ref();
accountType.value = props.parentId;
const tableConfig = ref({
title: '数据库',
api: carbonAssets.carbonDetailsList,
params: {
orgId,
accountType,
year,
},
headerActions: [
{
label: '新增',
name: 'userAdd',
type: 'primary',
handle: () => {
text.value = '新增';
visible.value = true;
getDictList();
},
},
{
label: '导入',
type: 'primary',
name: 'carbonAssetsImport',
extra: {
api: carbonAssets.import, //
params: {
orgId,
},
title: '碳资产', // title
templateName: 'carbonAssets', // 使
indexName: '碳资产', //
message: [
{ label: '1、若必填项未填写,则不能进行导入操作' },
{ label: `2、当重复时,则更新数据。` },
{ label: '3、数据将从模版的第五行进行导入。' },
{ label: '4、文件导入勿超过5MB。' },
],
},
},
{
label: '导出',
type: 'primary',
handle: () => {
const exportQuery = ref({
orgId: orgId.value,
pageNum: 1,
pageSize: 999,
year: queryParams.value.year,
ids: selectedRowKeys.value,
});
const config = {
responseType: 'blob',
};
fetch(carbonAssets.export, exportQuery.value, config)
.then((res) => {
// URL blob
const url = window.URL.createObjectURL(new Blob([res]));
// <a>
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'carbonTradeDetails.xlsx'); //
document.body.appendChild(link);
link.click();
// URL
window.URL.revokeObjectURL(url);
selectedRowKeys.value = [];
})
.catch((error) => {
console.error('下载失败:', error);
});
},
},
{
label: '批量删除',
type: 'primary',
name: 'userBatchDel',
dynamicDisabled: (data: any) => {
return data.list.length === 0;
},
confirm: true,
isReload: true,
isClearCheck: true,
api: carbonAssets.delete,
dynamicParams: { ids: 'id[]' },
},
],
columns: [
{
title: '序号',
width: 80,
customRender: (text: any) => {
return text.index + 1;
},
},
{
title: '资产类别',
dataIndex: 'accountType',
},
{
title: '交易方式',
dataIndex: 'transactionTypeName',
},
{
title: '交易日期',
dataIndex: 'transactionDate',
sorter: (a, b) => a.transactionDate - b.transactionDate,
},
{
title: '本期收入(tCO2)',
dataIndex: 'income',
sorter: (a, b) => a.income - b.income,
},
{
title: '本期支出(tCO2)',
dataIndex: 'expenditure',
sorter: (a, b) => a.expenditure - b.expenditure,
},
{
title: '发生金额(¥)',
dataIndex: 'amountIncurredValue',
},
{
title: '交易对象',
dataIndex: 'tradingPartner',
},
{
title: '更新人',
dataIndex: 'updateUser',
},
{
title: '更新时间',
dataIndex: 'updateTime',
},
],
columnActions: {
title: '操作',
actions: [
{
label: '编辑',
name: 'userEdit',
handle: (record: any) => {
getDictList();
text.value = '编辑';
visible.value = true;
formState.value.id = record.id;
fetch(uploadPic.select, { bizId: record.id, bizType: 1 }).then((res) => {
fileList.value = res.data.map((item) => ({
uid: item.id.toString(), // 使id
name: item.fileName, //
status: 'done', //
type: 'done',
url: item.filePath, // URLURL
}));
});
formState.value = JSON.parse(JSON.stringify(record));
if (formState.value.expenditure === 0) {
formState.value.transactionQuantity = formState.value.income;
} else {
formState.value.transactionQuantity = formState.value.expenditure;
}
setTimeout(() => {
let selectDevice = ref([Number(formState.value.transactionType)]);
findParentIds(options.value, formState.value.transactionType, selectDevice.value);
formState.value.transactionType = selectDevice;
formState.value.transactionType = formState.value.transactionType;
}, 500);
},
},
{
label: '删除',
name: 'userDelete',
dynamicParams: { ids: 'id[]' },
confirm: true,
isReload: true,
api: carbonAssets.delete,
},
],
},
formConfig: {
schemas: [],
params: {},
},
rowKey: 'id',
});
// //
const onChange = (pageNumber: number, size: number) => { const onChange = (pageNumber: number, size: number) => {
queryParams.value.pageNum = pageNumber; queryParams.value.pageNum = pageNumber;
@ -492,6 +663,12 @@
}); });
fileList.value = newFileList; fileList.value = newFileList;
}; };
const handleKeyDown = (event: KeyboardEvent) => {
// Check if the pressed key is a space
if (event.code === 'Space') {
event.preventDefault();
}
};
const onSubmit = () => { const onSubmit = () => {
formRef.value formRef.value
.validate() .validate()
@ -625,7 +802,7 @@
height: 16%; height: 16%;
} }
.detailTable { .detailTable {
width: 65%; width: 70%;
margin-right: 20px; margin-right: 20px;
height: 100%; height: 100%;
background: white; background: white;
@ -633,10 +810,27 @@
padding: 16px; padding: 16px;
} }
.total { .total {
width: calc(35% - 20px); width: calc(30% - 20px);
height: 100%; height: 100%;
background: white; background: white;
border-radius: 12px; border-radius: 12px;
padding: 16px; padding: 16px;
} }
:deep(.ns-table-search) {
display: none;
}
:deep(.ns-table-header) {
padding-top: unset !important;
align-items: unset !important;
padding-bottom: 10px;
height: unset !important;
}
:deep(.ns-basic-table) {
padding-top: unset !important;
}
:deep(.ns-table-main) {
padding: unset !important;
margin: unset !important;
border-radius: unset !important;
}
</style> </style>

181
hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/indexCopy.vue → hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index1.vue

@ -48,8 +48,60 @@
</div> </div>
<div style="display: flex; margin-top: 20px; height: calc(84% - 20px)"> <div style="display: flex; margin-top: 20px; height: calc(84% - 20px)">
<div class="detailTable"> <div class="detailTable">
<ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" :scroll="{ x: 2000 }"> <div class="ns-form-title">
</ns-view-list-table> <div class="title">交易明细</div>
<div class="operation" style="display: flex">
<a-button type="primary" @click="addDetail">新增</a-button>
<a-upload
v-model:file-list="importFileList"
name="file"
accept=".xlsx"
:showUploadList="false"
:custom-request="importFile">
<a-button type="primary" style="margin-left: 6px">导入</a-button>
</a-upload>
<a-button type="primary" style="margin-left: 6px" @click="exportFile">导出</a-button>
<a-button
type="primary"
style="margin-left: 6px"
:disabled="selectedRowKeys.length === 0"
@click="deleteMore"
>批量删除</a-button
>
</div>
</div>
<a-table
:columns="columns"
:data-source="data"
rowKey="id"
@change="onChange"
:rowSelection="{
selectedRowKeys: selectedRowKeys,
onChange: onSelectionChange,
}"
:scroll="{ x: 1500, y: 400 }"
:pagination="false">
<template #bodyCell="{ column, text, record }">
<template v-if="column.dataIndex === 'accountType'">
<span v-if="record.accountType">{{ record.accountType.label }}</span>
</template>
<template v-if="column.key === 'action'">
<span>
<a @click="editData(record)">编辑</a>
<a-divider type="vertical" />
<a @click="delData(record)">删除</a>
</span>
</template>
</template>
</a-table>
<a-pagination
:current="queryParams.pageNum"
:total="total"
:page-size="queryParams.pageSize"
style="display: flex; justify-content: center; margin-top: 16px"
:show-size-changer="true"
:show-quick-jumper="true"
@change="onChange" />
</div> </div>
<div class="total"> <div class="total">
<div class="ns-form-title"> <div class="ns-form-title">
@ -187,7 +239,7 @@
total.value = res.data.total; total.value = res.data.total;
}); });
}; };
// getDetailList(); getDetailList();
const columns = [ const columns = [
{ {
title: '序号', title: '序号',
@ -326,129 +378,6 @@
}, },
}); });
}; };
const mainRef = ref();
const tableConfig = ref({
title: '数据库',
api: carbonAssets.carbonDetailsList,
params: {
orgId,
},
headerActions: [
{
label: '新增',
name: 'userAdd',
type: 'primary',
handle: () => {
},
},
{
label: '导入',
type: 'primary',
name: 'carbonEmissionFactorLibraryImport',
extra: {
api: carbonEmissionFactorLibrary.import, //
params: {
orgId,
},
title: '排放源', // title
templateName: 'emissionSource', // 使
indexName: '设备id', //
message: [
{ label: '1、若必填项未填写,则不能进行导入操作' },
{ label: `2、当重复时,则更新数据。` },
{ label: '3、数据将从模版的第五行进行导入。' },
{ label: '4、文件导入勿超过5MB。' },
],
},
},
{
label: '导出',
type: 'primary',
handle: () => {
},
},
{
label: '批量删除',
type: 'primary',
name: 'userBatchDel',
dynamicDisabled: (data: any) => {
return data.list.length === 0;
},
confirm: true,
isReload: true,
isClearCheck: true,
api: carbonEmissionFactorLibrary.del,
dynamicParams: { ids: 'id[]' },
},
],
columns: [
{
title: '序号',
customRender: (text: any) => {
return text.index + 1;
},
},
{
title: '资产类别',
dataIndex: 'accountType',
},
{
title: '交易方式',
dataIndex: 'transactionTypeName',
},
{
title: '交易日期',
dataIndex: 'transactionDate',
sorter: (a, b) => a.transactionDate - b.transactionDate,
},
{
title: '本期收入(tCO2)',
dataIndex: 'income',
sorter: (a, b) => a.income - b.income,
},
{
title: '本期支出(tCO2)',
dataIndex: 'expenditure',
sorter: (a, b) => a.expenditure - b.expenditure,
},
{
title: '发生金额(¥)',
dataIndex: 'amountIncurredValue',
},
{
title: '交易对象',
dataIndex: 'tradingPartner',
},
{
title: '更新人',
dataIndex: 'updateUser',
},
{
title: '更新时间',
dataIndex: 'updateTime',
},
],
columnActions: {
title: '操作',
actions: [
{
label: '编辑',
name: 'userEdit',
handle: (record: any) => {},
},
{
label: '删除',
name: 'userDelete',
dynamicParams: { ids: 'id[]' },
confirm: true,
isReload: true,
api: carbonEmissionFactorLibrary.del,
},
],
},
rowKey: 'id',
});
// //
const onChange = (pageNumber: number, size: number) => { const onChange = (pageNumber: number, size: number) => {
queryParams.value.pageNum = pageNumber; queryParams.value.pageNum = pageNumber;

8
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/config.ts

@ -15,7 +15,7 @@ export const formConfig = (disabled) => {
component: 'NsInput', component: 'NsInput',
componentProps: { componentProps: {
placeholder: '请输入排放源', placeholder: '请输入排放源',
maxLength: 20, maxLength: 5,
}, },
rules: [ rules: [
{ {
@ -92,7 +92,7 @@ export const formConfig = (disabled) => {
component: 'NsInput', component: 'NsInput',
componentProps: { componentProps: {
placeholder: '请输入排放环节', placeholder: '请输入排放环节',
maxLength: 20, maxLength: 5,
}, },
rules: [ rules: [
{ {
@ -107,7 +107,7 @@ export const formConfig = (disabled) => {
component: 'NsInputNumber', component: 'NsInputNumber',
componentProps: { componentProps: {
placeholder: '请输入排放因子值', placeholder: '请输入排放因子值',
maxLength: 20, maxLength: 5,
}, },
rules: [ rules: [
{ {
@ -154,7 +154,7 @@ export const formConfig = (disabled) => {
component: 'NsInput', component: 'NsInput',
componentProps: { componentProps: {
placeholder: '请输入碳排后缀', placeholder: '请输入碳排后缀',
maxLength: 20, maxLength: 10,
}, },
rules: [ rules: [
{ {

24
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue

@ -27,6 +27,7 @@
:tree-data="gData" :tree-data="gData"
:checkedKeys="checkedTreeNodeKeys" :checkedKeys="checkedTreeNodeKeys"
:selectedKeys="selectedKeys" :selectedKeys="selectedKeys"
:show-line="{ showLeafIcon: false }"
@dragenter="onDragEnter" @dragenter="onDragEnter"
@drop="onDrop" @drop="onDrop"
@check="checkTreeNode" @check="checkTreeNode"
@ -164,6 +165,7 @@
:expanded-keys="unitExpandedKeys" :expanded-keys="unitExpandedKeys"
:selectedKeys="unitSelectedKeys" :selectedKeys="unitSelectedKeys"
:tree-data="unitTreeData" :tree-data="unitTreeData"
:show-line="{ showLeafIcon: false }"
v-if="unitTreeData && unitTreeData.length > 0" v-if="unitTreeData && unitTreeData.length > 0"
class="draggable-tree" class="draggable-tree"
block-node> block-node>
@ -198,7 +200,11 @@
</template> </template>
<a-form ref="unitFormRef" :model="formState" :label-col="labelCol" :wrapper-col="wrapperCol"> <a-form ref="unitFormRef" :model="formState" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-form-item label="分组名称" name="cnValue" :required="true"> <a-form-item label="分组名称" name="cnValue" :required="true">
<a-input v-model:value="formState.cnValue" placeholder="请输入分组名称" /> <a-input
v-model:value="formState.cnValue"
:maxlength="20"
@keydown="handleKeyDown"
placeholder="请输入分组名称" />
</a-form-item> </a-form-item>
</a-form> </a-form>
</ns-modal> </ns-modal>
@ -211,7 +217,11 @@
</template> </template>
<a-form ref="unitFormRef" :model="formState" :label-col="labelCol" :wrapper-col="wrapperCol"> <a-form ref="unitFormRef" :model="formState" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-form-item label="单位名称" name="cnValue" :required="true"> <a-form-item label="单位名称" name="cnValue" :required="true">
<a-input v-model:value="formState.cnValue" placeholder="请输入单位名称" /> <a-input
v-model:value="formState.cnValue"
:maxlength="20"
@keydown="handleKeyDown"
placeholder="请输入单位名称" />
</a-form-item> </a-form-item>
<a-form-item label="选择分组" name="parentId" :required="true"> <a-form-item label="选择分组" name="parentId" :required="true">
<a-select <a-select
@ -866,7 +876,7 @@
component: 'NsInput', component: 'NsInput',
componentProps: { componentProps: {
placeholder: '请输入排放源', placeholder: '请输入排放源',
maxLength: 30, maxLength: 20,
}, },
}, },
{ {
@ -930,7 +940,7 @@
component: 'NsInput', component: 'NsInput',
componentProps: { componentProps: {
placeholder: '请输入文献关键字', placeholder: '请输入文献关键字',
maxLength: 30, maxLength: 20,
}, },
}, },
], ],
@ -1040,6 +1050,12 @@
grpDesc: '计量单位', grpDesc: '计量单位',
}; };
}; };
const handleKeyDown = (event: KeyboardEvent) => {
// Check if the pressed key is a space
if (event.code === 'Space') {
event.preventDefault();
}
};
const unitOrGroupOk = () => { const unitOrGroupOk = () => {
unitFormRef.value unitFormRef.value
.validate() .validate()

5
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/config.ts

@ -76,7 +76,7 @@ export const tableColumns = [
{ {
title: '操作', title: '操作',
key: 'action', key: 'action',
width: 130 width: 130,
}, },
]; ];
// 碳排速算表表头 // 碳排速算表表头
@ -119,7 +119,7 @@ export const columns = [
{ {
title: '操作', title: '操作',
key: 'action', key: 'action',
width: 130 width: 130,
}, },
]; ];
// 碳排速算新增页中表头 // 碳排速算新增页中表头
@ -131,6 +131,7 @@ export const drawerColumns = [
{ {
title: '因子值', title: '因子值',
dataIndex: 'emissionFactors', dataIndex: 'emissionFactors',
key: 'emissionFactors',
}, },
{ {
title: '排放环节', title: '排放环节',

18
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue

@ -22,7 +22,11 @@
:label-col="labelCol" :label-col="labelCol"
:wrapper-col="wrapperCol"> :wrapper-col="wrapperCol">
<a-form-item ref="name" label="能耗名称" name="energyType"> <a-form-item ref="name" label="能耗名称" name="energyType">
<a-input v-model:value="formState.energyType" placeholder="请输入能源种类" /> <a-input
v-model:value="formState.energyType"
@keydown="handleKeyDown"
:maxlength="10"
placeholder="请输入能源种类" />
</a-form-item> </a-form-item>
<a-form-item label="计量单位" name="unit"> <a-form-item label="计量单位" name="unit">
<a-cascader v-model:value="formState.unit" :options="measurementUnit" /> <a-cascader v-model:value="formState.unit" :options="measurementUnit" />
@ -250,6 +254,12 @@
isComputeCarbon: [{ required: true, message: '请选择是否计算碳排', trigger: 'change' }], isComputeCarbon: [{ required: true, message: '请选择是否计算碳排', trigger: 'change' }],
unit: [{ required: true, message: '请选择计量单位', trigger: 'change' }], unit: [{ required: true, message: '请选择计量单位', trigger: 'change' }],
}; };
const handleKeyDown = (event: KeyboardEvent) => {
// Check if the pressed key is a space
if (event.code === 'Space') {
event.preventDefault();
}
};
// //
const emissionTypeDic = ref(); const emissionTypeDic = ref();
// //
@ -259,15 +269,15 @@
// //
const changeYearData = () => { const changeYearData = () => {
queryParams.value.year = selectYear.value; queryParams.value.year = selectYear.value;
getTableList(); // getTableList();
}; };
const mainRef = ref(); const mainRef = ref();
const year = selectYear.value.format('YYYY'); const year = selectYear.value.format('YYYY');
const tableConfig = ref({ const tableConfig = ref({
title: '能耗统计', title: '能耗统计',
api: energyConsumption.pageList, api: energyConsumption.pageList,
rowSelection: null,
params: queryParams.value, params: queryParams.value,
rowSelection: null,
headerActions: [ headerActions: [
{ {
label: '新增', label: '新增',
@ -690,10 +700,10 @@
field: 'year', field: 'year',
label: '年份', label: '年份',
component: 'NsDatePicker', component: 'NsDatePicker',
defaultValue: selectYear.value.format('YYYY'),
componentProps: { componentProps: {
picker: 'year', picker: 'year',
valueFormat: 'YYYY', valueFormat: 'YYYY',
defaultValue: selectYear.value.format('YYYY'),
}, },
}, },
], ],

5
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue

@ -130,6 +130,11 @@
type: 'radio', type: 'radio',
}" }"
:pagination="false"> :pagination="false">
<template #bodyCell="{ column, text, record }">
<template v-if="column.key === 'emissionFactors'">
<span>{{ record.emissionFactors + record.emissionFactorUnits }}</span>
</template>
</template>
</a-table> </a-table>
<template #footer> <template #footer>
<a-button style="margin-right: 8px" @click="onClose">取消</a-button> <a-button style="margin-right: 8px" @click="onClose">取消</a-button>

1
hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/config.ts

@ -29,6 +29,7 @@ export const drawerColumns = [
{ {
title: '因子值', title: '因子值',
dataIndex: 'emissionFactors', dataIndex: 'emissionFactors',
key: 'emissionFactors',
}, },
{ {
title: '排放环节', title: '排放环节',

76
hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue

@ -27,7 +27,7 @@
</div> </div>
</div> </div>
</div> </div>
<div style="display: flex; height: 100%"> <div style="display: flex; height: 90%">
<div class="left"> <div class="left">
<div class="top"> <div class="top">
<a-form style="width: 100%; margin: 0 auto"> <a-form style="width: 100%; margin: 0 auto">
@ -57,6 +57,7 @@
:selectedKeys="selectedKeysL" :selectedKeys="selectedKeysL"
:auto-expand-parent="autoExpandParent" :auto-expand-parent="autoExpandParent"
:tree-data="gData" :tree-data="gData"
:show-line="{ showLeafIcon: false }"
v-if="gData && gData.length > 0" v-if="gData && gData.length > 0"
:height="233" :height="233"
show-line show-line
@ -95,6 +96,7 @@
:expandedKeys="expandedKeysR" :expandedKeys="expandedKeysR"
:selectedKeys="selectedKeysR" :selectedKeys="selectedKeysR"
:checkedKeys="checkedKeys" :checkedKeys="checkedKeys"
:show-line="{ showLeafIcon: false }"
:tree-data="treeData" :tree-data="treeData"
@select="onSelectR" @select="onSelectR"
block-node> block-node>
@ -106,16 +108,20 @@
<div class="actionMore"> <div class="actionMore">
<EditOutlined @click="editUnit(data)" /> <EditOutlined @click="editUnit(data)" />
<MinusCircleOutlined style="margin-left: 6px" @click="delUnit(data)" /> <MinusCircleOutlined style="margin-left: 6px" @click="delUnit(data)" />
<PlusCircleOutlined
v-if="data.emissionSource === '全部'"
style="margin-left: 6px"
@click="addTreeNodeData" />
</div> </div>
</div> </div>
</template> </template>
</a-tree> </a-tree>
<a-empty v-else /> <a-empty v-else />
<div class="addTreeNode"> <!-- <div class="addTreeNode">
<a-button type="primary" style="width: 100%" @click="addTreeNodeData"> <a-button type="primary" style="width: 100%" @click="addTreeNodeData">
新增 新增
</a-button> </a-button>
</div> </div> -->
</div> </div>
<div class="mainRight"> <div class="mainRight">
<a-table <a-table
@ -125,7 +131,7 @@
:pagination="false" :pagination="false"
bordered bordered
size="middle" size="middle"
:scroll="{ y: 500 }"> :scroll="{ y: 380 }">
<template #title> <template #title>
<a-button type="primary" @click="downLoadVoucher">凭证</a-button> <a-button type="primary" @click="downLoadVoucher">凭证</a-button>
</template> </template>
@ -162,7 +168,7 @@
<a-empty v-else /> <a-empty v-else />
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="3" tab="碳排流向"> <a-tab-pane key="3" tab="碳排流向">
<div v-if="showChart" ref="tplxChart" style="width: 100%; height: 68vh"></div> <div v-if="showChart" ref="tplxChart" style="width: 100%; height: 100%"></div>
<a-empty v-else /> <a-empty v-else />
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
@ -193,6 +199,7 @@
:selectedKeys="categorySelectedKeys" :selectedKeys="categorySelectedKeys"
:checkedKeys="categoryCheckedKeys" :checkedKeys="categoryCheckedKeys"
:tree-data="categoryTreeData" :tree-data="categoryTreeData"
:show-line="{ showLeafIcon: false }"
v-if="categoryTreeData && categoryTreeData.length > 0" v-if="categoryTreeData && categoryTreeData.length > 0"
class="draggable-tree" class="draggable-tree"
@check="checkTreeNode" @check="checkTreeNode"
@ -230,7 +237,11 @@
:label-col="labelCol" :label-col="labelCol"
:wrapper-col="wrapperCol"> :wrapper-col="wrapperCol">
<a-form-item ref="name" label="排放源" name="emissionSource"> <a-form-item ref="name" label="排放源" name="emissionSource">
<a-input v-model:value="formState.emissionSource" placeholder="请输入排放源" /> <a-input
v-model:value="formState.emissionSource"
:maxlength="20"
@keydown="handleKeyDown"
placeholder="请输入排放源" />
</a-form-item> </a-form-item>
<a-form-item ref="name" label="计量单位" name="unitId"> <a-form-item ref="name" label="计量单位" name="unitId">
<a-cascader v-model:value="formState.unitId" :options="measurementUnit" /> <a-cascader v-model:value="formState.unitId" :options="measurementUnit" />
@ -317,7 +328,11 @@
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-item ref="name" label="消耗量" name="consumption"> <a-form-item ref="name" label="消耗量" name="consumption">
<ns-input v-model:value="editFormState.consumption" :disabled="canEdit" /> <ns-input
v-model:value="editFormState.consumption"
:maxlength="20"
@keydown="handleKeyDown"
:disabled="canEdit" />
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@ -351,7 +366,10 @@
<a-row> <a-row>
<a-col :span="24"> <a-col :span="24">
<a-form-item ref="name" label="因子值" name="emissionFactors"> <a-form-item ref="name" label="因子值" name="emissionFactors">
<ns-input v-model:value="editFormState.emissionFactors" /> <ns-input
v-model:value="editFormState.emissionFactors"
:maxlength="20"
@keydown="handleKeyDown" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
@ -381,6 +399,11 @@
type: 'radio', type: 'radio',
}" }"
:pagination="false"> :pagination="false">
<template #bodyCell="{ column, text, record }">
<template v-if="column.key === 'emissionFactors'">
<span>{{ record.emissionFactors + record.emissionFactorUnits }}</span>
</template>
</template>
</a-table> </a-table>
<a-pagination <a-pagination
:current="queryData.pageNum" :current="queryData.pageNum"
@ -603,9 +626,10 @@
fetch(carbonInventoryCheck.getInventoryTree, { categoryId: categoryId.value }).then((res) => { fetch(carbonInventoryCheck.getInventoryTree, { categoryId: categoryId.value }).then((res) => {
treeData.value = res.data; treeData.value = res.data;
if (changeSelectedKeys.value) { if (changeSelectedKeys.value) {
selectedKeysR.value = [`0-${treeData.value.length - 1}`]; selectedKeysR.value = [`0-0-${treeData.value[0].children.length - 1}`];
changeSelectedKeys.value = false; changeSelectedKeys.value = false;
getTableId.value = res.data[res.data.length - 1].id; getTableId.value = res.data[0].children[res.data[0].children.length - 1].id;
bizId.value = res.data[0].children[res.data[0].children.length - 1].id;
if (res.data.length != 0) { if (res.data.length != 0) {
getPFYTableList(getTableId.value); getPFYTableList(getTableId.value);
getTableHeardUnit(getTableId.value); getTableHeardUnit(getTableId.value);
@ -616,8 +640,9 @@
columns.value[3].title = '排放量'; columns.value[3].title = '排放量';
} }
} else { } else {
selectedKeysR.value = ['0-0']; selectedKeysR.value = ['0-0-0'];
getTableId.value = res.data[0].id; getTableId.value = res.data[0].children[0].id;
bizId.value = res.data[0].children[0].id;
if (res.data.length != 0) { if (res.data.length != 0) {
getPFYTableList(getTableId.value); getPFYTableList(getTableId.value);
getTableHeardUnit(getTableId.value); getTableHeardUnit(getTableId.value);
@ -634,6 +659,7 @@
const onSelectR = (selectedKey: string[], info: any) => { const onSelectR = (selectedKey: string[], info: any) => {
selectedKeysR.value = selectedKey; selectedKeysR.value = selectedKey;
getTableId.value = info.selectedNodes[0].id; getTableId.value = info.selectedNodes[0].id;
bizId.value = info.selectedNodes[0].id;
getPFYTableList(getTableId.value); getPFYTableList(getTableId.value);
getTableHeardUnit(getTableId.value); getTableHeardUnit(getTableId.value);
}; };
@ -647,8 +673,8 @@
} }
}); });
}; };
const expandedKeysR = ref<string[]>([]); const expandedKeysR = ref<string[]>(['0-0']);
const selectedKeysR = ref<string[]>(['0-0']); const selectedKeysR = ref<string[]>(['0-0-0']);
const checkedKeys = ref<string[]>([]); const checkedKeys = ref<string[]>([]);
watch(expandedKeysR, () => { watch(expandedKeysR, () => {
console.log('expandedKeysR', expandedKeysR); console.log('expandedKeysR', expandedKeysR);
@ -778,6 +804,12 @@
groupData.value = res.data; groupData.value = res.data;
}); });
}; };
const handleKeyDown = (event: KeyboardEvent) => {
// Check if the pressed key is a space
if (event.code === 'Space') {
event.preventDefault();
}
};
const onSubmit = () => { const onSubmit = () => {
formRef.value formRef.value
.validate() .validate()
@ -945,10 +977,13 @@
}; };
// //
const openVoucher = ref(false); const openVoucher = ref(false);
const bizId = ref();
const downLoadVoucher = () => { const downLoadVoucher = () => {
fetch(carbonInventoryCheck.voucherDownloadList, { bizType: 2 }).then((res) => { fetch(carbonInventoryCheck.voucherDownloadList, { bizType: 2, bizId: bizId.value }).then(
(res) => {
voucherData.value = res.data; voucherData.value = res.data;
}); },
);
openVoucher.value = true; openVoucher.value = true;
}; };
const selectedRowKeys = ref([]); const selectedRowKeys = ref([]);
@ -1061,6 +1096,7 @@
canEdit.value = true; canEdit.value = true;
automatic.value = true; automatic.value = true;
} else { } else {
canEdit.value = false;
automatic.value = false; automatic.value = false;
} }
}; };
@ -1220,6 +1256,8 @@
reportId: props.reportId, reportId: props.reportId,
year: props.year, year: props.year,
categoryId: categoryId.value, categoryId: categoryId.value,
startTime: props.startTime,
endTime: props.endTime,
}); });
const linksData = ref([]); const linksData = ref([]);
const datalist = ref([]); const datalist = ref([]);
@ -1243,6 +1281,8 @@
reportId: props.reportId, reportId: props.reportId,
year: props.year, year: props.year,
categoryId: categoryId.value, categoryId: categoryId.value,
startTime: props.startTime,
endTime: props.endTime,
}); });
const tableHeader = ref([]); const tableHeader = ref([]);
const getEmissionStatistic = () => { const getEmissionStatistic = () => {
@ -1556,7 +1596,7 @@
width: 300px; width: 300px;
margin-right: @ns-gap; margin-right: @ns-gap;
min-width: fit-content; min-width: fit-content;
height: 93%; height: 100%;
border-radius: 8px; border-radius: 8px;
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
box-shadow: 0px 2px 20px rgb(69 123 234 / 20%); box-shadow: 0px 2px 20px rgb(69 123 234 / 20%);
@ -1645,7 +1685,7 @@
.right { .right {
flex: 1; flex: 1;
min-width: 0; min-width: 0;
height: 93%; height: 100%;
border-radius: 8px; border-radius: 8px;
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
box-shadow: 0px 2px 20px rgb(69 123 234 / 20%); box-shadow: 0px 2px 20px rgb(69 123 234 / 20%);

30
hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue

@ -20,7 +20,9 @@
:footer-style="{ textAlign: 'right' }" :footer-style="{ textAlign: 'right' }"
destroyOnClose destroyOnClose
@close="onClose"> @close="onClose">
<div class="ns-form-title"><div class="title">{{text}}</div></div> <div class="ns-form-title"
><div class="title">{{ text }}</div></div
>
<a-form <a-form
ref="formRef" ref="formRef"
:model="formState" :model="formState"
@ -28,13 +30,21 @@
:label-col="labelCol" :label-col="labelCol"
:wrapper-col="wrapperCol"> :wrapper-col="wrapperCol">
<a-form-item ref="name" label="报告名称" name="reportName"> <a-form-item ref="name" label="报告名称" name="reportName">
<a-input v-model:value="formState.reportName" placeholder="请输入报告名称" /> <a-input
v-model:value="formState.reportName"
:maxlength="15"
@keydown="handleKeyDown"
placeholder="请输入报告名称" />
</a-form-item> </a-form-item>
<a-form-item ref="name" label="报告年度" name="reportYear"> <a-form-item ref="name" label="报告年度" name="reportYear">
<a-date-picker v-model:value="formState.reportYear" picker="year" valueFormat="YYYY" /> <a-date-picker v-model:value="formState.reportYear" picker="year" valueFormat="YYYY" />
</a-form-item> </a-form-item>
<a-form-item ref="name" label="适用标准" name="genericStandard"> <a-form-item ref="name" label="适用标准" name="genericStandard">
<a-input v-model:value="formState.genericStandard" placeholder="请输入适用标准" /> <a-input
v-model:value="formState.genericStandard"
:maxlength="20"
@keydown="handleKeyDown"
placeholder="请输入适用标准" />
</a-form-item> </a-form-item>
<a-form-item label="报告周期" name="reportPeriod"> <a-form-item label="报告周期" name="reportPeriod">
<a-select <a-select
@ -81,7 +91,7 @@
const formRef = ref(); const formRef = ref();
const labelCol = { span: 4 }; const labelCol = { span: 4 };
const wrapperCol = { span: 20 }; const wrapperCol = { span: 20 };
const text = ref('新增报告') const text = ref('新增报告');
const disabledDate = (current: moment.Moment | null) => { const disabledDate = (current: moment.Moment | null) => {
if (formState.value.reportPeriod === '2') { if (formState.value.reportPeriod === '2') {
const year = current.year(); const year = current.year();
@ -105,6 +115,12 @@
formState.value = {}; formState.value = {};
formRef.value.resetFields(); formRef.value.resetFields();
}; };
const handleKeyDown = (event: KeyboardEvent) => {
// Check if the pressed key is a space
if (event.code === 'Space') {
event.preventDefault();
}
};
// //
const onSubmit = () => { const onSubmit = () => {
formRef.value formRef.value
@ -142,7 +158,7 @@
name: 'userAdd', name: 'userAdd',
type: 'primary', type: 'primary',
handle: () => { handle: () => {
text.value = '新增报告' text.value = '新增报告';
visible.value = true; visible.value = true;
}, },
}, },
@ -186,7 +202,7 @@
label: '编辑', label: '编辑',
name: 'userEdit', name: 'userEdit',
handle: (record: any) => { handle: (record: any) => {
text.value = '编辑报告' text.value = '编辑报告';
visible.value = true; visible.value = true;
fetch(carbonInventoryCheck.findById, { id: record.id }).then((res) => { fetch(carbonInventoryCheck.findById, { id: record.id }).then((res) => {
formState.value = res.data; formState.value = res.data;
@ -252,7 +268,7 @@
component: 'NsInput', component: 'NsInput',
componentProps: { componentProps: {
placeholder: '请输入报告名称', placeholder: '请输入报告名称',
maxLength: 30, maxLength: 20,
}, },
}, },
{ {

17
hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/all/index.vue

@ -15,7 +15,13 @@
margin-bottom: 1%; margin-bottom: 1%;
"> ">
<div> <div>
<a-button v-if="selectedTime" type="primary" @click="changeYear(-1)">上一年</a-button> <a-button
v-if="selectedTime"
type="primary"
style="border-radius: 5px 0 0 5px; border-right: none"
@click="changeYear(-1)"
>上一年</a-button
>
<a-date-picker <a-date-picker
v-if="selectedTime" v-if="selectedTime"
valueFormat="YYYY" valueFormat="YYYY"
@ -23,7 +29,13 @@
v-model:value="selectYear" v-model:value="selectYear"
@change="changeYear" @change="changeYear"
picker="year" /> picker="year" />
<a-button v-if="selectedTime" type="primary" @click="changeYear(1)">下一年</a-button> <a-button
v-if="selectedTime"
type="primary"
style="border-radius: 0 5px 5px 0; border-left: none"
@click="changeYear(1)"
>下一年</a-button
>
<a-date-picker <a-date-picker
v-else v-else
valueFormat="YYYY-MM" valueFormat="YYYY-MM"
@ -344,7 +356,6 @@
border: 1px solid rgba(39, 120, 255, 1); border: 1px solid rgba(39, 120, 255, 1);
} }
:deep(.ant-btn-primary) { :deep(.ant-btn-primary) {
border-radius: unset !important;
border-color: #d7d7d7 !important; border-color: #d7d7d7 !important;
background: #f2f2f2 !important; background: #f2f2f2 !important;
color: black !important; color: black !important;

33
hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/categoryDeatil.vue

@ -102,17 +102,27 @@
<!-- 批量设置 --> <!-- 批量设置 -->
<a-modal :visible="open" title="批量设置" @ok="handleOk" @cancel="onCancel"> <a-modal :visible="open" title="批量设置" @ok="handleOk" @cancel="onCancel">
<a-form ref="formRef" :model="formState" :label-col="labelCol" :wrapper-col="wrapperCol"> <a-form ref="formRef" :model="formState" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-form-item label="是否按去年折算"> <a-form-item label="是否按去年折算" :required="true">
<a-select ref="select" v-model:value="formState.isLastYear" @change="selectChange"> <a-select ref="select" v-model:value="formState.isLastYear" @change="selectChange">
<a-select-option :value="1"></a-select-option> <a-select-option :value="1"></a-select-option>
<a-select-option :value="0"></a-select-option> <a-select-option :value="0"></a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="折算率"> <a-form-item label="折算率" :required="true">
<a-input v-model:value="formState.conversionRate" suffix="%" :disabled="disabled" /> <a-input-number
v-model:value="formState.conversionRate"
:maxlength="15"
@keydown="handleKeyDown"
suffix="%"
:disabled="disabled" />
</a-form-item> </a-form-item>
<a-form-item label="预算值"> <a-form-item label="预算值" :required="true">
<a-input v-model:value="formState.budget" suffix="kWh" :disabled="!disabled" /> <a-input-number
v-model:value="formState.budget"
:maxlength="15"
@keydown="handleKeyDown"
suffix="kWh"
:disabled="!disabled" />
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-modal> </a-modal>
@ -336,6 +346,12 @@
disabled.value = true; disabled.value = true;
} }
}; };
const handleKeyDown = (event: KeyboardEvent) => {
// Check if the pressed key is a space
if (event.code === 'Space') {
event.preventDefault();
}
};
const handleOk = () => { const handleOk = () => {
formRef.value formRef.value
.validate() .validate()
@ -710,6 +726,7 @@
<style lang="less" scoped> <style lang="less" scoped>
.detailContant { .detailContant {
height: 100%; height: 100%;
margin: 12px;
} }
.ns-form-title { .ns-form-title {
font-weight: bold; font-weight: bold;
@ -855,6 +872,12 @@
height: 100%; height: 100%;
width: 100%; width: 100%;
} }
:deep(
.ant-form-item-label
> label.ant-form-item-required:not(.ant-form-item-required-mark-optional)::before
) {
display: none !important;
}
</style> </style>
<style scoped> <style scoped>
.editable-row-operations a { .editable-row-operations a {

44
hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/index.vue

@ -1,5 +1,6 @@
<template> <template>
<div class="totalContant" v-if="electricTotal"> <div class="totalContant" v-if="electricTotal">
<div style="padding: 12px">
<div class="ns-form-title"> <div class="ns-form-title">
<div class="title"> <div class="title">
<span>统计数据</span> <span>统计数据</span>
@ -13,7 +14,6 @@
height: 5%; height: 5%;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
margin-bottom: 1%;
"> ">
<a-date-picker <a-date-picker
v-if="selectedTime" v-if="selectedTime"
@ -37,6 +37,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="contant"> <div class="contant">
<div class="chartsPart"> <div class="chartsPart">
<div class="ballChart" ref="ballChartRef"></div> <div class="ballChart" ref="ballChartRef"></div>
@ -80,6 +81,7 @@
:selectedKeys="selectedKeys" :selectedKeys="selectedKeys"
:checkedKeys="treeCheckedKeys" :checkedKeys="treeCheckedKeys"
:tree-data="treeData" :tree-data="treeData"
:show-line="{ showLeafIcon: false }"
v-if="treeData && treeData.length > 0" v-if="treeData && treeData.length > 0"
class="draggable-tree" class="draggable-tree"
@check="checkTreeNode" @check="checkTreeNode"
@ -206,6 +208,14 @@
chartInstance = echarts.init(pillarChartRef.value); chartInstance = echarts.init(pillarChartRef.value);
const option = { const option = {
backgroundColor: 'transparent', backgroundColor: 'transparent',
title: {
text: '历年用电量分析',
x: '0',
textStyle: {
color: 'rgba(51, 51, 51, 1)',
fontSize: '16',
},
},
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
@ -217,14 +227,14 @@
}, },
grid: { grid: {
left: '4%', left: '4%',
top: '18%', top: '20%',
right: '5%', right: '3%',
bottom: '10%', bottom: '10%',
}, },
legend: { legend: {
data: ['实际用量', '预算量', '基准线'], data: ['实际用量', '预算量', '基准线'],
top: '0', top: '0',
left: '0', right: '3%', //
textStyle: { textStyle: {
color: '#666', color: '#666',
fontSize: 12, fontSize: 12,
@ -361,7 +371,7 @@
type: 'liquidFill', type: 'liquidFill',
radius: '78.1%', radius: '78.1%',
center: ['50%', '50%'], center: ['50%', '50%'],
color: selectedTime.value color: !selectedTime.value
? ['#ecf3fe', '#c8dcfe', '#5594fa'] ? ['#ecf3fe', '#c8dcfe', '#5594fa']
: ['rgba(12, 168, 126, 0.5)', 'rgba(12, 168, 126, 0.1)', 'rgba(12, 168, 126, 1)'], : ['rgba(12, 168, 126, 0.5)', 'rgba(12, 168, 126, 0.1)', 'rgba(12, 168, 126, 1)'],
data: [ballData, ballData, ballData], // data data: [ballData, ballData, ballData], // data
@ -374,7 +384,7 @@
label: { label: {
show: true, show: true,
textStyle: { textStyle: {
color: selectedTime.value ? 'rgba(68, 197, 253,1)' : 'rgba(12, 168, 126, 1)', color: !selectedTime.value ? 'rgba(68, 197, 253,1)' : 'rgba(12, 168, 126, 1)',
insideColor: '#12786f', insideColor: '#12786f',
fontSize: 40, fontSize: 40,
}, },
@ -390,7 +400,7 @@
show: true, show: true,
borderDistance: 5, borderDistance: 5,
itemStyle: { itemStyle: {
borderColor: selectedTime.value ? 'rgba(68, 197, 253,1)' : 'rgba(12, 168, 126, 1)', borderColor: !selectedTime.value ? 'rgba(68, 197, 253,1)' : 'rgba(12, 168, 126, 1)',
borderWidth: 2, borderWidth: 2,
}, },
}, },
@ -572,7 +582,6 @@
<style lang="less" scoped> <style lang="less" scoped>
.totalContant { .totalContant {
height: 100%; height: 100%;
padding: 12px;
} }
:deep(.ant-tabs-content) { :deep(.ant-tabs-content) {
padding: 16px; padding: 16px;
@ -612,7 +621,6 @@
} }
.operation { .operation {
display: flex; display: flex;
margin-right: 10px;
font-weight: 400; font-weight: 400;
height: 90%; height: 90%;
cursor: pointer; cursor: pointer;
@ -636,21 +644,29 @@
width: 100%; width: 100%;
height: calc(94% - 5vh); height: calc(94% - 5vh);
overflow-y: auto; overflow-y: auto;
padding: 12px;
.chartsPart { .chartsPart {
width: 99%; width: 100%;
height: 40%; height: 45%;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.ballChart { .ballChart {
width: 25%; width: 20%;
margin-right: 12px; margin-right: 12px;
background: #ffffff;
box-shadow: 0px 2px 20px rgb(69 123 234 / 20%);
border-radius: 8px;
} }
.pillarChart { .pillarChart {
width: calc(75% - 12px); width: calc(80% - 12px);
background: #ffffff;
box-shadow: 0px 2px 20px rgb(69 123 234 / 20%);
border-radius: 8px;
padding: 5px;
} }
} }
.tablePart { .tablePart {
height: calc(60% - 20px); height: calc(55% - 20px);
margin-top: 20px; margin-top: 20px;
} }
} }

57
hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/device.vue

@ -9,29 +9,29 @@
device.regionName + ' > ' + device.deviceGroupName device.regionName + ' > ' + device.deviceGroupName
}}</span></div }}</span></div
> >
<button class="right-button">{{ <button class="right-button" :class="getClass(record)">{{
record?.runStatus?.label ? record.runStatus.label : '--' record.runStatus.value != 0 ? record.runStatus.label : record.switchStatus.label
}}</button> }}</button>
</div> </div>
<div class="light-tag-box"> <div class="light-tag-box">
<div class="tag-box-item"> <div class="tag-box-item">
<img src="/asset/image//bulbLogo/22496.png" alt="" /> <img src="/asset/image//bulbLogo/22496.png" alt="" />
<span class="title">控制模式</span> <span class="title-text">控制模式</span>
<span class="result">{{ record.autoStatus.label }}</span> <span class="result">{{ record.autoStatus.label }}</span>
</div> </div>
<div class="tag-box-item"> <div class="tag-box-item">
<img src="/asset/image//bulbLogo/22496.png" alt="" /> <img src="/asset/image//bulbLogo/22496.png" alt="" />
<span class="title">温度</span> <span class="title-text">温度</span>
<span class="result">{{ record.temp + record.tempUnit }}</span> <span class="result">{{ record.temp + record.tempUnit }}</span>
</div> </div>
<div class="tag-box-item"> <div class="tag-box-item">
<img src="/asset/image//bulbLogo/22496.png" alt="" /> <img src="/asset/image//bulbLogo/22496.png" alt="" />
<span class="title">控制场景</span> <span class="title-text">控制场景</span>
<span class="result">{{ device.scene.label }}</span> <span class="result">{{ device.scene.label }}</span>
</div> </div>
<div class="tag-box-item"> <div class="tag-box-item">
<img src="/asset/image//bulbLogo/22496.png" alt="" /> <img src="/asset/image//bulbLogo/22496.png" alt="" />
<span class="title">风速</span> <span class="title-text">风速</span>
<span class="result">{{ record.windSpeed + record.windSpeedUnit }}</span> <span class="result">{{ record.windSpeed + record.windSpeedUnit }}</span>
</div> </div>
</div> </div>
@ -75,6 +75,23 @@
const device = computed(() => props.device); const device = computed(() => props.device);
// //
const record = computed(() => props.device.record); const record = computed(() => props.device.record);
const getClass = (data: any) => {
let state = data.runStatus.value;
let isOpen = data.switchStatus.value;
//
if (state == 1) {
return 'button-fault';
} else if (state == 2) {
return 'button-repair';
} else if (state == 3) {
return 'button-alarm';
} else if (state == 0 && isOpen == 1) {
return 'button-on';
} else if (state == 0 && isOpen == 0) {
return 'button-off';
}
};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.icon-box { .icon-box {
@ -116,9 +133,29 @@
width: 5em; width: 5em;
height: 26px; height: 26px;
background: rgba(57, 215, 187, 0.1); background: rgba(57, 215, 187, 0.1);
border: 1px solid rgba(57, 215, 187, 1); border-width: 1px;
border-style: solid;
font-size: 12px; font-size: 12px;
color: rgba(57, 215, 187, 1); }
.button-on {
color: #0dffa4;
border-color: #0dffa4;
}
.button-off {
color: #bfcde2;
border-color: #bfcde2;
}
.button-repair {
color: #ffbc46;
border-color: #ffbc46;
}
.button-alarm {
color: #f36163;
border-color: #f36163;
}
.button-fault {
color: #ff7636;
border-color: #ff7636;
} }
} }
} }
@ -140,9 +177,9 @@
vertical-align: middle; vertical-align: middle;
} }
.title { .title-text {
position: absolute; position: absolute;
left: 60px; left: 53px;
top: 13px; top: 13px;
color: rgba(64, 255, 252, 1); color: rgba(64, 255, 252, 1);
} }

37
hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/tabs1.vue

@ -269,7 +269,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, onMounted } from 'vue'; import { ref, computed, onMounted } from 'vue';
import { DownOutlined, UpOutlined, StopOutlined } from '@ant-design/icons-vue'; import { DownOutlined, UpOutlined, StopOutlined } from '@ant-design/icons-vue';
import { message } from 'ant-design-vue'; import { message, Modal } from 'ant-design-vue';
// //
import { http } from '/nerv-lib/util/http'; import { http } from '/nerv-lib/util/http';
import { airConditionControl } from '/@/api/airConditionControlSystem'; import { airConditionControl } from '/@/api/airConditionControlSystem';
@ -736,28 +736,23 @@
if (!changeList.value.length && !lockList.value.length) { if (!changeList.value.length && !lockList.value.length) {
return message.info('未产生任何修改'); return message.info('未产生任何修改');
} }
state.setLoading(true);
http http
.get(planManage.getRunningPlan, { .get(planManage.getRunningPlan, {
deviceType: 2, ctrlType: 2,
projectId: state.projectId, projectId: state.projectId,
siteId: state.siteId, siteId: state.siteId,
}) })
.then((res) => { .then((res) => {
// //
if (res.data && res.data.length) { if (res.data && res.data.length) {
state.setLoading(false);
// 使confirm // 使confirm
// Modal.confirm({ Modal.confirm({
// title: '', title: '提示信息',
// content: '""', content: '有计划正在执行,点击"确定"将暂停当前计划',
// onOk() { onOk() {
// return new Promise((resolve, reject) => { state.setLoading(true);
// });
// },
// onCancel() { },
// });
let flag = window.confirm('有计划正在执行,点击"确定"将暂停当前计划');
if (flag) {
// //
http http
.post(airConditionControl.submitChangeList, { .post(airConditionControl.submitChangeList, {
@ -767,16 +762,21 @@
sceneList: [], sceneList: [],
}) })
.then((res) => { .then((res) => {
console.log(res, '成功');
// //
if (res.retcode == 0) { if (res.retcode == 0) {
sendChangeList(); sendChangeList();
// //
} else { } else {
state.setLoading(false);
message.error('关闭进行中的任务操作失败,请重新尝试'); message.error('关闭进行中的任务操作失败,请重新尝试');
} }
})
.catch(() => {
state.setLoading(false);
});
},
onCancel() {},
}); });
}
// //
} else { } else {
sendChangeList(); sendChangeList();
@ -793,6 +793,7 @@
siteId: state.siteId, siteId: state.siteId,
}) })
.then((res) => { .then((res) => {
state.setLoading(false);
if (res.retcode == 0) { if (res.retcode == 0) {
diffList.value = res.data; diffList.value = res.data;
executeVisible.value = true; executeVisible.value = true;
@ -800,7 +801,9 @@
message.warning('获取修改内容失败'); message.warning('获取修改内容失败');
} }
}) })
.catch(() => {}); .catch(() => {
state.setLoading(false);
});
}; };
// //
const changeCancel = () => {}; const changeCancel = () => {};

14
hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/tabs2.vue

@ -30,7 +30,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="(row, index) in dataSource" :key="index"> <tr v-for="(row, index) in dataSource" v-show="row.executeStatus.value != 0" :key="index">
<td>{{ index + 1 }}</td> <td>{{ index + 1 }}</td>
<td>{{ row.startTime }}</td> <td>{{ row.startTime }}</td>
<td>{{ row.planName }}</td> <td>{{ row.planName }}</td>
@ -162,7 +162,7 @@
projectId: state.projectId, projectId: state.projectId,
siteId: state.siteId, siteId: state.siteId,
// (1,2,3,4,5,6,7) // (1,2,3,4,5,6,7)
deviceType: 2, ctrlType: 2,
}) })
.then((res) => { .then((res) => {
dataSource.value = res.data; dataSource.value = res.data;
@ -184,6 +184,10 @@
}; };
// //
const sendTable = () => { const sendTable = () => {
if (!dataSource.value.length) {
return message.info('没有任何数据可以提交');
}
state.setLoading(true);
http http
.post( .post(
airConditionControl.submitTableData + airConditionControl.submitTableData +
@ -191,6 +195,7 @@
dataSource.value, dataSource.value,
) )
.then((res) => { .then((res) => {
state.setLoading(false);
if (res.retcode == 0) { if (res.retcode == 0) {
message.success('操作成功'); message.success('操作成功');
// //
@ -198,6 +203,9 @@
} else { } else {
message.info(res.msg); message.info(res.msg);
} }
})
.catch(() => {
state.setLoading(false);
}); });
}; };
@ -228,7 +236,7 @@
projectId: state.projectId, projectId: state.projectId,
siteId: state.siteId, siteId: state.siteId,
// (1,2,3,4,5,6,7) // (1,2,3,4,5,6,7)
deviceType: 2, ctrlType: 2,
}) })
.then((res) => { .then((res) => {
let arr: Array<Object> = []; let arr: Array<Object> = [];

32
hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/tabs3.vue

@ -55,16 +55,10 @@
<div class="btn-item"> <div class="btn-item">
<div class="left">控制模式</div> <div class="left">控制模式</div>
<div class="right"> <div class="right">
<span>{{ <span>{{ item.autoStatusBefore.label ? item.autoStatusBefore.label : '--' }}</span>
item.autoStatusBefore.label.indexOf('模式') != -1
? item.autoStatusBefore.label.replace('模式', '')
: item.autoStatusBefore.label
}}</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" /> <img src="/asset/image/bulbLogo/22406.png" alt="" />
<span>{{ <span>{{
item.autoStatusAfter.label.indexOf('模式') != -1 item.autoStatusAfter.label ? item.autoStatusAfter.label : '--'
? item.autoStatusAfter.label.replace('模式', '')
: item.autoStatusAfter.label
}}</span></div }}</span></div
> >
</div> </div>
@ -110,7 +104,7 @@
</div> </div>
</div> </div>
</div> </div>
<div style="width: 100%; height: 80px"></div> <div style="width: 100%; height: 160px"></div>
<div class="button-box"> <div class="button-box">
<button class="cancel" @click="logModalVisible = false">关闭</button> <button class="cancel" @click="logModalVisible = false">关闭</button>
</div> </div>
@ -126,7 +120,8 @@
import { Pagination } from 'ant-design-vue'; import { Pagination } from 'ant-design-vue';
import { http } from '/nerv-lib/util/http'; import { http } from '/nerv-lib/util/http';
import { airConditionControl } from '/@/api/airConditionControlSystem'; import { airConditionControl } from '/@/api/airConditionControlSystem';
//
import { items } from '/@/store/item';
// ======================================================= // =======================================================
// //
@ -140,6 +135,9 @@
getTable(); getTable();
}); });
//
const state = items();
// ====================================================== // ======================================================
// //
@ -154,6 +152,7 @@
let trIndex = ref(-1); let trIndex = ref(-1);
// //
const getTable = (changePage = false) => { const getTable = (changePage = false) => {
state.setLoading(true);
// //
if (changePage) { if (changePage) {
trIndex.value = -1; trIndex.value = -1;
@ -166,9 +165,13 @@
pageNum: pagination.value.pageNum, pageNum: pagination.value.pageNum,
}) })
.then((res) => { .then((res) => {
state.setLoading(false);
let data = res.data; let data = res.data;
dataSource.value = data.records; dataSource.value = data.records;
pagination.value.total = data.total; pagination.value.total = data.total;
})
.catch(() => {
state.setLoading(false);
}); });
}; };
// //
@ -193,8 +196,12 @@
// //
const logModalVisible = ref(false); const logModalVisible = ref(false);
const getLogDetail = (id: any) => { const getLogDetail = (id: any) => {
http.get(airConditionControl.getLogDetail, { logId: id }).then((res) => { state.setLoading(true);
http
.get(airConditionControl.getLogDetail, { logId: id })
.then((res) => {
const data = res.data; const data = res.data;
state.setLoading(false);
if (data && data.length) { if (data && data.length) {
// //
logModalVisible.value = true; logModalVisible.value = true;
@ -202,6 +209,9 @@
} else { } else {
return message.info('返回值无效'); return message.info('返回值无效');
} }
})
.catch(() => {
state.setLoading(false);
}); });
}; };
// //

26
hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue

@ -3,18 +3,14 @@
<div class="lighting-img-box" :class="{ lightingImgBox1: thisFloor == '2' }"> <div class="lighting-img-box" :class="{ lightingImgBox1: thisFloor == '2' }">
<!-- 左上角区域切换 --> <!-- 左上角区域切换 -->
<div class="btn-box"> <div class="btn-box">
<a-popconfirm <button
v-for="(item, index) in floorData" v-for="(item, index) in floorData"
:key="index" :key="index"
title="切换楼层将取消当前的所有修改项" class="btn-item"
ok-text="确定" :class="{ btnActive: item.dataCode == thisFloor }"
cancel-text="取消" @click="changeFloor(item.childList, item.dataCode)"
placement="bottomLeft" >{{ item.name }}</button
@confirm="changeFloor(item.childList, item.dataCode)"> >
<button class="btn-item" :class="{ btnActive: item.dataCode == thisFloor }">{{
item.name
}}</button>
</a-popconfirm>
</div> </div>
<!-- 楼层区域 --> <!-- 楼层区域 -->
<div class="area"> <div class="area">
@ -84,6 +80,7 @@
import { lightingManage } from '/@/api/IlluminationInfo'; import { lightingManage } from '/@/api/IlluminationInfo';
// ICON // ICON
import { DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons-vue'; import { DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons-vue';
import { message, Modal } from 'ant-design-vue';
// //
import { items } from '/@/store/item'; import { items } from '/@/store/item';
@ -110,8 +107,12 @@
// //
const changeFloor = (area: any, floor: string) => { const changeFloor = (area: any, floor: string) => {
if (floor == thisFloor.value) { if (floor == thisFloor.value) {
return; return message.info('已选择此楼层');
} }
Modal.confirm({
title: '提示信息',
content: '切换楼层会放弃已保存的修改内容',
onOk() {
// //
tabs1Ref.value.refresh(false); tabs1Ref.value.refresh(false);
// //
@ -127,6 +128,9 @@
// //
treeData.value[0].selected = true; treeData.value[0].selected = true;
tabs1Ref.value.changeArea(treeData.value[0]); tabs1Ref.value.changeArea(treeData.value[0]);
},
onCancel() {},
});
}; };
// ===================================================== // =====================================================

84
hx-ai-intelligent/src/view/equipmentControl/lightingManage/light.vue

@ -7,59 +7,65 @@
<img src="/asset/image//bulbLogo/21962.png" alt="" /> <img src="/asset/image//bulbLogo/21962.png" alt="" />
<span class="tag-text">{{ blub.regionName + ' > ' + blub.deviceGroupName }}</span></div <span class="tag-text">{{ blub.regionName + ' > ' + blub.deviceGroupName }}</span></div
> >
<button class="right-button">{{ <button class="right-button" :class="getClass(record)">{{
record?.runStatus?.label ? record.runStatus.label : '--' record.runStatus.value != 0 ? record.runStatus.label : record.switchStatus.label
}}</button> }}</button>
</div> </div>
<div class="light-tag-box"> <div class="light-tag-box">
<div class="tag-box-item"> <div class="tag-box-item">
<img src="/asset/image//bulbLogo/22496.png" alt="" /> <img src="/asset/image//bulbLogo/22496.png" alt="" />
<span class="title">控制模式</span> <span class="title-text">控制模式</span>
<span class="result">{{ record.autoStatus.label }}</span> <span class="result">{{ record.autoStatus.label }}</span>
</div> </div>
<div class="tag-box-item"> <div class="tag-box-item">
<img src="/asset/image//bulbLogo/22496.png" alt="" /> <img src="/asset/image//bulbLogo/22496.png" alt="" />
<span class="title">亮度</span> <span class="title-text">亮度</span>
<span class="result">{{ record.brightness + record.brightnessUnit }}</span> <span class="result">{{ record.brightness + record.brightnessUnit }}</span>
</div> </div>
<div class="tag-box-item"> <div class="tag-box-item">
<img src="/asset/image//bulbLogo/22496.png" alt="" /> <img src="/asset/image//bulbLogo/22496.png" alt="" />
<span class="title">控制场景</span> <span class="title-text">控制场景</span>
<span class="result">{{ blub.scene.label }}</span> <span class="result">{{ blub.scene.label }}</span>
</div> </div>
<div class="tag-box-item"> <div class="tag-box-item">
<img src="/asset/image//bulbLogo/22496.png" alt="" /> <img src="/asset/image//bulbLogo/22496.png" alt="" />
<span class="title">色温</span> <span class="title-text">色温</span>
<span class="result">{{ record.LwctemC + record.LwctemCUnit }}</span> <span class="result">{{ record.LwctemC + record.LwctemCUnit }}</span>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<div class="icon-box" :style="props.blub.styleText"> <div class="icon-box" :style="props.blub.styleText">
<!-- 正常=0 -->
<img
v-if="record?.runStatus?.value == 0"
class="icon-item"
src="/asset/image/bulbLogo/on.png"
alt="" />
<!-- 故障=1 --> <!-- 故障=1 -->
<img <img
v-if="record?.runStatus?.value == 1" v-if="record.runStatus.value == 1"
class="icon-item" class="icon-item"
src="/asset/image/bulbLogo/off.png" src="/asset/image/bulbLogo/fault.png"
alt="" /> alt="" />
<!-- 维修=2 --> <!-- 维修=2 -->
<img <img
v-if="record?.runStatus?.value == 2" v-if="record.runStatus.value == 2"
class="icon-item" class="icon-item"
src="/asset/image/bulbLogo/repair.png" src="/asset/image/bulbLogo/repair.png"
alt="" /> alt="" />
<!-- 警告=3 --> <!-- 警告=3 -->
<img <img
v-if="record?.runStatus?.value == 3" v-if="record.runStatus.value == 3"
class="icon-item" class="icon-item"
src="/asset/image/bulbLogo/alarm.png" src="/asset/image/bulbLogo/alarm.png"
alt="" /> alt="" />
<!-- 开启 -->
<img
v-if="record.runStatus.value == 0 && record.switchStatus.value == 1"
class="icon-item"
src="/asset/image/bulbLogo/on.png"
alt="" />
<!-- 关闭 -->
<img
v-if="record.runStatus.value == 0 && record.switchStatus.value == 0"
class="icon-item"
src="/asset/image/bulbLogo/off.png"
alt="" />
</div> </div>
</a-popover> </a-popover>
</template> </template>
@ -73,13 +79,29 @@
const blub = computed(() => props.blub); const blub = computed(() => props.blub);
// //
const record = computed(() => props.blub.record); const record = computed(() => props.blub.record);
const getClass = (data: any) => {
let state = data.runStatus.value;
let isOpen = data.switchStatus.value;
//
if (state == 1) {
return 'button-fault';
} else if (state == 2) {
return 'button-repair';
} else if (state == 3) {
return 'button-alarm';
} else if (state == 0 && isOpen == 1) {
return 'button-on';
} else if (state == 0 && isOpen == 0) {
return 'button-off';
}
};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.icon-box { .icon-box {
width: 28px; width: 28px;
height: 40px; height: 40px;
position: absolute; position: absolute;
.icon-item { .icon-item {
width: 25px; width: 25px;
cursor: pointer; cursor: pointer;
@ -115,9 +137,29 @@
width: 5em; width: 5em;
height: 26px; height: 26px;
background: rgba(57, 215, 187, 0.1); background: rgba(57, 215, 187, 0.1);
border: 1px solid rgba(57, 215, 187, 1); border-width: 1px;
border-style: solid;
font-size: 12px; font-size: 12px;
color: rgba(57, 215, 187, 1); }
.button-on {
color: #0dffa4;
border-color: #0dffa4;
}
.button-off {
color: #bfcde2;
border-color: #bfcde2;
}
.button-repair {
color: #ffbc46;
border-color: #ffbc46;
}
.button-alarm {
color: #f36163;
border-color: #f36163;
}
.button-fault {
color: #ff7636;
border-color: #ff7636;
} }
} }
} }
@ -139,9 +181,9 @@
vertical-align: middle; vertical-align: middle;
} }
.title { .title-text {
position: absolute; position: absolute;
left: 60px; left: 53px;
top: 13px; top: 13px;
color: rgba(64, 255, 252, 1); color: rgba(64, 255, 252, 1);
} }

37
hx-ai-intelligent/src/view/equipmentControl/lightingManage/lightPosition.ts

@ -1,51 +1,52 @@
// 此文件只定义light(即俯视图小灯泡)的位置信息 // 此文件只定义light(即俯视图小灯泡)的位置信息
// 与显示状态和分组信息无关 // 与显示状态和分组信息无关
export const lightPosition = [ export const lightPosition = [
// 安检区A // 走廊西
{ left: '160px', bottom: '270px' }, { left: '160px', bottom: '270px' },
{ left: '185px', bottom: '230px' }, { left: '185px', bottom: '230px' },
{ left: '220px', bottom: '180px' }, { left: '220px', bottom: '180px' },
{ left: '250px', bottom: '130px' }, { left: '250px', bottom: '130px' },
// 站厅区B 1组 // 办公西区 1组
{ left: '240px', bottom: '290px' }, { left: '240px', bottom: '290px' },
{ left: '260px', bottom: '260px' }, { left: '260px', bottom: '260px' },
{ left: '280px', bottom: '230px' }, { left: '280px', bottom: '230px' },
{ left: '310px', bottom: '190px' }, { left: '310px', bottom: '190px' },
{ left: '330px', bottom: '160px' }, { left: '330px', bottom: '160px' },
// 站厅区B 2组 // 办公西区 2组
{ left: '300px', bottom: '305px' }, { left: '300px', bottom: '305px' },
{ left: '325px', bottom: '275px' }, { left: '325px', bottom: '275px' },
{ left: '350px', bottom: '245px' }, { left: '350px', bottom: '245px' },
{ left: '375px', bottom: '215px' }, { left: '375px', bottom: '215px' },
{ left: '400px', bottom: '180px' }, { left: '400px', bottom: '180px' },
// 站台区A 1组 // 站厅西区 1组
{ left: '370px', bottom: '320px' }, { left: '370px', bottom: '320px' },
{ left: '470px', bottom: '210px' }, { left: '470px', bottom: '210px' },
// 站台区A 2组 // 站厅西区 2组
{ left: '425px', bottom: '335px' }, { left: '425px', bottom: '335px' },
{ left: '530px', bottom: '230px' }, { left: '530px', bottom: '230px' },
// 站台区A 3组 // 站厅西区 3组
{ left: '475px', bottom: '350px' }, { left: '475px', bottom: '350px' },
{ left: '590px', bottom: '250px' }, { left: '590px', bottom: '250px' },
// 站台区A 4组 // 站厅西区 4组
{ left: '530px', bottom: '365px' }, { left: '530px', bottom: '365px' },
{ left: '640px', bottom: '270px' }, { left: '640px', bottom: '270px' },
// 一楼办公 // 临检
{ left: '570px', bottom: '390px' }, { left: '570px', bottom: '390px' },
{ left: '605px', bottom: '365px' }, { left: '605px', bottom: '365px' },
{ left: '640px', bottom: '340px' }, { left: '640px', bottom: '340px' },
{ left: '675px', bottom: '315px' }, { left: '675px', bottom: '315px' },
{ left: '710px', bottom: '290px' }, { left: '710px', bottom: '290px' },
// 安保区 4 分组 // 安检区
{ left: '670px', bottom: '370px' }, { left: '635px', bottom: '405px' },
{ left: '720px', bottom: '385px' }, { left: '675px', bottom: '375px' },
{ left: '770px', bottom: '400px' }, { left: '725px', bottom: '340px' },
{ left: '820px', bottom: '415px' }, { left: '780px', bottom: '305px' },
// 一楼男厕A // 站厅东区 共4组
{ left: '810px', bottom: '455px' }, { left: '690px', bottom: '420px' },
{ left: '970px', bottom: '370px' }, { left: '835px', bottom: '330px' },
{ left: '850px', bottom: '465px' }, { left: '800px', bottom: '390px' },
{ left: '1010px', bottom: '385px' }, { left: '850px', bottom: '400px' },
{ left: '900px', bottom: '410px' },
]; ];
export const lightPosition1 = [ export const lightPosition1 = [

44
hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue

@ -249,7 +249,7 @@
</div> </div>
</div> </div>
</div> </div>
<div style="width: 100%; height: 60px"></div> <div style="width: 100%; height: 100px"></div>
<div class="button-box"> <div class="button-box">
<button class="cancel" @click="executeVisible = false">取消</button> <button class="cancel" @click="executeVisible = false">取消</button>
<a-popconfirm <a-popconfirm
@ -736,28 +736,22 @@
if (!changeList.value.length && !lockList.value.length) { if (!changeList.value.length && !lockList.value.length) {
return message.info('未产生任何修改'); return message.info('未产生任何修改');
} }
state.setLoading(true);
http http
.get(planManage.getRunningPlan, { .get(planManage.getRunningPlan, {
deviceType: 1, ctrlType: 1,
projectId: state.projectId, projectId: state.projectId,
siteId: state.siteId, siteId: state.siteId,
}) })
.then((res) => { .then((res) => {
// //
if (res.data && res.data.length) { if (res.data && res.data.length) {
// 使confirm state.setLoading(false);
// Modal.confirm({ Modal.confirm({
// title: '', title: '提示信息',
// content: '""', content: '有计划正在执行,点击"确定"将暂停当前计划',
// onOk() { onOk() {
// return new Promise((resolve, reject) => { state.setLoading(true);
// });
// },
// onCancel() { },
// });
let flag = window.confirm('有计划正在执行,点击"确定"将暂停当前计划');
if (flag) {
// //
http http
.post(lightingManage.submitChangeList, { .post(lightingManage.submitChangeList, {
@ -767,16 +761,21 @@
sceneList: [], sceneList: [],
}) })
.then((res) => { .then((res) => {
console.log(res, '成功');
// //
if (res.retcode == 0) { if (res.retcode == 0) {
sendChangeList(); sendChangeList();
// //
} else { } else {
state.setLoading(false);
message.error('关闭进行中的任务操作失败,请重新尝试'); message.error('关闭进行中的任务操作失败,请重新尝试');
} }
})
.catch(() => {
state.setLoading(false);
});
},
onCancel() {},
}); });
}
// //
} else { } else {
sendChangeList(); sendChangeList();
@ -793,6 +792,7 @@
siteId: state.siteId, siteId: state.siteId,
}) })
.then((res) => { .then((res) => {
state.setLoading(false);
if (res.retcode == 0) { if (res.retcode == 0) {
diffList.value = res.data; diffList.value = res.data;
executeVisible.value = true; executeVisible.value = true;
@ -800,7 +800,9 @@
message.error('获取修改内容失败'); message.error('获取修改内容失败');
} }
}) })
.catch(() => {}); .catch(() => {
state.setLoading(false);
});
}; };
// //
const changeCancel = () => {}; const changeCancel = () => {};
@ -838,6 +840,7 @@
}; };
// //
const submitChangeList = () => { const submitChangeList = () => {
state.setLoading(true);
http http
.post(lightingManage.submitChangeList, { .post(lightingManage.submitChangeList, {
sceneList: changeList.value, sceneList: changeList.value,
@ -846,6 +849,7 @@
siteId: state.siteId, siteId: state.siteId,
}) })
.then((res) => { .then((res) => {
state.setLoading(false);
let data = res.data; let data = res.data;
// //
if (res.retcode != 0) { if (res.retcode != 0) {
@ -862,7 +866,9 @@
refresh(true); refresh(true);
emit('resetAll'); emit('resetAll');
}) })
.catch(() => {}); .catch(() => {
state.setLoading(false);
});
}; };
// ======================================================================== // ========================================================================

14
hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs2.vue

@ -30,7 +30,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="(row, index) in dataSource" :key="index"> <tr v-for="(row, index) in dataSource" v-show="row.executeStatus.value != 0" :key="index">
<td>{{ index + 1 }}</td> <td>{{ index + 1 }}</td>
<td>{{ row.startTime }}</td> <td>{{ row.startTime }}</td>
<td>{{ row.planName }}</td> <td>{{ row.planName }}</td>
@ -163,7 +163,7 @@
projectId: state.projectId, projectId: state.projectId,
siteId: state.siteId, siteId: state.siteId,
// (1,2,3,4,5,6,7) // (1,2,3,4,5,6,7)
deviceType: 1, ctrlType: 1,
}) })
.then((res) => { .then((res) => {
dataSource.value = res.data; dataSource.value = res.data;
@ -185,6 +185,10 @@
}; };
// //
const sendTable = () => { const sendTable = () => {
if (!dataSource.value.length) {
return message.info('没有任何数据可以提交');
}
state.setLoading(true);
http http
.post( .post(
lightingManage.submitTableData + lightingManage.submitTableData +
@ -192,6 +196,7 @@
dataSource.value, dataSource.value,
) )
.then((res) => { .then((res) => {
state.setLoading(false);
if (res.retcode == 0) { if (res.retcode == 0) {
message.success('操作成功'); message.success('操作成功');
// //
@ -199,6 +204,9 @@
} else { } else {
message.info(res.msg); message.info(res.msg);
} }
})
.catch(() => {
state.setLoading(false);
}); });
}; };
@ -229,7 +237,7 @@
projectId: state.projectId, projectId: state.projectId,
siteId: state.siteId, siteId: state.siteId,
// (1,2,3,4,5,6,7) // (1,2,3,4,5,6,7)
deviceType: 1, ctrlType: 1,
}) })
.then((res) => { .then((res) => {
let arr: Array<Object> = []; let arr: Array<Object> = [];

31
hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs3.vue

@ -55,16 +55,10 @@
<div class="btn-item"> <div class="btn-item">
<div class="left">控制模式</div> <div class="left">控制模式</div>
<div class="right"> <div class="right">
<span>{{ <span>{{ item.autoStatusBefore.label ? item.autoStatusBefore.label : '--' }}</span>
item.autoStatusBefore.label.indexOf('模式') != -1
? item.autoStatusBefore.label.replace('模式', '')
: item.autoStatusBefore.label
}}</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" /> <img src="/asset/image/bulbLogo/22406.png" alt="" />
<span>{{ <span>{{
item.autoStatusAfter.label.indexOf('模式') != -1 item.autoStatusAfter.label ? item.autoStatusAfter.label : '--'
? item.autoStatusAfter.label.replace('模式', '')
: item.autoStatusAfter.label
}}</span></div }}</span></div
> >
</div> </div>
@ -109,7 +103,7 @@
</div> </div>
</div> </div>
</div> </div>
<div style="width: 100%; height: 80px"></div> <div style="width: 100%; height: 160px"></div>
<div class="button-box"> <div class="button-box">
<button class="cancel" @click="logModalVisible = false">关闭</button> <button class="cancel" @click="logModalVisible = false">关闭</button>
</div> </div>
@ -125,6 +119,8 @@
import { Pagination } from 'ant-design-vue'; import { Pagination } from 'ant-design-vue';
import { http } from '/nerv-lib/util/http'; import { http } from '/nerv-lib/util/http';
import { lightingManage } from '/@/api/IlluminationInfo'; import { lightingManage } from '/@/api/IlluminationInfo';
//
import { items } from '/@/store/item';
// ======================================================= // =======================================================
@ -139,6 +135,9 @@
getTable(); getTable();
}); });
//
const state = items();
// ====================================================== // ======================================================
// //
@ -153,6 +152,7 @@
let trIndex = ref(-1); let trIndex = ref(-1);
// //
const getTable = (changePage = false) => { const getTable = (changePage = false) => {
state.setLoading(true);
// //
if (changePage) { if (changePage) {
trIndex.value = -1; trIndex.value = -1;
@ -165,9 +165,13 @@
pageNum: pagination.value.pageNum, pageNum: pagination.value.pageNum,
}) })
.then((res) => { .then((res) => {
state.setLoading(false);
let data = res.data; let data = res.data;
dataSource.value = data.records; dataSource.value = data.records;
pagination.value.total = data.total; pagination.value.total = data.total;
})
.catch(() => {
state.setLoading(false);
}); });
}; };
// //
@ -192,7 +196,11 @@
// //
const logModalVisible = ref(false); const logModalVisible = ref(false);
const getLogDetail = (id: any) => { const getLogDetail = (id: any) => {
http.get(lightingManage.getLogDetail, { logId: id }).then((res) => { state.setLoading(true);
http
.get(lightingManage.getLogDetail, { logId: id })
.then((res) => {
state.setLoading(false);
const data = res.data; const data = res.data;
if (data && data.length) { if (data && data.length) {
// //
@ -201,6 +209,9 @@
} else { } else {
return message.info('返回值无效'); return message.info('返回值无效');
} }
})
.catch(() => {
state.setLoading(false);
}); });
}; };
// //

4
hx-ai-intelligent/src/view/equipmentControl/style/dialogStyle.less

@ -108,7 +108,7 @@
line-height: 35px; line-height: 35px;
text-align: left; text-align: left;
padding-left: 10px; padding-left: 10px;
font-size: 14px; font-size: 13px;
:first-child { :first-child {
color: white; color: white;
} }
@ -116,7 +116,7 @@
vertical-align: middle; vertical-align: middle;
} }
img { img {
padding: 0 5px; padding: 0 2px;
} }
} }
} }

39
hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/fanControl.vue

@ -215,7 +215,7 @@
</div> </div>
</div> </div>
</div> </div>
<div style="width: 100%; height: 60px"></div> <div style="width: 100%; height: 100px"></div>
<div class="button-box"> <div class="button-box">
<button class="cancel" @click="executeVisible = false">取消</button> <button class="cancel" @click="executeVisible = false">取消</button>
<a-popconfirm <a-popconfirm
@ -686,28 +686,22 @@
if (!changeList.value.length && !lockList.value.length) { if (!changeList.value.length && !lockList.value.length) {
return message.info('未产生任何修改'); return message.info('未产生任何修改');
} }
state.setLoading(true);
http http
.get(planManage.getRunningPlan, { .get(planManage.getRunningPlan, {
deviceType: url.deviceType, ctrlType: url.deviceType,
projectId: state.projectId, projectId: state.projectId,
siteId: state.siteId, siteId: state.siteId,
}) })
.then((res) => { .then((res) => {
// //
if (res.data && res.data.length) { if (res.data && res.data.length) {
// 使confirm state.setLoading(false);
// Modal.confirm({ Modal.confirm({
// title: '', title: '提示信息',
// content: '""', content: '有计划正在执行,点击"确定"将暂停当前计划',
// onOk() { onOk() {
// return new Promise((resolve, reject) => { state.setLoading(false);
// });
// },
// onCancel() { },
// });
let flag = window.confirm('有计划正在执行,点击"确定"将暂停当前计划');
if (flag) {
// //
http http
.post(url.getList, { .post(url.getList, {
@ -717,16 +711,22 @@
sceneList: [], sceneList: [],
}) })
.then((res) => { .then((res) => {
console.log(res, '成功');
// //
if (res.retcode == 0) { if (res.retcode == 0) {
sendChangeList(); sendChangeList();
// //
} else { } else {
state.setLoading(false);
message.error('关闭进行中的任务操作失败,请重新尝试'); message.error('关闭进行中的任务操作失败,请重新尝试');
} }
})
.catch(() => {
state.setLoading(false);
}); });
} },
onCancel() {},
});
// //
} else { } else {
sendChangeList(); sendChangeList();
@ -743,6 +743,7 @@
siteId: state.siteId, siteId: state.siteId,
}) })
.then((res) => { .then((res) => {
state.setLoading(false);
if (res.retcode == 0) { if (res.retcode == 0) {
diffList.value = res.data; diffList.value = res.data;
executeVisible.value = true; executeVisible.value = true;
@ -750,7 +751,9 @@
message.error('获取修改内容失败'); message.error('获取修改内容失败');
} }
}) })
.catch(() => {}); .catch(() => {
state.setLoading(false);
});
}; };
// //
const changeCancel = () => {}; const changeCancel = () => {};

28
hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/fanLog.vue

@ -55,16 +55,10 @@
<div class="btn-item"> <div class="btn-item">
<div class="left">控制模式</div> <div class="left">控制模式</div>
<div class="right"> <div class="right">
<span>{{ <span>{{ item.autoStatusBefore.label ? item.autoStatusBefore.label : '--' }}</span>
item.autoStatusBefore.label.indexOf('模式') != -1
? item.autoStatusBefore.label.replace('模式', '')
: item.autoStatusBefore.label
}}</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" /> <img src="/asset/image/bulbLogo/22406.png" alt="" />
<span>{{ <span>{{
item.autoStatusAfter.label.indexOf('模式') != -1 item.autoStatusAfter.label ? item.autoStatusAfter.label : '--'
? item.autoStatusAfter.label.replace('模式', '')
: item.autoStatusAfter.label
}}</span></div }}</span></div
> >
</div> </div>
@ -109,7 +103,7 @@
</div> </div>
</div> </div>
</div> </div>
<div style="width: 100%; height: 80px"></div> <div style="width: 100%; height: 160px"></div>
<div class="button-box"> <div class="button-box">
<button class="cancel" @click="logModalVisible = false">关闭</button> <button class="cancel" @click="logModalVisible = false">关闭</button>
</div> </div>
@ -125,7 +119,6 @@
import { Pagination } from 'ant-design-vue'; import { Pagination } from 'ant-design-vue';
import { http } from '/nerv-lib/util/http'; import { http } from '/nerv-lib/util/http';
import { ventilating } from '/@/api/ventilatingSystem'; import { ventilating } from '/@/api/ventilatingSystem';
// //
import { items } from '/@/store/item'; import { items } from '/@/store/item';
@ -183,6 +176,7 @@
let trIndex = ref(-1); let trIndex = ref(-1);
// //
const getTable = (changePage = false) => { const getTable = (changePage = false) => {
state.setLoading(true);
// //
if (changePage) { if (changePage) {
trIndex.value = -1; trIndex.value = -1;
@ -195,16 +189,19 @@
pageNum: pagination.value.pageNum, pageNum: pagination.value.pageNum,
}) })
.then((res) => { .then((res) => {
state.setLoading(false);
let data = res.data; let data = res.data;
dataSource.value = data.records; dataSource.value = data.records;
pagination.value.total = data.total; pagination.value.total = data.total;
})
.catch(() => {
state.setLoading(false);
}); });
}; };
// //
const reset = () => { const reset = () => {
trIndex.value = -1; trIndex.value = -1;
logModalVisible.value = false; logModalVisible.value = false;
// state.setLoading(true);
pagination.value = { pagination.value = {
pageSize: 10, pageSize: 10,
pageNum: 1, pageNum: 1,
@ -223,7 +220,11 @@
// //
const logModalVisible = ref(false); const logModalVisible = ref(false);
const getLogDetail = (id: any) => { const getLogDetail = (id: any) => {
http.get(logDetail, { logId: id }).then((res) => { state.setLoading(true);
http
.get(logDetail, { logId: id })
.then((res) => {
state.setLoading(false);
const data = res.data; const data = res.data;
if (data && data.length) { if (data && data.length) {
// //
@ -232,6 +233,9 @@
} else { } else {
return message.info('返回值无效'); return message.info('返回值无效');
} }
})
.catch(() => {
state.setLoading(false);
}); });
}; };
const cxList = ref([]); const cxList = ref([]);

14
hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/fanPlant.vue

@ -30,7 +30,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="(row, index) in dataSource" :key="index"> <tr v-for="(row, index) in dataSource" v-show="row.executeStatus.value != 0" :key="index">
<td>{{ index + 1 }}</td> <td>{{ index + 1 }}</td>
<td>{{ row.startTime }}</td> <td>{{ row.startTime }}</td>
<td>{{ row.planName }}</td> <td>{{ row.planName }}</td>
@ -177,7 +177,7 @@
projectId: state.projectId, projectId: state.projectId,
siteId: state.siteId, siteId: state.siteId,
// (1,2,3,4,5,6,7) // (1,2,3,4,5,6,7)
deviceType: props.type, ctrlType: props.type,
}) })
.then((res) => { .then((res) => {
dataSource.value = res.data; dataSource.value = res.data;
@ -199,12 +199,17 @@
}; };
// //
const sendTable = () => { const sendTable = () => {
if (!dataSource.value.length) {
return message.info('没有任何数据可以提交');
}
state.setLoading(true);
http http
.post( .post(
url + `?projectId=${state.projectId}${state.siteId ? `&siteId=${state.siteId}` : ''}`, url + `?projectId=${state.projectId}${state.siteId ? `&siteId=${state.siteId}` : ''}`,
dataSource.value, dataSource.value,
) )
.then((res) => { .then((res) => {
state.setLoading(false);
if (res.retcode == 0) { if (res.retcode == 0) {
message.success('操作成功'); message.success('操作成功');
// //
@ -212,6 +217,9 @@
} else { } else {
message.info(res.msg); message.info(res.msg);
} }
})
.catch(() => {
state.setLoading(false);
}); });
}; };
@ -242,7 +250,7 @@
projectId: state.projectId, projectId: state.projectId,
siteId: state.siteId, siteId: state.siteId,
// (1,2,3,4,5,6,7) // (1,2,3,4,5,6,7)
deviceType: props.type, ctrlType: props.type,
}) })
.then((res) => { .then((res) => {
let arr: Array<Object> = []; let arr: Array<Object> = [];

14
lib/component/form/input/input.vue

@ -1,5 +1,5 @@
<template> <template>
<a-input> <a-input @keydown="handleKeyDown">
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item"> <template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
<slot :name="item" v-bind="data || {}"> </slot> <slot :name="item" v-bind="data || {}"> </slot>
</template> </template>
@ -10,7 +10,17 @@
export default defineComponent({ export default defineComponent({
name: 'NsInput', name: 'NsInput',
setup() {}, setup() {
const handleKeyDown = (event: KeyboardEvent) => {
// Check if the pressed key is a space
if (event.code === 'Space') {
event.preventDefault();
}
};
return {
handleKeyDown,
};
},
}); });
</script> </script>
<style lang="less" scoped></style> <style lang="less" scoped></style>

Loading…
Cancel
Save