123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- <template>
- <div id="relationshipTransfer">
- <van-sticky :offset-top="0">
- <van-nav-bar title="党支部" left-arrow @click-left="onClickLeft" />
- </van-sticky>
- <!-- <van-pull-refresh v-model="isLoading" @refresh="onRefresh"> -->
- <van-tree-select
- height="90vh"
- :items="partyList"
- :active-id.sync="activeId"
- :main-active-index.sync="activeIndex"
- />
- <!-- </van-pull-refresh> -->
- <!-- <div class="funcBtn">
- <van-button type="danger" @click="apply" round block>
- 申请转移
- </van-button>
- </div> -->
- </div>
- </template>
- <script>
- import {
- // PullRefresh as vanPullRefresh,
- NavBar as vanNavBar,
- // Button as vanButton,
- Sticky as vanSticky,
- TreeSelect as vanTreeSelect
- } from "vant";
- // import "vant/lib/pull-refresh/style";
- import "vant/lib/button/style";
- import "vant/lib/sticky/style";
- import "vant/lib/nav-bar/style";
- import "vant/lib/tree-select/style";
- import { list } from "@/api/party/party.js";
- import { toTree } from "@/utils/common.js";
- export default {
- name: "app",
- data: function() {
- return {
- isLoading: false,
- activeIndex: "",
- activeId: "",
- partyList: []
- };
- },
- methods: {
- onRefresh() {
- list().then(res => {
- let list = (res || []).map(v => {
- return {
- id: v.id,
- text: v.name,
- parentId: v.parentId,
- disabled: true
- };
- });
- this.partyList = toTree(list, {
- pidKey: "parentId",
- idKey: "id",
- disabled: true,
- rootId: "1"
- });
- this.isLoading = false;
- });
- },
- apply() {
- location.href = "./relationshipTransferFrom.html";
- },
- onClickLeft() {
- history.go(-1);
- }
- },
- mounted() {
- list().then(res => {
- let list = (res || []).map(v => {
- return {
- id: v.id,
- text: v.name,
- parentId: v.parentId
- };
- });
- this.partyList = toTree(list, {
- pidKey: "parentId",
- idKey: "id",
- disabled: true,
- rootId: "1"
- });
- console.log(this.partyList);
- });
- },
- beforeDestroy: function() {},
- components: { vanSticky, vanNavBar, vanTreeSelect }
- };
- </script>
- <style lang="scss">
- #relationshipTransfer {
- height: 100%;
- .funcBtn {
- position: fixed;
- width: 90%;
- left: 5%;
- bottom: 0.5em;
- }
- .van-tree-select {
- .van-sidebar {
- .van-sidebar-item--disabled {
- color: #323233;
- }
- }
- }
- .van-tree-select__item--disabled {
- color: #000;
- }
- }
- </style>
|