|
|
@ -50,7 +50,7 @@ |
|
|
|
<ns-icon name="actionMore" size="14" class="actionMore" /> |
|
|
|
<template #overlay> |
|
|
|
<a-menu> |
|
|
|
<a-menu-item @click="editTreeNodeData">编辑</a-menu-item> |
|
|
|
<a-menu-item @click="editTreeNodeData(data)">编辑</a-menu-item> |
|
|
|
<a-menu-item @click="addTreeNodeData">新增子节点</a-menu-item> |
|
|
|
<a-menu-item>上移</a-menu-item> |
|
|
|
<a-menu-item>下移</a-menu-item> |
|
|
@ -67,7 +67,13 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="right"> |
|
|
|
<ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" :scroll="{ x: 2000}"/> |
|
|
|
<ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" :scroll="{ x: 2000}"> |
|
|
|
<template #bodyCell="{ record, column }"> |
|
|
|
<template v-if="column.dataIndex === 'emissionGas'"> |
|
|
|
{{ record.emissionGas.label }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</ns-view-list-table> |
|
|
|
</div> |
|
|
|
<!-- 新增树节点 --> |
|
|
|
<ns-modal :visible="treeNodeAdd" :title="operationTree" @ok="handleOk" @cancel="handleCancel"> |
|
|
@ -406,10 +412,11 @@ |
|
|
|
editTreeNode.value.type = 'create' |
|
|
|
}; |
|
|
|
// 编辑树节点 |
|
|
|
const editTreeNodeData = () => { |
|
|
|
const editTreeNodeData = (data) => { |
|
|
|
operationTree.value='编辑' |
|
|
|
treeNodeAdd.value = true; |
|
|
|
editTreeNode.value.type = 'update' |
|
|
|
addTreeNode.value = data.emissionName |
|
|
|
} |
|
|
|
// 删除树节点 |
|
|
|
const deleteTreeNode = () => { |
|
|
@ -681,6 +688,9 @@ |
|
|
|
opMap.value.type = 'edit'; |
|
|
|
opMap.value.fuc = (formData: any) => { |
|
|
|
formData.emissionType = formData.emissionType[formData.emissionType.length - 1] |
|
|
|
if(formData.emissionGas.value){ |
|
|
|
formData.emissionGas = formData.emissionGas.value |
|
|
|
} |
|
|
|
return http.post(carbonEmissionFactorLibrary.creatOrUpdate, formData).then(() => { |
|
|
|
mainRef.value?.nsTableRef.reload(); |
|
|
|
visible.value = false; |
|
|
@ -738,27 +748,27 @@ |
|
|
|
options: [ |
|
|
|
{ |
|
|
|
label: 'CO2', |
|
|
|
value: '1', |
|
|
|
value: 1, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: 'CO2e', |
|
|
|
value: '2', |
|
|
|
value: 2, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: 'SF6', |
|
|
|
value:'3', |
|
|
|
value:3, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: 'CH4', |
|
|
|
value: '4', |
|
|
|
value: 4, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: 'PFCs', |
|
|
|
value: '5', |
|
|
|
value: 5, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: 'HFCs', |
|
|
|
value: '6', |
|
|
|
value: 6, |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|