yangfeng
2024-01-08 8b9777c61dad679ea40d06a25f0e4e90da5f53cf
src/views/unifiedManage/userLevel/index.vue
@@ -59,19 +59,29 @@
        </div>
      </div>
    </div>
    <div class="overSpread" v-show="isopen"></div>
    <!-- 添加/编辑 -->
    <AddUserLevel :isopen="isopen" @shutdown="shutdown" :editRow="editRow" />
    <AddUserLevel v-if="editConfig.visible" :edit-common-config="editConfig" />
  </div>
</template>
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import AddUserLevel from "@/views/unifiedManage/userLevel/components/AddUserLevel"
import { getListRole, getUserList, roleChange, deleteRole } from "@/api/unifiedManage/userLevel"
import { getListRole, getUserList, roleChange, deleteRole, getTotal } from "@/api/unifiedManage/userLevel"
export default {
  name: "UserLevel",
  props: {},
  props: {
    isDetail: {
      type: Boolean,
      default: false
    },
    addConfig: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },
  mixins: [pageMixin],
  components: { AddUserLevel },
  computed: {},
@@ -114,7 +124,6 @@
      ],
      showBottomCol: ["用户名", "姓名", "手机号", "岗位职务", "状态"],
      isopen: false,
      editRow: {},
      editConfig: {
        visible: false,
        title: "新建",
@@ -133,6 +142,24 @@
    this.getData()
  },
  methods: {
    // 数量统计
    overview() {
      getTotal({
        useType: 1
      }).then((reply) => {
        console.log(reply)
        if (reply.code == 200) {
          this.totalObject.value = reply.data.total
          this.otherOptions.map((item) => {
            if (item.label === "启用") {
              item.value = reply.data.use
            } else if (item.label === "停用") {
              item.value = reply.data.ban
            }
          })
        }
      })
    },
    // 角色列表
    async getData(val) {
      this.data.page = this.pagerOptions.currPage
@@ -148,7 +175,7 @@
        this.getUserList(row.id)
      }
      if (val !== "search") {
        // this.overview();
        this.overview()
      }
    },
    // 用户列表
@@ -177,17 +204,15 @@
    },
    // 新建
    addBtnClick() {
      // this.editConfig.title = "新建"
      // this.editConfig.visible = true
      // this.editConfig.infomation = {}
      this.isopen = true
      this.editRow = {}
      this.editConfig.title = "新建"
      this.editConfig.visible = true
      this.editConfig.infomation = {}
    },
    // 搜索
    searchClick(val) {
      this.data.keyword = val
      this.pagerOptions.currPage = 1
      // this.getData();
      this.getData("search")
    },
    // 停用
    changeStatusClick(row) {
@@ -221,11 +246,9 @@
    // 编辑
    handleClick(val) {
      console.log(val)
      // this.editConfig.title = "编辑"
      // this.editConfig.infomation = { ...val }
      // this.editConfig.visible = true
      this.editRow = val
      this.isopen = true
      this.editConfig.title = "编辑"
      this.editConfig.infomation = { ...val }
      this.editConfig.visible = true
    },
    // 删除等级
    delClick(row) {
@@ -248,17 +271,11 @@
        })
        .catch(() => {})
    },
    shutdown() {
      this.isopen = false
      setTimeout(() => {
        this.getData()
      }, 200)
    },
    // 行点击
    tableRowClick(row) {
      console.log(row)
      this.selectRow = row
      // this.getUserList(row.id);
      this.getUserList(row.id)
    },
    // 等级状态
    getRoleStatus(val) {