|
@ -144,12 +144,13 @@ |
|
|
display: flex; |
|
|
display: flex; |
|
|
justify-content: center; |
|
|
justify-content: center; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
|
|
|
margin-bottom: 16px; |
|
|
"> |
|
|
"> |
|
|
<a-select |
|
|
<a-select |
|
|
ref="select" |
|
|
ref="select" |
|
|
:value="unitTreeParams.id" |
|
|
:value="unitTreeParams.id" |
|
|
allowClear |
|
|
allowClear |
|
|
style="width: 90%" |
|
|
style="width: 100%" |
|
|
placeholder="选择分组" |
|
|
placeholder="选择分组" |
|
|
@change="handleChange"> |
|
|
@change="handleChange"> |
|
|
<a-select-option v-for="(item, index) in groupData" :key="index" :value="item.id"> |
|
|
<a-select-option v-for="(item, index) in groupData" :key="index" :value="item.id"> |
|
@ -171,13 +172,21 @@ |
|
|
<span>{{ data.cnValue }}</span> |
|
|
<span>{{ data.cnValue }}</span> |
|
|
</div> |
|
|
</div> |
|
|
<div class="actionMore"> |
|
|
<div class="actionMore"> |
|
|
<PlusCircleOutlined v-if="!data.parentId" @click="addUnit(data)" /> |
|
|
<PlusCircleOutlined |
|
|
<MinusCircleOutlined style="margin-left: 6px" @click="delUnit(data)" /> |
|
|
v-if="!data.parentId" |
|
|
|
|
|
style="color: #4388fb" |
|
|
|
|
|
@click="addUnit(data)" /> |
|
|
|
|
|
<MinusCircleOutlined |
|
|
|
|
|
style="margin-left: 6px; color: #4388fb" |
|
|
|
|
|
@click="delUnit(data)" /> |
|
|
<EditOutlined |
|
|
<EditOutlined |
|
|
style="margin-left: 6px" |
|
|
style="margin-left: 6px; color: #4388fb" |
|
|
v-if="!data.parentId" |
|
|
v-if="!data.parentId" |
|
|
@click="editGroup(data)" /> |
|
|
@click="editGroup(data)" /> |
|
|
<EditOutlined style="margin-left: 6px" v-else @click="editUnit(data)" /> |
|
|
<EditOutlined |
|
|
|
|
|
style="margin-left: 6px; color: #4388fb" |
|
|
|
|
|
v-else |
|
|
|
|
|
@click="editUnit(data)" /> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
@ -424,7 +433,7 @@ |
|
|
|
|
|
|
|
|
const onExpand = (keys: string[]) => { |
|
|
const onExpand = (keys: string[]) => { |
|
|
expandedKeys.value = keys; |
|
|
expandedKeys.value = keys; |
|
|
autoExpandParent.value = false; |
|
|
// autoExpandParent.value = false; |
|
|
}; |
|
|
}; |
|
|
// watch(selectTreeDataValue, (value) => { |
|
|
// watch(selectTreeDataValue, (value) => { |
|
|
// const expanded = dataList |
|
|
// const expanded = dataList |
|
@ -458,7 +467,7 @@ |
|
|
mainRef.value?.nsTableRef.reload(); |
|
|
mainRef.value?.nsTableRef.reload(); |
|
|
}; |
|
|
}; |
|
|
// 点击新增树节点 |
|
|
// 点击新增树节点 |
|
|
const addTreeNodeData = () => { |
|
|
const addTreeNodeData = (data) => { |
|
|
operationTree.value = '新增'; |
|
|
operationTree.value = '新增'; |
|
|
treeNodeAdd.value = true; |
|
|
treeNodeAdd.value = true; |
|
|
editTreeNode.value.type = 'create'; |
|
|
editTreeNode.value.type = 'create'; |
|
@ -557,6 +566,7 @@ |
|
|
const editTreeNode = ref({}); |
|
|
const editTreeNode = ref({}); |
|
|
const onSelectKeys = ref([]); |
|
|
const onSelectKeys = ref([]); |
|
|
const onSelect = (selectedKey: string[], info: any) => { |
|
|
const onSelect = (selectedKey: string[], info: any) => { |
|
|
|
|
|
expandedKeys.value = selectedKey; |
|
|
if (selectedKey.length === 1) { |
|
|
if (selectedKey.length === 1) { |
|
|
if (info.selectedNodes[0].emissionName === '全部') { |
|
|
if (info.selectedNodes[0].emissionName === '全部') { |
|
|
onSelectKeys.value = []; |
|
|
onSelectKeys.value = []; |
|
@ -771,6 +781,7 @@ |
|
|
{ |
|
|
{ |
|
|
title: 'id', |
|
|
title: 'id', |
|
|
width: 50, |
|
|
width: 50, |
|
|
|
|
|
align: 'center', |
|
|
customRender: (text: any) => { |
|
|
customRender: (text: any) => { |
|
|
return text.index + 1; |
|
|
return text.index + 1; |
|
|
}, |
|
|
}, |
|
@ -778,57 +789,68 @@ |
|
|
{ |
|
|
{ |
|
|
title: '排放源', |
|
|
title: '排放源', |
|
|
width: 100, |
|
|
width: 100, |
|
|
|
|
|
align: 'center', |
|
|
dataIndex: 'emissionSources', |
|
|
dataIndex: 'emissionSources', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '排放类型', |
|
|
title: '排放类型', |
|
|
width: 100, |
|
|
width: 100, |
|
|
|
|
|
align: 'center', |
|
|
dataIndex: 'emissionTypeColumn', |
|
|
dataIndex: 'emissionTypeColumn', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '排放气体', |
|
|
title: '排放气体', |
|
|
width: 100, |
|
|
width: 100, |
|
|
|
|
|
align: 'center', |
|
|
dataIndex: 'emissionGas', |
|
|
dataIndex: 'emissionGas', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '排放环节', |
|
|
title: '排放环节', |
|
|
width: 100, |
|
|
width: 100, |
|
|
|
|
|
align: 'center', |
|
|
dataIndex: 'emissionProcess', |
|
|
dataIndex: 'emissionProcess', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '排放因子', |
|
|
title: '排放因子', |
|
|
width: 100, |
|
|
width: 100, |
|
|
|
|
|
align: 'center', |
|
|
dataIndex: 'emissionFactors', |
|
|
dataIndex: 'emissionFactors', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '排放因子单位', |
|
|
title: '排放因子单位', |
|
|
width: 100, |
|
|
width: 100, |
|
|
|
|
|
align: 'center', |
|
|
dataIndex: 'emissionFactorUnits', |
|
|
dataIndex: 'emissionFactorUnits', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '数据来源', |
|
|
title: '数据来源', |
|
|
width: 100, |
|
|
width: 100, |
|
|
|
|
|
align: 'center', |
|
|
dataIndex: 'dataSources', |
|
|
dataIndex: 'dataSources', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '数据库', |
|
|
title: '数据库', |
|
|
width: 100, |
|
|
width: 100, |
|
|
|
|
|
align: 'center', |
|
|
dataIndex: 'carbonDatabase', |
|
|
dataIndex: 'carbonDatabase', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '参考文献', |
|
|
title: '参考文献', |
|
|
width: 100, |
|
|
width: 100, |
|
|
|
|
|
align: 'center', |
|
|
dataIndex: 'bibliography', |
|
|
dataIndex: 'bibliography', |
|
|
ellipsis: true, |
|
|
ellipsis: true, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '引用数量', |
|
|
title: '引用数量', |
|
|
width: 100, |
|
|
width: 100, |
|
|
|
|
|
align: 'center', |
|
|
dataIndex: 'numberOfReferences', |
|
|
dataIndex: 'numberOfReferences', |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
columnActions: { |
|
|
columnActions: { |
|
|
title: '操作', |
|
|
title: '操作', |
|
|
|
|
|
align: 'center', |
|
|
actions: [ |
|
|
actions: [ |
|
|
{ |
|
|
{ |
|
|
label: '编辑', |
|
|
label: '编辑', |
|
@ -875,10 +897,42 @@ |
|
|
{ |
|
|
{ |
|
|
label: '删除', |
|
|
label: '删除', |
|
|
name: 'userDelete', |
|
|
name: 'userDelete', |
|
|
dynamicParams: { ids: 'id[]' }, |
|
|
// dynamicParams: { ids: 'id[]' }, |
|
|
confirm: true, |
|
|
// confirm: true, |
|
|
isReload: true, |
|
|
// isReload: true, |
|
|
api: carbonEmissionFactorLibrary.del, |
|
|
// api: carbonEmissionFactorLibrary.del, |
|
|
|
|
|
handle: (record: any) => { |
|
|
|
|
|
fetch(carbonEmissionFactorLibrary.checkDel, { ids: [record.id] }).then((res) => { |
|
|
|
|
|
if (res.data === '确定要删除吗?') { |
|
|
|
|
|
Modal.confirm({ |
|
|
|
|
|
title: res.data, |
|
|
|
|
|
icon: createVNode(ExclamationCircleOutlined), |
|
|
|
|
|
onOk() { |
|
|
|
|
|
fetch(carbonEmissionFactorLibrary.del, { ids: [record.id] }).then((res) => { |
|
|
|
|
|
mainRef.value?.nsTableRef.reload(); |
|
|
|
|
|
NsMessage.success('操作成功'); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
onCancel() { |
|
|
|
|
|
console.log('Cancel'); |
|
|
|
|
|
}, |
|
|
|
|
|
class: 'test', |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
Modal.confirm({ |
|
|
|
|
|
title: res.data, |
|
|
|
|
|
icon: createVNode(ExclamationCircleOutlined), |
|
|
|
|
|
onOk() { |
|
|
|
|
|
console.log('OK'); |
|
|
|
|
|
}, |
|
|
|
|
|
onCancel() { |
|
|
|
|
|
console.log('Cancel'); |
|
|
|
|
|
}, |
|
|
|
|
|
class: 'test', |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
}, |
|
|
}, |
|
@ -1147,7 +1201,7 @@ |
|
|
display: flex; |
|
|
display: flex; |
|
|
} |
|
|
} |
|
|
.left { |
|
|
.left { |
|
|
width: 300px; |
|
|
width: 255px; |
|
|
// max-height: calc(100vh - 96px); |
|
|
// max-height: calc(100vh - 96px); |
|
|
margin-right: @ns-gap; |
|
|
margin-right: @ns-gap; |
|
|
min-width: fit-content; |
|
|
min-width: fit-content; |
|
@ -1198,7 +1252,8 @@ |
|
|
margin-bottom: unset; |
|
|
margin-bottom: unset; |
|
|
padding-bottom: unset; |
|
|
padding-bottom: unset; |
|
|
border-bottom: unset; |
|
|
border-bottom: unset; |
|
|
width: 70%; |
|
|
margin-bottom: 16px; |
|
|
|
|
|
width: 255px; |
|
|
height: 5vh; |
|
|
height: 5vh; |
|
|
display: flex; |
|
|
display: flex; |
|
|
align-items: center; |
|
|
align-items: center; |
|
@ -1238,18 +1293,19 @@ |
|
|
justify-content: space-evenly; |
|
|
justify-content: space-evenly; |
|
|
} |
|
|
} |
|
|
.treePart { |
|
|
.treePart { |
|
|
width: 70%; |
|
|
width: 255px; |
|
|
height: calc(100% - 5vh); |
|
|
height: 700px; |
|
|
display: flex; |
|
|
display: flex; |
|
|
border: 1px solid #bfbfbf; |
|
|
border: 1px solid #bfbfbf; |
|
|
margin-left: 10%; |
|
|
margin-left: 10%; |
|
|
flex-direction: column; |
|
|
flex-direction: column; |
|
|
border-radius: 12px; |
|
|
border-radius: 12px; |
|
|
overflow: auto; |
|
|
overflow: auto; |
|
|
|
|
|
padding: 16px; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
:deep(.ant-tree) { |
|
|
:deep(.ant-tree) { |
|
|
height: 90%; |
|
|
height: 90%; |
|
|
width: 90%; |
|
|
width: 100%; |
|
|
overflow: auto; |
|
|
overflow: auto; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|