Browse Source

table组件去掉row-selection

temp
zhaohy 1 month ago
committed by duyufeng
parent
commit
6a349afcf2
  1. 2
      hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts
  2. 112
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/config.ts
  3. 88
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue
  4. 5
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue
  5. 5
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue
  6. 24
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue
  7. 71
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue
  8. 2
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue
  9. 12
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/index.vue
  10. 3
      lib/component/table/table.vue

2
hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts

@ -11,6 +11,7 @@ export enum carbonEmissionFactorLibrary {
move = '/carbon-smart/api/carbon/emission/type/move', move = '/carbon-smart/api/carbon/emission/type/move',
import = '/carbon-smart/api/carbon/emission/factor/import', import = '/carbon-smart/api/carbon/emission/factor/import',
export = '/carbon-smart/api/carbon/emission/factor/export', export = '/carbon-smart/api/carbon/emission/factor/export',
gasAndDatabase = '/carbon-smart/api/carbon/emission/factor/gasAndDatabase',
// 单位管理 // 单位管理
dictionaryUnitManagement = '/carbon-smart/client/dict/dictionaryUnitManagement', dictionaryUnitManagement = '/carbon-smart/client/dict/dictionaryUnitManagement',
findOutermost = '/carbon-smart/client/dict/findOutermost', findOutermost = '/carbon-smart/client/dict/findOutermost',
@ -64,6 +65,7 @@ export enum carbonInventoryCheck {
getDetailsList = '/carbon-smart/api/carbon/inventory/details/getDetailsList', getDetailsList = '/carbon-smart/api/carbon/inventory/details/getDetailsList',
updateTable = '/carbon-smart/api/carbon/inventory/details/update', updateTable = '/carbon-smart/api/carbon/inventory/details/update',
voucherDownloadList = '/carbon-smart/api/carbon/inventory/details/voucherDownloadList', voucherDownloadList = '/carbon-smart/api/carbon/inventory/details/voucherDownloadList',
nodeCancellationConsumption = '/carbon-smart/api/carbon/inventory/details/nodeCancellationConsumption',
// 排放统计接口 // 排放统计接口
emissionStatistic = '/carbon-smart/api/carbon/inventory/emissionStatistic', emissionStatistic = '/carbon-smart/api/carbon/inventory/emissionStatistic',
// 碳排流向 // 碳排流向

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

@ -17,12 +17,12 @@ export const formConfig = (disabled) => {
placeholder: '请输入排放源', placeholder: '请输入排放源',
maxLength: 20, maxLength: 20,
}, },
rules: [ // rules: [
{ // {
required: true, // required: true,
message: '请输入排放源', // message: '请输入排放源',
}, // },
], // ],
}, },
{ {
field: 'emissionType', field: 'emissionType',
@ -32,15 +32,18 @@ export const formConfig = (disabled) => {
componentProps: { componentProps: {
placeholder: '请选择排放分类', placeholder: '请选择排放分类',
api: carbonEmissionFactorLibrary.getCarbonFactorTree, api: carbonEmissionFactorLibrary.getCarbonFactorTree,
defaultParams: {
orgId: sessionStorage.getItem('ORGID'),
},
fieldNames: { label: 'emissionName', value: 'id' }, fieldNames: { label: 'emissionName', value: 'id' },
showSearch: true, showSearch: true,
}, },
rules: [ // rules: [
{ // {
required: true, // required: true,
message: '请选择排放分类', // message: '请选择排放分类',
}, // },
], // ],
}, },
{ {
field: 'emissionGas', field: 'emissionGas',
@ -76,32 +79,13 @@ export const formConfig = (disabled) => {
}, },
], ],
}, },
rules: [ // rules: [
{ // {
required: true, // required: true,
message: '请选择排放气体', // message: '请选择排放气体',
}, // },
], // ],
}, },
// {
// field: 'emissionProcess',
// label: '排放环节',
// component: 'NsSelectApi',
// componentProps: {
// api: carbonEmissionFactorLibrary.getEmissionProcess,
// params: {
// emissionType: sessionStorage.getItem('checkedTreeNode'),
// },
// resultField: 'data',
// labelField: 'emissionProcess',
// valueField: 'emissionProcess',
// immediate: true,
// autoSelectFirst: false,
// filterOption:false,
// showSearch:true,
// autoClearSearchValue:false
// },
// },
{ {
label: '排放环节', label: '排放环节',
field: 'emissionProcess', field: 'emissionProcess',
@ -110,12 +94,12 @@ export const formConfig = (disabled) => {
placeholder: '请输入排放环节', placeholder: '请输入排放环节',
maxLength: 20, maxLength: 20,
}, },
rules: [ // rules: [
{ // {
required: true, // required: true,
message: '请输入排放环节', // message: '请输入排放环节',
}, // },
], // ],
}, },
{ {
label: '排放因子', label: '排放因子',
@ -125,13 +109,13 @@ export const formConfig = (disabled) => {
placeholder: '请输入排放因子值', placeholder: '请输入排放因子值',
maxLength: 20, maxLength: 20,
}, },
rules: [ // rules: [
{ // {
required: true, // required: true,
message: '请输入排放因子值', // message: '请输入排放因子值',
trigger: 'change', // trigger: 'change',
}, // },
], // ],
}, },
{ {
field: 'carbonEmissionPrefix', field: 'carbonEmissionPrefix',
@ -157,12 +141,12 @@ export const formConfig = (disabled) => {
}, },
], ],
}, },
rules: [ // rules: [
{ // {
required: true, // required: true,
message: '请选择碳排前缀', // message: '请选择碳排前缀',
}, // },
], // ],
}, },
{ {
label: '碳排后缀', label: '碳排后缀',
@ -172,25 +156,25 @@ export const formConfig = (disabled) => {
placeholder: '请输入碳排后缀', placeholder: '请输入碳排后缀',
maxLength: 20, maxLength: 20,
}, },
rules: [ // rules: [
{ // {
required: true, // required: true,
message: '请输入碳排后缀', // message: '请输入碳排后缀',
}, // },
], // ],
}, },
{ {
label: '已引用数', label: '已引用数',
field: 'numberOfReferences', field: 'numberOfReferences',
component: 'NsInput', component: 'NsInput',
componentProps: { componentProps: {
defaultValue: 10, defaultValue: '',
disabled: true, disabled: true,
maxLength: 20, maxLength: 20,
}, },
}, },
{ {
label: '参考文献', label: '参考文献(选填)',
field: 'bibliography', field: 'bibliography',
component: 'NsTextarea', component: 'NsTextarea',
componentProps: { componentProps: {

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

@ -621,7 +621,7 @@
setTimeout(() => { setTimeout(() => {
formData.value = { formData.value = {
carbonEmissionPrefix: 't', carbonEmissionPrefix: 't',
numberOfReferences: '10', numberOfReferences: '',
orgId: orgId.value, orgId: orgId.value,
}; };
userAuthList.value.splice(0); userAuthList.value.splice(0);
@ -778,17 +778,23 @@
userAuthList.value.splice(0); userAuthList.value.splice(0);
setTimeout(() => { setTimeout(() => {
const measurementUnit = ref([]); const measurementUnit = ref([]);
http.post(carbonEmissionFactorLibrary.getCarbonFactorTree, {}).then((res) => { http
measurementUnit.value = res.data; .post(carbonEmissionFactorLibrary.getCarbonFactorTree, { orgId: orgId.value })
http.post(carbonEmissionFactorLibrary.findById, { id: record.id }).then((res) => { .then((res) => {
if (res.data.emissionType) { measurementUnit.value = res.data;
let selectDevice = ref([Number(res.data.emissionType)]); http.post(carbonEmissionFactorLibrary.findById, { id: record.id }).then((res) => {
findParentIds(measurementUnit.value, res.data.emissionType, selectDevice.value); if (res.data.emissionType) {
res.data.emissionType = selectDevice; let selectDevice = ref([Number(res.data.emissionType)]);
} findParentIds(
formData.value = res.data; measurementUnit.value,
res.data.emissionType,
selectDevice.value,
);
res.data.emissionType = selectDevice;
}
formData.value = res.data;
});
}); });
});
}, 10); }, 10);
opMap.value.type = 'edit'; opMap.value.type = 'edit';
opMap.value.fuc = (formData: any) => { opMap.value.fuc = (formData: any) => {
@ -846,56 +852,36 @@
{ {
field: 'emissionGas', field: 'emissionGas',
label: '排放气体', label: '排放气体',
component: 'NsSelect', component: 'NsSelectApi',
componentProps: { componentProps: {
allowClear: true,
placeholder: '请选择排放气体', placeholder: '请选择排放气体',
options: [ api: carbonEmissionFactorLibrary.gasAndDatabase,
{ params: {
label: 'CO2', orgId: orgId.value,
value: 1, emissionList,
}, type: 'gas',
{ },
label: 'CO2e', immediate: true,
value: 2, labelField: 'label',
}, valueField: 'value',
{
label: 'SF6',
value: 3,
},
{
label: 'CH4',
value: 4,
},
{
label: 'PFCs',
value: 5,
},
{
label: 'HFCs',
value: 6,
},
],
}, },
}, },
{ {
field: 'carbonDatabase', field: 'carbonDatabase',
label: '数据库名称', label: '数据库名称',
component: 'NsSelect', component: 'NsSelectApi',
componentProps: { componentProps: {
allowClear: true, allowClear: true,
placeholder: '请选择数据库名称', placeholder: '请选择数据库名称',
showSearch: true, api: carbonEmissionFactorLibrary.gasAndDatabase,
options: [ params: {
{ orgId: orgId.value,
label: '正常', emissionList,
value: '正常', type: 'database',
}, },
{ immediate: true,
label: '冻结', labelField: 'label',
value: '冻结', valueField: 'value',
},
],
}, },
}, },
{ {

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

@ -3,7 +3,7 @@
<a-table <a-table
:columns="column" :columns="column"
:data-source="data" :data-source="data"
bordered :bordered="false"
:pagination="false" :pagination="false"
:scroll="{ x: 2000, y: 480 }"> :scroll="{ x: 2000, y: 480 }">
<template #title> <template #title>
@ -189,6 +189,9 @@
:deep(.ant-table-container) { :deep(.ant-table-container) {
padding: 0px 16px; padding: 0px 16px;
} }
:deep(.ant-table-cell) {
border: 1px solid #f0f0f0;
}
</style> </style>
<style scoped> <style scoped>
th.column-money, th.column-money,

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

@ -1084,9 +1084,9 @@
const handleChange = (info: UploadChangeParam) => { const handleChange = (info: UploadChangeParam) => {
// fileList.value = [...info.fileList]; // fileList.value = [...info.fileList];
const { fileList: newFileList } = info; const { fileList: newFileList } = info;
delIds.value.push(info.fileList[0].uid);
// fileList // fileList
if (newFileList.length > 1) { if (newFileList.length > 1) {
delIds.value.push(info.fileList[0].uid);
newFileList.shift(); // newFileList.shift(); //
} }
@ -1257,6 +1257,9 @@
.grey-background.ant-switch .ant-switch-handle { .grey-background.ant-switch .ant-switch-handle {
background-color: rgba(238, 238, 238, 1) !important; background-color: rgba(238, 238, 238, 1) !important;
} }
:deep(.ant-table-container) {
padding: unset;
}
</style> </style>
<style scoped> <style scoped>
th.column-money, th.column-money,

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

@ -82,6 +82,7 @@
:footer-style="{ textAlign: 'right' }" :footer-style="{ textAlign: 'right' }"
destroyOnClose destroyOnClose
@close="onClose"> @close="onClose">
<div class="editTitle"><div class="title">编辑</div></div>
<a-form <a-form
ref="formRef" ref="formRef"
:model="formState" :model="formState"
@ -381,8 +382,8 @@
}; };
// / // /
const formRef = ref(); const formRef = ref();
const labelCol = { span: 6 }; const labelCol = { span: 4 };
const wrapperCol = { span: 18 }; const wrapperCol = { span: 20 };
const formState = ref({ const formState = ref({
orgId: orgId.value, orgId: orgId.value,
}); });
@ -396,7 +397,6 @@
// //
const addNewData = () => { const addNewData = () => {
visible.value = true; visible.value = true;
// getNewTable();
}; };
// //
const selectedRowKeys = ref([]); const selectedRowKeys = ref([]);
@ -419,11 +419,15 @@
const selectData = ref(); const selectData = ref();
const keyChange = () => { const keyChange = () => {
if (selectData.value === '') { if (selectData.value === '') {
queryData.value.emissionSources = emissionSources.value; if (emissionSources.value) {
queryData.value.emissionSources = emissionSources.value;
} else {
queryData.value.emissionSources = '';
}
} else { } else {
queryData.value.emissionSources = selectData.value; queryData.value.emissionSources = selectData.value;
getNewTable();
} }
getNewTable();
}; };
// //
const editData = (record) => { const editData = (record) => {
@ -490,13 +494,14 @@
visible.value = false; visible.value = false;
selectedRowKeys.value = []; selectedRowKeys.value = [];
formState.value = {}; formState.value = {};
selectData.value = '';
formRef.value.resetFields(); formRef.value.resetFields();
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.main { .main {
background-color: @ns-content-bg; background-color: #ffffff;
display: flex; display: flex;
height: 100%; height: 100%;
padding: 16px; padding: 16px;
@ -554,6 +559,10 @@
padding-bottom: 10px; padding-bottom: 10px;
border-bottom: 1px solid #e9e9e9; border-bottom: 1px solid #e9e9e9;
} }
.editTitle {
font-weight: bold;
user-select: text;
}
.title { .title {
text-align: left; text-align: left;
height: 32px; height: 32px;
@ -588,6 +597,9 @@
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
} }
:deep(.ant-table-container) {
padding: unset;
}
</style> </style>
<style scoped> <style scoped>
th.column-money, th.column-money,

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

@ -280,6 +280,21 @@
</a-row> </a-row>
<a-row v-if="automatic"> <a-row v-if="automatic">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="能耗类型">
<a-select
v-model:value="editFormState.energyConsumptionType"
@change="changeEnergyType"
placeholder="请选择能耗类型">
<a-select-option
v-for="(item, index) in energyTypeOptions"
:key="index"
:value="item.dicKey">
{{ item.cnValue }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item ref="name" label="采集节点" name="collectionNode"> <a-form-item ref="name" label="采集节点" name="collectionNode">
<a-tree-select <a-tree-select
v-model:value="editFormState.collectionNode" v-model:value="editFormState.collectionNode"
@ -374,6 +389,7 @@
} from '/@/api/carbonEmissionFactorLibrary'; } from '/@/api/carbonEmissionFactorLibrary';
import { group } from '/@/api/deviceManage'; import { group } from '/@/api/deviceManage';
import { debug, log } from 'node:console'; import { debug, log } from 'node:console';
import { dict } from '/@/api';
defineOptions({ defineOptions({
energyType: 'fillInPage', // name energyType: 'fillInPage', // name
components: { components: {
@ -927,9 +943,13 @@
pageNum: 1, pageNum: 1,
pageSize: 5, pageSize: 5,
}); });
const edit = (record) => { const energyTypeOptions = ref([]);
getDictList(); const acquisitionDate = ref();
// queryData.value.emissionSources = record.emissionFactors; const edit = async (record) => {
acquisitionDate.value = record.acquisitionDate;
//
const options = await dict({ params: { dicKey: 'ENERGY_TYPE' } });
energyTypeOptions.value = options.data.data;
getNewTable(); getNewTable();
editFormState.value.id = record.id; editFormState.value.id = record.id;
editFormState.value.dataSources = record.dataSources; editFormState.value.dataSources = record.dataSources;
@ -971,23 +991,34 @@
}; };
// //
const collectingNodes = ref<TreeSelectProps['treeData']>([]); const collectingNodes = ref<TreeSelectProps['treeData']>([]);
const getDictList = () => { const getTypeConsume = ref();
const changeEnergyType = (value) => {
getTypeConsume.value = value;
// //
fetch(group.queryDeviceGroupTree, { energyType: 'ELECTRICITY_USAGE', orgId: orgId.value }).then( fetch(group.queryDeviceGroupTree, { energyType: value, orgId: orgId.value }).then((res) => {
(res) => { collectingNodes.value = res.data;
collectingNodes.value = res.data; collectingNodes.value = collectingNodes.value.map((item) => ({
collectingNodes.value = collectingNodes.value.map((item) => ({ value: item.id,
value: item.id, label: item.pointName,
label: item.pointName, children: item.children
children: item.children ? item.children.map((child) => ({
? item.children.map((child) => ({ value: child.id,
value: child.id, label: child.pointName,
label: child.pointName, }))
})) : [],
: [], }));
})); });
}, };
); const selectNode = (value) => {
const getConsumeData = ref({
acquisitionDate: acquisitionDate.value,
collectionNode: value,
orgId: orgId.value,
energyConsumptionType: getTypeConsume.value,
});
fetch(carbonInventoryCheck.nodeCancellationConsumption, getConsumeData.value).then((res) => {
editFormState.value.consumption = res.data;
});
}; };
// //
const fileList = ref<UploadProps['fileList']>([]); const fileList = ref<UploadProps['fileList']>([]);
@ -1006,9 +1037,9 @@
const handleChange = (info: UploadChangeParam) => { const handleChange = (info: UploadChangeParam) => {
// fileList.value = [...info.fileList]; // fileList.value = [...info.fileList];
const { fileList: newFileList } = info; const { fileList: newFileList } = info;
delIds.value.push(info.fileList[0].uid);
// fileList // fileList
if (newFileList.length > 1) { if (newFileList.length > 1) {
delIds.value.push(info.fileList[0].uid);
newFileList.shift(); // newFileList.shift(); //
} }

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

@ -109,7 +109,7 @@
.validate() .validate()
.then(() => { .then(() => {
console.log('values', formState, toRaw(formState)); console.log('values', formState, toRaw(formState));
formState.value.enterpriseOrgId = orgId.value; formState.value.orgId = orgId.value;
formState.value.startTime = formState.value.reportScope[0]; formState.value.startTime = formState.value.reportScope[0];
formState.value.endTime = formState.value.reportScope[1]; formState.value.endTime = formState.value.reportScope[1];
fetch(carbonInventoryCheck.createOrUpdate, formState.value).then((res) => { fetch(carbonInventoryCheck.createOrUpdate, formState.value).then((res) => {

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

@ -341,7 +341,9 @@
type: 'liquidFill', type: 'liquidFill',
radius: '78.1%', radius: '78.1%',
center: ['50%', '50%'], center: ['50%', '50%'],
color: ['#ecf3fe', '#c8dcfe', '#5594fa'], color: selectedTime.value
? ['#ecf3fe', '#c8dcfe', '#5594fa']
: ['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
amplitude: 5, amplitude: 5,
// //
@ -352,7 +354,7 @@
label: { label: {
show: true, show: true,
textStyle: { textStyle: {
color: '#5594fa', color: selectedTime.value ? 'rgba(68, 197, 253,1)' : 'rgba(12, 168, 126, 1)',
insideColor: '#12786f', insideColor: '#12786f',
fontSize: 40, fontSize: 40,
}, },
@ -361,12 +363,14 @@
return `${Number(params.value * 100).toFixed(2)}%`; return `${Number(params.value * 100).toFixed(2)}%`;
}, },
}, },
backgroundStyle: {
color: 'transparent', // 使
},
outline: { outline: {
show: true, show: true,
borderDistance: 5, borderDistance: 5,
itemStyle: { itemStyle: {
borderColor: 'rgba(68, 197, 253,1)', borderColor: selectedTime.value ? 'rgba(68, 197, 253,1)' : 'rgba(12, 168, 126, 1)',
borderWidth: 2, borderWidth: 2,
}, },
}, },

3
lib/component/table/table.vue

@ -46,7 +46,7 @@
<slot name="header" v-bind="data || {}"></slot> <slot name="header" v-bind="data || {}"></slot>
</template> </template>
</ns-table-header> </ns-table-header>
<ns-basic-table ref="tableElRef" v-bind="getTableBindValues" :dataSource="tableData" :row-selection="rowSelection"> <ns-basic-table ref="tableElRef" v-bind="getTableBindValues" :dataSource="tableData">
<template #emptyText> <template #emptyText>
<template v-if="tableState.loadError"> <template v-if="tableState.loadError">
<div class="ns-table-content"> <div class="ns-table-content">
@ -617,7 +617,6 @@ import { object } from 'vue-types';
//todo || //todo ||
function reload(clearDelay = true) { function reload(clearDelay = true) {
console.log("tiaogewu数个12345")
const pagination = unref(getPagination); const pagination = unref(getPagination);
fetch( fetch(
{ {

Loading…
Cancel
Save