Former-commit-id: f4723fc5d879805629c76ff7c1b1293a3d858885 Former-commit-id: 45000d5f382ad80477649ae0c0a42376b6989e1d1.0
parent
5876d6edf9
commit
affe096ed7
Binary file not shown.
Binary file not shown.
@ -1,39 +1,62 @@
|
|||||||
@model Platform.ViewModels.HomeModel
|
@model Platform.ViewModels.HomeModel
|
||||||
@{
|
@{
|
||||||
var organ = ViewBag.Organ as object;
|
HideBread = true;
|
||||||
|
var organTreeJson = new object[] { Convert(Model.Organ) }.ToJson();
|
||||||
}
|
}
|
||||||
|
<br />
|
||||||
<a-row>
|
<div class="row">
|
||||||
<a-col :span="3">
|
<div class="col-2">
|
||||||
<a-tree :tree-data="treeData" show-icon default-expand-all :default-selected-keys="['0-0-0']">
|
<div class="card" style="min-height:100%;">
|
||||||
<a-icon slot="switcherIcon" type="down" />
|
<div class="card-header">
|
||||||
<a-icon slot="smile" type="smile-o" />
|
机构及下属机构
|
||||||
<a-icon slot="meh" type="smile-o" />
|
</div>
|
||||||
<template slot="custom" slot-scope="{ selected }">
|
<div class="card-body">
|
||||||
<a-icon :type="selected ? 'frown' : 'frown-o'" />
|
<a-tree :tree-data="nodes" show-line="true" default-expand-all="true" :default-selected-keys="selected" v-on:select="onSelect">
|
||||||
</template>
|
|
||||||
</a-tree>
|
</a-tree>
|
||||||
</a-col>
|
</div>
|
||||||
<a-col :span="9">
|
</div>
|
||||||
col-12
|
</div>
|
||||||
</a-col>
|
<div class="col-10">
|
||||||
|
<div class="card" style="min-height:100%;">
|
||||||
|
<div class="card-header">
|
||||||
|
机构概况
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|
||||||
@section scripts{
|
@section scripts{
|
||||||
<script>
|
<script>
|
||||||
const treeData = @Html.Raw(organ.ToJson());
|
var nodes = @Html.Raw(organTreeJson);
|
||||||
var app = new Vue({
|
var app = new Vue({
|
||||||
el: '#app',
|
el: '#app',
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
treeData
|
nodes,
|
||||||
|
selected:['@Html.Raw(Model.OrganNumber)']
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
load: function () {
|
onSelect: function (selectedKeys, info) {
|
||||||
var vm = this;
|
window.location = '@Url.Action()?organNumber='+selectedKeys[0];
|
||||||
|
console.log('selected', selectedKeys, info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
}
|
}
|
||||||
|
@functions{
|
||||||
|
object Convert(Organ root)
|
||||||
|
{
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
title = root.Name,
|
||||||
|
key = root.Number,
|
||||||
|
children = root.Children.Select(o => Convert(o))
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue