修改优化

This commit is contained in:
fks-xuxinyue
2024-08-20 15:40:08 +08:00
parent 4a1f9259d7
commit 43fcd2b161
14 changed files with 867 additions and 605 deletions

View File

@@ -5,7 +5,7 @@
<div class="left">
<div class="top">
<a-form style="width: 100%; margin: 0 auto">
<div class="ns-form-title"><div class="title">排放分类</div></div>
<div class="ns-form-title"><div class="title">能源分组</div></div>
<div style="padding: 0 16px !important; width: 100%">
<a-row>
<a-col :span="24" style="margin-bottom: 16px">
@@ -23,7 +23,6 @@
class="draggable-tree"
style="padding: 0 16px !important"
draggable
show-line
checkable
block-node
:tree-data="gData"
@@ -80,9 +79,9 @@
</div>
</template>
</a-tree>
<div class="addTreeNode">
<!-- <div class="addTreeNode">
<a-button type="primary" style="width: 100%" @click="addTreeNodeData">新增</a-button>
</div>
</div> -->
</div>
</div>
<div class="right">
@@ -96,7 +95,7 @@
</div>
<!-- 新增树节点 -->
<ns-modal :visible="treeNodeAdd" :title="operationTree" @ok="handleOk" @cancel="handleCancel">
<ns-input v-model:value="addTreeNode" class="input" placeholder="请输入排放类型" />
<ns-input v-model:value="addTreeNode" :maxlength="10" class="input" placeholder="请输入排放类型" />
</ns-modal>
<!-- 新增数据库数据 -->
<a-drawer
@@ -106,6 +105,9 @@
:footer-style="{ textAlign: 'right' }"
destroyOnClose
@close="onClose">
<div class="ns-form-title-add" style="display: flex">
<div class="title">{{ text }}</div>
</div>
<ns-form
ref="formRef"
:schemas="formSchema"
@@ -129,8 +131,8 @@
@close="closeUnitManag">
<div class="ns-form-title titleUnit">
<div class="title">单位管理</div>
<a-button type="primary" @click="addGroup">新增分组</a-button>
<a-button type="primary" @click="addUnit">新增单位</a-button>
<a-button type="primary" @click="addGroup" ghost>新增分组</a-button>
<a-button type="primary" @click="addUnit" ghost>新增单位</a-button>
</div>
<!-- <div class="addButton">
</div> -->
@@ -147,7 +149,7 @@
ref="select"
:value="unitTreeParams.id"
allowClear
style="width: 96%"
style="width: 90%"
placeholder="选择分组"
@change="handleChange">
<a-select-option v-for="(item, index) in groupData" :key="index" :value="item.id">
@@ -185,11 +187,12 @@
</template>
</a-drawer>
<!-- 新增分组管理 -->
<ns-modal
:visible="addGroupManage"
:title="addGroupTitle"
@ok="unitOrGroupOk"
@cancel="groupCancel">
<ns-modal :visible="addGroupManage" @ok="unitOrGroupOk" @cancel="groupCancel">
<template #title>
<div style="display: flex; align-items: center">
<span class="titleStyleGroup">{{ addGroupTitle }}</span>
</div>
</template>
<a-form ref="unitFormRef" :model="formState" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-form-item label="分组名称" name="cnValue" :required="true">
<a-input v-model:value="formState.cnValue" placeholder="请输入分组名称" />
@@ -197,11 +200,12 @@
</a-form>
</ns-modal>
<!-- 新增单位 -->
<ns-modal
:visible="addUnitManage"
:title="addUnitTitle"
@ok="unitOrGroupOk"
@cancel="unitCancel">
<ns-modal :visible="addUnitManage" @ok="unitOrGroupOk" @cancel="unitCancel">
<template #title>
<div style="display: flex; align-items: center">
<span class="titleStyle">{{ addUnitTitle }}</span>
</div>
</template>
<a-form ref="unitFormRef" :model="formState" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-form-item label="单位名称" name="cnValue" :required="true">
<a-input v-model:value="formState.cnValue" placeholder="请输入单位名称" />
@@ -265,6 +269,7 @@
const disabled = ref(false);
const treeNodeAdd = ref<boolean>(false);
const operationTree = ref<string>('新增');
const text = ref('新增数据');
// const showOperation = ref(false);
const opMap: any = ref({
@@ -473,7 +478,11 @@
cancelText: '取消',
onOk() {
http
.post(carbonEmissionFactorLibrary.delTreeNode, { orgId: orgId.value, id: data.id })
.post(carbonEmissionFactorLibrary.delTreeNode, {
orgId: orgId.value,
id: data.id,
emissionName: data.emissionName,
})
.then(() => {
getOrgTree();
NsMessage.success('操作成功');
@@ -637,6 +646,7 @@
});
};
show.value = false;
text.value = '新增数据';
visible.value = true;
},
},
@@ -812,6 +822,7 @@
});
};
show.value = true;
text.value = '编辑数据';
visible.value = true;
},
},
@@ -1122,6 +1133,10 @@
padding-bottom: 10px;
border-bottom: 1px solid #e9e9e9;
}
.ns-form-title-add {
font-weight: bold;
user-select: text;
}
.titleUnit {
font-weight: bold;
user-select: text;
@@ -1176,6 +1191,7 @@
margin-left: 10%;
flex-direction: column;
border-radius: 12px;
overflow: auto;
}
.actionMore {
display: none;
@@ -1198,5 +1214,27 @@
text-align: right;
width: 27%;
}
.titleStyleGroup::before {
content: '';
position: absolute;
left: 16px;
top: 13%;
transform: translateY(-50%);
height: 16px;
width: 3px;
border-radius: 1px;
background-color: #2778ff;
}
.titleStyle::before {
content: '';
position: absolute;
left: 16px;
top: 10.5%;
transform: translateY(-50%);
height: 16px;
width: 3px;
border-radius: 1px;
background-color: #2778ff;
}
</style>