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',
import = '/carbon-smart/api/carbon/emission/factor/import',
export = '/carbon-smart/api/carbon/emission/factor/export',
gasAndDatabase = '/carbon-smart/api/carbon/emission/factor/gasAndDatabase',
// 单位管理
dictionaryUnitManagement = '/carbon-smart/client/dict/dictionaryUnitManagement',
findOutermost = '/carbon-smart/client/dict/findOutermost',
@ -64,6 +65,7 @@ export enum carbonInventoryCheck {
getDetailsList = '/carbon-smart/api/carbon/inventory/details/getDetailsList',
updateTable = '/carbon-smart/api/carbon/inventory/details/update',
voucherDownloadList = '/carbon-smart/api/carbon/inventory/details/voucherDownloadList',
nodeCancellationConsumption = '/carbon-smart/api/carbon/inventory/details/nodeCancellationConsumption',
// 排放统计接口
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: '请输入排放源',
maxLength: 20,
},
rules: [
{
required: true,
message: '请输入排放源',
},
],
// rules: [
// {
// required: true,
// message: '请输入排放源',
// },
// ],
},
{
field: 'emissionType',
@ -32,15 +32,18 @@ export const formConfig = (disabled) => {
componentProps: {
placeholder: '请选择排放分类',
api: carbonEmissionFactorLibrary.getCarbonFactorTree,
defaultParams: {
orgId: sessionStorage.getItem('ORGID'),
},
fieldNames: { label: 'emissionName', value: 'id' },
showSearch: true,
},
rules: [
{
required: true,
message: '请选择排放分类',
},
],
// rules: [
// {
// required: true,
// message: '请选择排放分类',
// },
// ],
},
{
field: 'emissionGas',
@ -76,32 +79,13 @@ export const formConfig = (disabled) => {
},
],
},
rules: [
{
required: true,
message: '请选择排放气体',
},
],
// rules: [
// {
// required: true,
// 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: '排放环节',
field: 'emissionProcess',
@ -110,12 +94,12 @@ export const formConfig = (disabled) => {
placeholder: '请输入排放环节',
maxLength: 20,
},
rules: [
{
required: true,
message: '请输入排放环节',
},
],
// rules: [
// {
// required: true,
// message: '请输入排放环节',
// },
// ],
},
{
label: '排放因子',
@ -125,13 +109,13 @@ export const formConfig = (disabled) => {
placeholder: '请输入排放因子值',
maxLength: 20,
},
rules: [
{
required: true,
message: '请输入排放因子值',
trigger: 'change',
},
],
// rules: [
// {
// required: true,
// message: '请输入排放因子值',
// trigger: 'change',
// },
// ],
},
{
field: 'carbonEmissionPrefix',
@ -157,12 +141,12 @@ export const formConfig = (disabled) => {
},
],
},
rules: [
{
required: true,
message: '请选择碳排前缀',
},
],
// rules: [
// {
// required: true,
// message: '请选择碳排前缀',
// },
// ],
},
{
label: '碳排后缀',
@ -172,25 +156,25 @@ export const formConfig = (disabled) => {
placeholder: '请输入碳排后缀',
maxLength: 20,
},
rules: [
{
required: true,
message: '请输入碳排后缀',
},
],
// rules: [
// {
// required: true,
// message: '请输入碳排后缀',
// },
// ],
},
{
label: '已引用数',
field: 'numberOfReferences',
component: 'NsInput',
componentProps: {
defaultValue: 10,
defaultValue: '',
disabled: true,
maxLength: 20,
},
},
{
label: '参考文献',
label: '参考文献(选填)',
field: 'bibliography',
component: 'NsTextarea',
componentProps: {

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

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

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

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

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

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

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

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

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

@ -280,6 +280,21 @@
</a-row>
<a-row v-if="automatic">
<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-tree-select
v-model:value="editFormState.collectionNode"
@ -374,6 +389,7 @@
} from '/@/api/carbonEmissionFactorLibrary';
import { group } from '/@/api/deviceManage';
import { debug, log } from 'node:console';
import { dict } from '/@/api';
defineOptions({
energyType: 'fillInPage', // name
components: {
@ -927,9 +943,13 @@
pageNum: 1,
pageSize: 5,
});
const edit = (record) => {
getDictList();
// queryData.value.emissionSources = record.emissionFactors;
const energyTypeOptions = ref([]);
const acquisitionDate = ref();
const edit = async (record) => {
acquisitionDate.value = record.acquisitionDate;
//
const options = await dict({ params: { dicKey: 'ENERGY_TYPE' } });
energyTypeOptions.value = options.data.data;
getNewTable();
editFormState.value.id = record.id;
editFormState.value.dataSources = record.dataSources;
@ -971,23 +991,34 @@
};
//
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(
(res) => {
collectingNodes.value = res.data;
collectingNodes.value = collectingNodes.value.map((item) => ({
value: item.id,
label: item.pointName,
children: item.children
? item.children.map((child) => ({
value: child.id,
label: child.pointName,
}))
: [],
}));
},
);
fetch(group.queryDeviceGroupTree, { energyType: value, orgId: orgId.value }).then((res) => {
collectingNodes.value = res.data;
collectingNodes.value = collectingNodes.value.map((item) => ({
value: item.id,
label: item.pointName,
children: item.children
? item.children.map((child) => ({
value: child.id,
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']>([]);
@ -1006,9 +1037,9 @@
const handleChange = (info: UploadChangeParam) => {
// fileList.value = [...info.fileList];
const { fileList: newFileList } = info;
delIds.value.push(info.fileList[0].uid);
// fileList
if (newFileList.length > 1) {
delIds.value.push(info.fileList[0].uid);
newFileList.shift(); //
}

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

@ -109,7 +109,7 @@
.validate()
.then(() => {
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.endTime = formState.value.reportScope[1];
fetch(carbonInventoryCheck.createOrUpdate, formState.value).then((res) => {

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

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

3
lib/component/table/table.vue

@ -46,7 +46,7 @@
<slot name="header" v-bind="data || {}"></slot>
</template>
</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 v-if="tableState.loadError">
<div class="ns-table-content">
@ -617,7 +617,6 @@ import { object } from 'vue-types';
//todo ||
function reload(clearDelay = true) {
console.log("tiaogewu数个12345")
const pagination = unref(getPagination);
fetch(
{

Loading…
Cancel
Save