zmc
2023-12-18 6c74bf912e251347714099a84585f825b32a1c08
src/views/fytz/user/UserInfo.vue
@@ -6,7 +6,11 @@
        :level="4"
        v-model:value="formSearch._locations"
      ></FYOptionLocation>
      <FYOptionText label="关键字" placeholder="输入名称关键字" v-model:value="formSearch.searchText"></FYOptionText>
      <FYOptionText
        label="关键字"
        placeholder="输入名称关键字"
        v-model:value="formSearch.searchText"
      ></FYOptionText>
      <FYOptionScene
        :allOption="true"
        :type="1"
@@ -19,13 +23,7 @@
    </template>
    <template #table-column>
      <el-table-column
        type="index"
        fixed="left"
        prop="userInfo.realname"
        label="名称"
        width="400"
      >
      <el-table-column type="index" fixed="left" prop="userInfo.realname" label="名称" width="400">
        <template #default="scope">
          <el-tooltip
            effect="dark"
@@ -45,7 +43,7 @@
      <el-table-column prop="userInfo.extension1" label="区县" width="90" />
      <el-table-column prop="biTownName" label="街道" width="110" />
      <el-table-column prop="biArea" label="集中区" width="110" />
      <el-table-column prop="biManagementCompany" label="物业" min-width="110"/>
      <el-table-column prop="biManagementCompany" label="物业" min-width="110" />
      <el-table-column prop="userInfo.isenable" label="状态" width="90">
        <template #default="scope">
          {{ scope.row.userInfo.isenable ? '上线中' : '已下线' }}
@@ -54,11 +52,7 @@
      <el-table-column prop="userInfo.usertype" label="用户类型" width="90" />
      <el-table-column fixed="right" align="right" label="操作" width="160">
        <template #header>
          <el-button
            icon="DocumentAdd"
            size="default"
            type="success"
            @click="drawer = true"
          <el-button icon="DocumentAdd" size="default" type="success" @click="drawer = true"
            >新增用户</el-button
          >
        </template>
@@ -93,7 +87,7 @@
export default {
  components: {
    CompUserInfoAddDrawer,
    CompUserInfoAddDrawer
  },
  data() {
    return {
@@ -101,26 +95,26 @@
        _locations: {},
        searchText: '',
        scensetype: {},
        online: {},
        online: {}
      },
      drawer: false,
      drawer: false
    };
  },
  computed: {
    ...mapStores(useLoadingStore),
    ...mapStores(useLoadingStore)
  },
  methods: {
    onSearch(page, func) {
      const f = this.formSearch;
      const area = {};
      // 行政区划
      area.provinceCode = f._locations.pCode ? f._locations.pCode + '0000' : undefined
      area.provinceCode = f._locations.pCode;
      area.provinceName = f._locations.pName;
      if (area.provinceCode == null) {
        area.provinceCode = null;
        area.provinceName = null;
      }
      area.cityCode = f._locations.cCode ? f._locations.cCode.substring(0, 3) + '100' : undefined
      area.cityCode = f._locations.cCode;
      area.cityName = f._locations.cName;
      area.districtCode = f._locations.dCode;
      area.districtName = f._locations.dName;
@@ -140,7 +134,7 @@
        if (res) {
          func({
            data: res.data,
            total: res.head.totalCount,
            total: res.head.totalCount
          });
        }
      });
@@ -154,12 +148,12 @@
      const param = {
        guid: scope.row.userInfo.guid,
        isenable: !scope.row.userInfo.isenable
      }
      };
      const msg = scope.row.userInfo.isenable ? '下线' : '上线';
      useMessageBoxTip({
        confirmMsg: `确认${msg}该场景?`,
        confirmTitle: msg,
        onConfirm: () => {
        onConfirm: async () => {
          scope.row.loading2 = true;
          return userApi
            .updateUserInfo(param)
@@ -171,13 +165,13 @@
            .finally(() => {
              scope.row.loading2 = false;
            });
        },
        }
      });
    },
    tableRowClassName({ row }) {
      return row.userInfo.isenable ? 'online-row' : 'offline-row';
    },
  },
    }
  }
};
</script>
<style></style>