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