This commit is contained in:
yanran200730
2022-01-25 17:03:30 +08:00
parent 958c7107ce
commit db27bfd8f2
2 changed files with 60 additions and 12 deletions

View File

@@ -22,7 +22,7 @@
</template> </template>
<script> <script>
import RenderElement from '../designer/components/RenderElement' import RenderElement from '../designer/components/RenderElement'
// import AppGridDV from '../../../project/dv/apps/AppGridDV' // import AppGridDV from '../../../project/dv/apps/AppGridDV'
export default { export default {

View File

@@ -292,14 +292,15 @@
style: { style: {
display: v.girdLevel === '2' ? 'block' : 'none', display: v.girdLevel === '2' ? 'block' : 'none',
fontSize: v.girdLevel === '2' ? '12px' : '' fontSize: v.girdLevel === '2' ? '12px' : ''
},
attrs: {
title: v.girdLevel === '2' ? (v.checkType === '1' ? '网格员' : '网格长') : v.girdName
} }
}, v.girdLevel === '2' ? (v.checkType === '1' ? '网格员' : '网格长') : v.girdName)]) }, v.checkType ? (v.girdLevel === '2' ? '网格员' : '网格长') :'-')])
})), h('div', { })), h('div', {
display: node.data.girdLevel < '2' ? 'block' : 'none', style: {
style: 'color: rgba(255, 255, 255, 0.8); font-weight: 500; font-size: 12px; margin: 4px 0;' display: node.data.label === '子节点' ? 'none' : 'block',
color: 'rgba(255, 255, 255, 0.8)',
fontSize: '12px',
margin: '4px 0'
}
}, node.data.label)]) }, node.data.label)])
}, },
@@ -327,7 +328,36 @@
getGirdInfo (id, level) { getGirdInfo (id, level) {
this.instance.post(`/app/appgirdinfo/listAllGirdAndMemberByTop?id=${id || ''}`).then((res) => { this.instance.post(`/app/appgirdinfo/listAllGirdAndMemberByTop?id=${id || ''}`).then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.chartData = this.formatList(res.data) const chartData = this.formatList(res.data)
if (res.data && res.data[0] && res.data[0].parentGirdInfo) {
const parentGirdInfo = res.data[0].parentGirdInfo
const girdMemberList = parentGirdInfo.girdMemberManageList ? parentGirdInfo.girdMemberManageList.map(v => {
return {
...v,
label: v.name,
id: v.id,
checkType: '2',
girdName: parentGirdInfo.girdName,
girdLevel: parentGirdInfo.girdLevel,
isUser: true
}
}) : [{
label: '-',
id: parentGirdInfo.id,
girdLevel: parentGirdInfo.girdLevel,
girdName: parentGirdInfo.girdName
}]
this.chartData = [{
label: parentGirdInfo.girdName,
id: parentGirdInfo.id,
girdLevel: parentGirdInfo.girdLevel,
isUser: false,
children: chartData,
userList: girdMemberList
}]
} else {
this.chartData = chartData
}
this.$nextTick(() => { this.$nextTick(() => {
this.autoScale() this.autoScale()
@@ -364,6 +394,15 @@
} }
const node = this.$refs.VueOkrTree.getNode(id) const node = this.$refs.VueOkrTree.getNode(id)
this.$refs.VueOkrTree.append({
id: new Date().getTime(),
label: '子节点',
userList: userList || []
}, node)
this.$nextTick(() => {
this.autoScale()
})
if (userList.length) { if (userList.length) {
this.$refs.VueOkrTree.append({ this.$refs.VueOkrTree.append({
@@ -409,7 +448,7 @@
userList = [...girdMemberManageList, ...girdMemberList] userList = [...girdMemberManageList, ...girdMemberList]
if (!userList.length) { if (!userList.length) {
userList = [{ userList = [{
label: item.girdName, label: '-',
id: item.id, id: item.id,
girdLevel: item.girdLevel, girdLevel: item.girdLevel,
girdName: item.girdName girdName: item.girdName
@@ -556,6 +595,7 @@
.userlist { .userlist {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center;
padding: 10px; padding: 10px;
background: rgba(76, 166, 255, 0.1); background: rgba(76, 166, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.2);
@@ -578,7 +618,7 @@
p { p {
max-width: 120px; max-width: 120px;
margin: 4px 0; margin: 4px 0 0 0;
font-size: 19px; font-size: 19px;
text-align: center; text-align: center;
overflow: hidden; overflow: hidden;
@@ -605,8 +645,12 @@
&.user-item-2 { &.user-item-2 {
p { p {
line-height: 14px;
font-size: 12px; font-size: 12px;
margin-bottom: 0; margin-bottom: 4px;
}
span {
line-height: 14px;
} }
img { img {
width: 40px; width: 40px;
@@ -702,8 +746,8 @@
margin-left: 20px; margin-left: 20px;
& > div { & > div {
flex: 1;
width: 100%; width: 100%;
height: 440px;
padding-bottom: 20px; padding-bottom: 20px;
background: rgba(7, 11, 35, 0.4); background: rgba(7, 11, 35, 0.4);
border: 1px solid #2D50B5; border: 1px solid #2D50B5;
@@ -713,6 +757,10 @@
height: calc(100% - 82px); height: calc(100% - 82px);
padding: 0 20px; padding: 0 20px;
} }
&:last-child {
margin-top: 20px;
}
} }
} }