kongdeqiang
2023-04-26 cb5c9968b763362d399e1c7fce1129ec7434aba8
src/views/sys/user-manage/userManage.vue
@@ -255,6 +255,7 @@
import excel from "@/libs/excel";
import addEdit from "./addEdit.vue";
import dict from "@/views/my-components/xboot/dict";
import {getSessionStore} from "../../../libs/storage";
export default {
  name: "user-manage",
  components: {
@@ -367,18 +368,18 @@
          minWidth: 125,
          sortable: true,
        },
        {
          title: "邮箱",
          key: "email",
          minWidth: 180,
          sortable: true,
        },
        {
          title: "性别",
          key: "sex",
          width: 70,
          align: "center",
        },
        // {
        //   title: "邮箱",
        //   key: "email",
        //   minWidth: 180,
        //   sortable: true,
        // },
        // {
        //   title: "性别",
        //   key: "sex",
        //   width: 70,
        //   align: "center",
        // },
        {
          title: "类型",
          key: "type",
@@ -427,60 +428,60 @@
            this.getDataList();
          },
        },
        {
          title: "状态",
          key: "status",
          align: "center",
          width: 100,
          render: (h, params) => {
            if (params.row.status == 0) {
              return h("div", [
                h("Badge", {
                  props: {
                    status: "success",
                    text: "启用",
                  },
                }),
              ]);
            } else if (params.row.status == -1) {
              return h("div", [
                h("Badge", {
                  props: {
                    status: "error",
                    text: "禁用",
                  },
                }),
              ]);
            }
          },
          filters: [
            {
              label: "启用",
              value: 0,
            },
            {
              label: "禁用",
              value: -1,
            },
          ],
          filterMultiple: false,
          filterRemote: (e) => {
            let v = "";
            if (e.length > 0) {
              v = e[0];
            }
            this.searchForm.status = v;
            this.searchForm.pageNumber = 1;
            this.getDataList();
          },
        },
        {
          title: "创建时间",
          key: "createTime",
          sortable: true,
          sortType: "desc",
          width: 180,
        },
        // {
        //   title: "状态",
        //   key: "status",
        //   align: "center",
        //   width: 100,
        //   render: (h, params) => {
        //     if (params.row.status == 0) {
        //       return h("div", [
        //         h("Badge", {
        //           props: {
        //             status: "success",
        //             text: "启用",
        //           },
        //         }),
        //       ]);
        //     } else if (params.row.status == -1) {
        //       return h("div", [
        //         h("Badge", {
        //           props: {
        //             status: "error",
        //             text: "禁用",
        //           },
        //         }),
        //       ]);
        //     }
        //   },
        //   filters: [
        //     {
        //       label: "启用",
        //       value: 0,
        //     },
        //     {
        //       label: "禁用",
        //       value: -1,
        //     },
        //   ],
        //   filterMultiple: false,
        //   filterRemote: (e) => {
        //     let v = "";
        //     if (e.length > 0) {
        //       v = e[0];
        //     }
        //     this.searchForm.status = v;
        //     this.searchForm.pageNumber = 1;
        //     this.getDataList();
        //   },
        // },
        // {
        //   title: "创建时间",
        //   key: "createTime",
        //   sortable: true,
        //   sortType: "desc",
        //   width: 180,
        // },
        {
          title: "操作",
          key: "action",
@@ -489,31 +490,31 @@
          fixed: "right",
          render: (h, params) => {
            let enableOrDisable = "";
            if (params.row.status == 0) {
              enableOrDisable = h(
                "a",
                {
                  on: {
                    click: () => {
                      this.disable(params.row);
                    },
                  },
                },
                "禁用"
              );
            } else {
              enableOrDisable = h(
                "a",
                {
                  on: {
                    click: () => {
                      this.enable(params.row);
                    },
                  },
                },
                "启用"
              );
            }
            // if (params.row.status == 0) {
            //   enableOrDisable = h(
            //     "a",
            //     {
            //       on: {
            //         click: () => {
            //           this.disable(params.row);
            //         },
            //       },
            //     },
            //     "禁用"
            //   );
            // } else {
            //   enableOrDisable = h(
            //     "a",
            //     {
            //       on: {
            //         click: () => {
            //           this.enable(params.row);
            //         },
            //       },
            //     },
            //     "启用"
            //   );
            // }
            return h("div", [
              h(
                "a",
@@ -939,4 +940,4 @@
    this.init();
  },
};
</script>
</script>