Browse Source

供暖办界面权限优化

develop
ljlong_2630 12 months ago
parent
commit
27a31d3f94
  1. 10
      src/api/system/user.js
  2. 87
      src/views/model/heatapiconf/heatMainOperatorLog.vue
  3. 4
      src/views/model/heatapiconf/heatSendLog.vue
  4. 15
      src/views/model/heatapiconf/heatSubOperatorLog.vue
  5. 61
      src/views/model/heatapiconf/index.vue

10
src/api/system/user.js

@ -133,3 +133,13 @@ export function deptTreeSelect() {
method: 'get'
})
}
// 查询部门下拉树结构
export function deptTreeSelectNew() {
return request({
url: '/system/user/deptTreeNew',
method: 'get'
})
}

87
src/views/model/heatapiconf/heatMainOperatorLog.vue

@ -63,13 +63,13 @@
@click="handleDelete"
>删除</el-button>
</el-col> -->
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="warning"
icon="Download"
@click="handleExport"
>导出</el-button>
</el-col>
</el-col> -->
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -81,9 +81,27 @@
<el-table-column label="机构名称" align="center" prop="orgName" />
<el-table-column label="推送接口" align="center" prop="sendIp" />
<el-table-column label="标准值" align="center" prop="standard" />
<el-table-column label="是否推送" align="center" prop="available" />
<el-table-column label="排除设备" align="center" prop="excludeDevices" show-overflow-tooltip="true"/>
<el-table-column label="是否计算总开关" align="center" prop="computeSwitchTotal" />
<el-table-column label="是否推送" align="center" prop="available" >
<template #default="scope">
<el-switch
v-model="scope.row.available"
disabled
/>
</template>
</el-table-column>
<el-table-column label="排除设备" align="center" prop="excludeDevices" show-overflow-tooltip="true">
<template #default="scope">
{{getDevicesNames(scope.row.excludeDevices)}}
</template>
</el-table-column>
<el-table-column label="是否计算总开关" align="center" prop="computeSwitchTotal" >
<template #default="scope">
<el-switch
v-model="scope.row.computeSwitchTotal"
disabled
/>
</template>
</el-table-column>
<el-table-column label="操作人" align="center" prop="operatorName" />
<el-table-column label="操作昵称" align="center" prop="operatorNickName" />
<el-table-column label="操作时间" align="center" prop="createTime"/>
@ -168,7 +186,7 @@
<script setup name="HeatMainOperatorLog">
import { listHeatapi, getHeatapi, delHeatapi, addHeatapi, updateHeatapi, listHeatapiNew } from "@/api/model/heatMainOperatorLog";
import { listDeviceNoPage } from "@/api/model/device";
const { proxy } = getCurrentInstance();
const heatapiList = ref([]);
@ -180,6 +198,7 @@ const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const listDeviceAll = ref([]);
const dc_operator_type = [{ label: "新增", value: "新增"},{ label: "修改", value: "修改"},{ label: "删除", value: "删除"}]
const data = reactive({
form: {},
@ -262,23 +281,6 @@ function handleSelectionChange(selection) {
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加供热办推送主配置操作日志";
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
const _id = row.id || ids.value
getHeatapi(_id).then(response => {
form.value = response.data;
open.value = true;
title.value = "修改供热办推送主配置操作日志";
});
}
/** 提交按钮 */
function submitForm() {
@ -301,23 +303,34 @@ function submitForm() {
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value;
proxy.$modal.confirm('是否确认删除供热办推送主配置操作日志编号为"' + _ids + '"的数据项?').then(function() {
return delHeatapi(_ids);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
function getDevicesNames(deviceIds){
if(!deviceIds) return '';
let deviceIdSet = new Set(deviceIds.split(','));
let deviceMap = new Map();
listDeviceAll.value.forEach(device => {
deviceMap.set(device.uuid, device.deviceName);
});
let deviceNames = [];
for (let deviceId of deviceIdSet) {
let name = deviceMap.get(deviceId);
if (name) {
deviceNames.push(name);
} else {
console.log("该设备没能匹配到对应设备名称:"+deviceId)
}
}
return deviceNames.join(',');
}
/** 导出按钮操作 */
function handleExport() {
proxy.download('model/heatapi/export', {
...queryParams.value
}, `heatapi_${new Date().getTime()}.xlsx`)
function getDevicesAll(){
listDeviceNoPage().then(response => {
listDeviceAll.value = response.data;
});
}
getDevicesAll();
getList();
</script>

4
src/views/model/heatapiconf/heatSendLog.vue

@ -55,13 +55,13 @@
@click="handleDelete"
>删除</el-button>
</el-col> -->
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="warning"
icon="Download"
@click="handleExport"
>导出</el-button>
</el-col>
</el-col> -->
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>

15
src/views/model/heatapiconf/heatSubOperatorLog.vue

@ -63,13 +63,13 @@
@click="handleDelete"
>删除</el-button>
</el-col> -->
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="warning"
icon="Download"
@click="handleExport"
>导出</el-button>
</el-col>
</el-col> -->
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -77,10 +77,17 @@
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="主键" align="center" prop="id" /> -->
<el-table-column label="操作类型" align="center" prop="operatorType" />
<el-table-column label="主配置编号" align="center" prop="standardConfId" />
<el-table-column label="热源" align="center" prop="orgName" />
<el-table-column label="参数模版编号" align="center" prop="paramClassId" />
<el-table-column label="参数模版名称" align="center" prop="paramClassName" />
<el-table-column label="参数推送开关" align="center" prop="computeSwitch" />
<el-table-column label="参数推送开关" align="center" prop="computeSwitch" >
<template #default="scope">
<el-switch
v-model="scope.row.computeSwitch"
disabled
/>
</template>
</el-table-column>
<el-table-column label="操作人" align="center" prop="operatorName" />
<el-table-column label="操作昵称" align="center" prop="operatorNickName" />
<el-table-column label="操作时间" align="center" prop="createTime"/>

61
src/views/model/heatapiconf/index.vue

@ -55,9 +55,9 @@
<el-col :span="1.5">
<el-button type="success" icon="Delete" @click="handleDelete">删除</el-button>
</el-col>
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button type="warning" icon="Download" @click="handleExport">导出</el-button>
</el-col>
</el-col> -->
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -166,7 +166,7 @@
<script setup name="Heatapiconf">
import { listHeatapiconf, getHeatapiconf, delHeatapiconf, addHeatapiconf, updateHeatapiconf } from "@/api/model/heatapiconf";
import { listDeviceNoPage } from "@/api/model/device";
import { deptTreeSelect } from "@/api/system/user";
import { deptTreeSelect,deptTreeSelectNew } from "@/api/system/user";
import lock from "@/assets/icons/svg/lock.svg";
import { ElMessageBox } from 'element-plus';
const { proxy } = getCurrentInstance();
@ -193,6 +193,7 @@ const param = ref({});
const disabled = ref(false);
const editable = ref(false);
const treeSelected = ref(null);
const hasAvalibleDept = ref([]);
const data = reactive({
form: {},
queryParams: {
@ -364,6 +365,12 @@ function handleDelete(row) {
}).catch(() => { });
}
function getDeptTreeSelectNew() {
deptTreeSelectNew().then(response => {
hasAvalibleDept.value = response.data;
});
};
function getDeptTree() {
deptTreeSelect().then(response => {
deptOptions.value = response.data;
@ -378,6 +385,22 @@ function selectDept(val) {
getListDevice(val.id);
}
/** 通过条件过滤节点 */
const filterNode = (value, data) => {
if (!value) return true;
if (!hasAvalibleDept.value) return true; // hasAvalibleDept true
return hasAvalibleDept.value.some(dept => dept.deptId === data.id); // 使 some hasAvalibleDept
};
/** 判断节点是否可点击 */
const isNodeDisabled = (node) => {
return !hasAvalibleDept.value.some(dept => dept.deptId === node.id);
};
/** 根据名称筛选部门树 */
watch(deptName, (val) => {
proxy.$refs["deptTreeRef"].filter(val);
});
/** 节点单击事件 */
function handleNodeClick(data) {
@ -387,17 +410,28 @@ function handleNodeClick(data) {
disabled.value = data.isLeaf
treeSelected.value = data.id;
handleQuery();
};
handleQuery();
}
/** 通过条件过滤节点 */
const filterNode = (value, data) => {
if (!value) return true;
return data.label.indexOf(value) !== -1;
};
/** 根据名称筛选部门树 */
watch(deptName, val => {
proxy.$refs["deptTreeRef"].filter(val);
});
// /** */
// function handleNodeClick(data) {
// queryParams.value.orgCode = data.id;
// form.value.orgCode = data.id;
// form.value.orgName = data.label;
// disabled.value = data.isLeaf
// treeSelected.value = data.id;
// handleQuery();
// };
// /** */
// const filterNode = (value, data) => {
// if (!value) return true;
// return data.label.indexOf(value) !== -1;
// };
// /** */
// watch(deptName, val => {
// proxy.$refs["deptTreeRef"].filter(val);
// });
/**固定操作列 */
function toggleFixedColumns() {
fixedColumns.value = !fixedColumns.value;
@ -548,5 +582,6 @@ function changeSwitch(row){
getDevicesAll();
getDeptTree();
getDeptTreeSelectNew();
getList();
</script>

Loading…
Cancel
Save