|
|
@@ -1,4 +1,4 @@
|
|
|
-<template>
|
|
|
+<template>
|
|
|
<div class="grid-content bg-purple tree_group" :style="{'height': treeHeight + 'px'}">
|
|
|
<a-card title="分工节点" style="height: 100%">
|
|
|
<!-- 左侧树 -->
|
|
|
@@ -9,39 +9,39 @@
|
|
|
@select="treeNodeClickHandler"
|
|
|
:fieldNames="{children: 'children', title: 'pnm', key: 'id'}"
|
|
|
:auto-expand-parent="true"
|
|
|
- :expandedKeys.sync="expandedKeys"
|
|
|
+ :expanded-keys="expandedKeys" @update:expandedKeys="expandedKeys = $event"
|
|
|
ref="jigou_tree">
|
|
|
- <template #custom="item">
|
|
|
- <span style="float:left; position: relative;" :title="item.pnm">
|
|
|
- <span v-if="item.id && item.id.length >= 12 && userInThisGroup(item)">
|
|
|
- <img src="../../../assets/images/choucha.png" v-if="item.chkType == '0'" style="width: 25px; height:20px; margin-top: 3px; float: left;"/>
|
|
|
- <img src="../../../assets/images/zicha.png" v-if="item.chkType=='1'" style="width: 25px; height:20px; margin-top: 3px; float: left;"/>
|
|
|
+ <template #title="{ dataRef }">
|
|
|
+ <span style="float:left; position: relative;" :title="dataRef.pnm">
|
|
|
+ <span v-if="dataRef.id && dataRef.id.length >= 12 && userInThisGroup(dataRef)">
|
|
|
+ <img src="../../../assets/images/choucha.png" v-if="dataRef.chkType == '0'" style="width: 25px; height:20px; margin-top: 3px; float: left;"/>
|
|
|
+ <img src="../../../assets/images/zicha.png" v-if="dataRef.chkType=='1'" style="width: 25px; height:20px; margin-top: 3px; float: left;"/>
|
|
|
|
|
|
</span>
|
|
|
- {{ item.pnm ? (item.pnm.length > 12 ? (item.pnm.substring(0, 10)) + "..." : item.pnm) : "" }}
|
|
|
+ {{ dataRef.pnm ? (dataRef.pnm.length > 12 ? (dataRef.pnm.substring(0, 10)) + "..." : dataRef.pnm) : "" }}
|
|
|
<a-button
|
|
|
- v-if="item.id && item.id.length > 6 && userInThisGroup(item)"
|
|
|
+ v-if="dataRef.id && dataRef.id.length > 6 && userInThisGroup(dataRef)"
|
|
|
type="danger"
|
|
|
icon="close-circle"
|
|
|
ghost
|
|
|
size="small"
|
|
|
shape="circle"
|
|
|
- @click="() => deletePICI(item)"
|
|
|
+ @click="() => deletePICI(dataRef)"
|
|
|
style="border: 0;"></a-button>
|
|
|
</span>
|
|
|
<div style="float:right; display: flex; justify-content: flex-end; align-items: center; width:50%;">
|
|
|
<span style="color:blue;width:60px;">
|
|
|
<a-button
|
|
|
- v-if="item.id && item.id.length < 10"
|
|
|
+ v-if="dataRef.id && dataRef.id.length < 10"
|
|
|
type="primary"
|
|
|
icon="plus-circle"
|
|
|
ghost
|
|
|
size="small"
|
|
|
- @click="() => addPICI(item, '批次')"
|
|
|
+ @click="() => addPICI(dataRef, '批次')"
|
|
|
style="border: 0;">新建</a-button>
|
|
|
</span>
|
|
|
<span style="width:30px;color: #009fff;">
|
|
|
- <a-icon type="edit" @click="modifyPICI(item,'批次')"/>
|
|
|
+ <EditOutlined @click="modifyPICI(dataRef,'批次')" style="color: #009fff;"/>
|
|
|
</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -74,7 +74,9 @@
|
|
|
import request from '@/utils/gw_ajax_request';
|
|
|
import { dateFormat } from '@/utils/gw_date';
|
|
|
import { getTrees } from '@/utils/gw_formatTree';
|
|
|
+import { EditOutlined } from '@ant-design/icons-vue';
|
|
|
export default {
|
|
|
+ components: { EditOutlined },
|
|
|
data() {
|
|
|
return {
|
|
|
treeHeight: window.innerHeight - 110,
|
|
|
@@ -149,10 +151,10 @@ export default {
|
|
|
const scopedSlots = {
|
|
|
title: 'custom',
|
|
|
};
|
|
|
- data.forEach((item) => {
|
|
|
- item.scopedSlots = scopedSlots;
|
|
|
- if (item.children && item.children.length > 0) {
|
|
|
- item.children.forEach((item1) => {
|
|
|
+ data.forEach((dataRef) => {
|
|
|
+ dataRef.scopedSlots = scopedSlots;
|
|
|
+ if (dataRef.children && dataRef.children.length > 0) {
|
|
|
+ dataRef.children.forEach((item1) => {
|
|
|
item1.scopedSlots = scopedSlots;
|
|
|
if (item1.children && item1.children.length > 0) {
|
|
|
item1.children.forEach((item2) => {
|
|
|
@@ -172,17 +174,17 @@ export default {
|
|
|
this.$emit('sendCurrentNodeinfo', this.currentSelectTreeNode);
|
|
|
});
|
|
|
},
|
|
|
- userInThisGroup(item) {
|
|
|
+ userInThisGroup(dataRef) {
|
|
|
// 判断当前用户 是否在该节点下 在 则没有删除权限
|
|
|
if (this.userInAllNode && this.userInAllNode.length > 0) {
|
|
|
for (var i = 0; i < this.userInAllNode.length; i++) {
|
|
|
console.log(
|
|
|
this.userInAllNode[i].id,
|
|
|
this.userInAllNode[i].id.substring(0, 3),
|
|
|
- item.id.length,
|
|
|
+ dataRef.id.length,
|
|
|
);
|
|
|
if (this.userInAllNode[i].id.substring(0, 3) == '001') {
|
|
|
- if (item.id.length >= this.userInAllNode[i].id.length) {
|
|
|
+ if (dataRef.id.length >= this.userInAllNode[i].id.length) {
|
|
|
return true;
|
|
|
} else {
|
|
|
return false;
|