indextreetest.vue 3.93 KB
<template>
  <div class="system-container">
    <!-- 部门名称 弹出框 -->
    <add-dialog
      :isVisible="isOrginationVisible"
      :title="orginaTitle"
      :diaWidth="diaWidth"
    >
      <div slot="center">
        {{xuanz}}
        <h1>-----------------------------------------------</h1>
        <search-tree
          :parentIsAysc="isaysc"
          :parentProps="props"
          :parentNoAsycData="orginaSearchData"
          @searchClick="sC"
          @nodeLoad="nl"
          @nodeClick="nc"
        ></search-tree>
      </div>
    </add-dialog>
  </div>
</template>

<script>
import store from "@/store";
import AddDialog from "@/components/AddDialog";
import SearchTree from "@/components/SearchTree";
import elementForm from "@/components/elementForm";
import permissionButton from "@/components/PermissionButton";
import { getSystemUserOrginMenu } from "@/api/system";

export default {
  name: "userManage",
  components: {
    AddDialog,
    permissionButton,
    SearchTree,
    elementForm
  },
  data() {
    return {
      isaysc: true,
      props: {
        label: "label",
        children: "children"
      },
      orginaSearchData: [],

      xuanz: "",

      diaWidth: "100%",
      //选择组织 弹窗
      isOrginationVisible: false,
      orginaTitle: "选择组织",
      orginaInput: "",
      orginaClickVal: { //点击tree 选中的数字
        lable: "",
        oid: ""
      },
      orginaIsAysc: true,
    };
  },
  methods: {
    addNewTreeNode(data, resolve , ) {
      var arr = [];
      data.map((item, index) => {
        arr.push({
          label: item.label,
          oid: item.oid
        });
      });
      resolve(arr);
    },

    nl(node, resolve) {
      getSystemUserOrginMenu(node ? node.key : "")
        .then(response => {
          this.addNewTreeNode(response.data, resolve);
        })
        .catch(error => {});
    },
    nc(node) {
      // console.log(node,'点击当前组织 数据')
      this.xuanz = node.label;
    },
    sC() {
      getSystemUserOrginMenu(1)
        .then(response => {
          this.orginaSearchData = response.data;
        })
        .catch(error => {});
    },
  },
  mounted() {
    this.isOrginationVisible = true;
  }
};
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
@import "~@/styles/system.scss";
.system-container {
  padding: 0 0 0 10px;
  margin: 20px 24px;
  background-color: #ffffff;
  overflow: hidden;
  .user-tree {
    margin-top: 20px;
    padding: 20px;
    float: left;
    width: 18%;
    .user-tree-top {
      line-height: 40px;
      height: 40px;
    }
    .user-tree-expand {
      font-size: 25px;
    }
  }
  .user-container {
    padding: 20px 10px 0px 20px;
    float: left;
    width: 82%;
  }
  .border-shadow {
    border-width: 1px;
    border-style: solid;
    border-color: rgb(235, 235, 235);
    border-image: initial;
    border-radius: 3px;
    transition: all 0.2s ease 0s;
  }
  .border-shadow:hover {
    box-shadow: rgba(232, 237, 250, 0.6) 0px 0px 8px 0px,
      rgba(232, 237, 250, 0.5) 0px 2px 4px 0px;
  }
  .orgina-dialog-input {
    margin-bottom: 20px;
  }
  .statusText {
    vertical-align: middle;
  }
  .fl_right {
    float: right;
  }
}
</style>
<style lang="scss">
.system-container {
  .el-input__prefix {
    right: 5px;
    left: auto;
  }
  .el-input--prefix .el-input__inner {
    padding-left: 15px;
  }
  // 点击弹框input样式 start
  .department-class .el-input.is-disabled .el-input__inner {
    background-color: #fff;
    color: #606266;
    cursor: auto;
  }
  .el-form-item.is-error.department-class .el-input__inner {
    border-color: #f56c6c;
  }
  .el-form-item.is-success.department-class .el-input__inner {
    border-color: #67c23a;
  }
  .disabled-class {
    background-color: #f5f7fa;
    border-color: #e4e7ed;
    color: #c0c4cc;
    cursor: not-allowed;
  }
  .el-tree-node:focus > .el-tree-node__content {
    background-color: #409eff;
    color: #fff;
  }
  // 点击弹框input样式 end
}
</style>