lyh
2025-07-04 2637821cb7466330f5c612be809531cb65790219
src/views/system/UserList.vue
@@ -14,48 +14,25 @@
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="性别">
              <a-select v-model="queryParam.sex" placeholder="请选择性别">
                <a-select-option value="">请选择</a-select-option>
                <a-select-option value="1">男</a-select-option>
                <a-select-option value="2">女</a-select-option>
              </a-select>
            <a-form-item label="真实名字">
              <a-input placeholder="请输入真实名字" v-model="queryParam.realname"></a-input>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
            <a-col :md="6" :sm="8">
              <a-form-item label="真实名字">
                <a-input placeholder="请输入真实名字" v-model="queryParam.realname"></a-input>
              </a-form-item>
            </a-col>
            <a-col :md="6" :sm="8">
              <a-form-item label="手机号码">
                <a-input placeholder="请输入手机号码查询" v-model="queryParam.phone"></a-input>
              </a-form-item>
            </a-col>
            <a-col :md="6" :sm="8">
              <a-form-item label="用户状态">
                <a-select v-model="queryParam.status" placeholder="请选择">
                  <a-select-option value="">请选择</a-select-option>
                  <a-select-option value="1">正常</a-select-option>
                  <a-select-option value="2">冻结</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
          </template>
          <a-col :md="6" :sm="8">
            <a-form-item label="用户状态">
              <a-select v-model="queryParam.status" placeholder="请选择">
                <a-select-option value="">请选择</a-select-option>
                <a-select-option value="1">正常</a-select-option>
                <a-select-option value="2">冻结</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>
@@ -114,7 +91,7 @@
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange">
        <template slot="avatarslot" slot-scope="text, record, index">
        <template slot="avatarslot" slot-scope="text, record">
          <div class="anty-img-wrap">
            <a-avatar shape="square" :src="getAvatarView(record.avatar)" icon="user"/>
          </div>
@@ -189,6 +166,7 @@
  import UserRecycleBinModal from './modules/UserRecycleBinModal'
  import JSuperQuery from '@/components/jeecg/JSuperQuery'
  import JThirdAppButton from '@/components/jeecgbiz/thirdApp/JThirdAppButton'
  import {mapActions} from 'vuex'
  export default {
    name: "UserList",
@@ -208,16 +186,6 @@
        queryParam: {},
        recycleBinVisible: false,
        columns: [
          /*{
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },*/
          {
            title: '用户账号',
            align: "center",
@@ -234,41 +202,29 @@
          {
            title: '头像',
            align: "center",
            width: 120,
            width: 80,
            dataIndex: 'avatar',
            scopedSlots: {customRender: "avatarslot"}
          },
          {
            title: '性别',
            align: "center",
            width: 80,
            dataIndex: 'sex_dictText',
            sorter: true
          },
          {
            title: '生日',
            align: "center",
            width: 100,
            dataIndex: 'birthday'
          },
          {
            title: '手机号码',
            align: "center",
            width: 100,
            dataIndex: 'phone'
          },
          {
            title: '部门',
            align: "center",
            width: 180,
            width: 240,
            dataIndex: 'orgCodeTxt'
          },
          {
            title: '车间',
            align: "center",
            width: 180,
            dataIndex: 'productionName'
            width: 240,
            dataIndex: 'productionName',
            ellipsis: true,
          },
          {
            title: '维修部门',
            align: "center",
            width: 240,
            dataIndex: 'repairDepartName',
            ellipsis: true,
          },
          {
            title: '状态',
@@ -279,12 +235,14 @@
          {
            title: '操作',
            dataIndex: 'action',
            scopedSlots: {customRender: 'action'},
            scopedSlots: { customRender: 'action' },
            align: "center",
            width: 170
          }
            width: 80
          },
        ],
        isDepartType:'',
        superQueryFieldList: [
          { type: 'input', value: 'username', text: '用户账号', },
          { type: 'input', value: 'realname', text: '用户姓名', },
@@ -305,7 +263,125 @@
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      }
    },
    methods: {
      created() {
        this.queryTreeData()
      },
      methods: {
        ...mapActions(['QueryDepartTree']),
        queryTreeData() {
          this.QueryDepartTree().then(res => {
            if (res.success) {
              this.isDepartType = res.result[0].value
              if(this.isDepartType == -1){
                this.columns=[
                  {
                    title: '用户账号',
                    align: "center",
                    dataIndex: 'username',
                    width: 120,
                    sorter: true
                  },
                  {
                    title: '用户姓名',
                    align: "center",
                    width: 100,
                    dataIndex: 'realname',
                  },
                  {
                    title: '头像',
                    align: "center",
                    width: 80,
                    dataIndex: 'avatar',
                    scopedSlots: {customRender: "avatarslot"}
                  },
                  {
                    title: '车间',
                    align: "center",
                    width: 240,
                    dataIndex: 'productionName',
                    ellipsis: true,
                  },
                  {
                    title: '状态',
                    align: "center",
                    width: 80,
                    dataIndex: 'status_dictText'
                  },
                  {
                    title: '操作',
                    dataIndex: 'action',
                    scopedSlots: { customRender: 'action' },
                    align: "center",
                    width: 80
                  },
                ]
              }else{
                this.columns= [
                  {
                  title: '用户账号',
                  align: "center",
                  dataIndex: 'username',
                  width: 120,
                  sorter: true
                },
                  {
                    title: '用户姓名',
                    align: "center",
                    width: 100,
                    dataIndex: 'realname',
                  },
                  {
                    title: '头像',
                    align: "center",
                    width: 80,
                    dataIndex: 'avatar',
                    scopedSlots: {customRender: "avatarslot"}
                  },
                  {
                    title: '部门',
                    align: "center",
                    width: 240,
                    dataIndex: 'orgCodeTxt'
                  },
                  {
                    title: '车间',
                    align: "center",
                    width: 240,
                    dataIndex: 'productionName',
                    ellipsis: true,
                  },
                  {
                    title: '班组',
                    align: "center",
                    width: 240,
                    dataIndex: 'teamId_dictText'
                  },
                  {
                    title: '状态',
                    align: "center",
                    width: 80,
                    dataIndex: 'status_dictText'
                  },
                  {
                    title: '操作',
                    dataIndex: 'action',
                    scopedSlots: { customRender: 'action' },
                    align: "center",
                    width: 80
                  }
              ]
              }
            } else {
              this.$notification.warning({
                message:'消息',
                description:res.message
              });
            }
          }).finally(() =>{
          })
        },
      getAvatarView: function (avatar) {
        return getFileAccessHttpUrl(avatar)
      },
@@ -369,10 +445,16 @@
        }
        frozenBatch({ids: id, status: status}).then((res) => {
          if (res.success) {
            that.$message.success(res.message);
            that.$notification.success({
              message:'消息',
              description:res.message
            });
            that.loadData();
          } else {
            that.$message.warning(res.message);
            that.$notification.warning({
              message:'消息',
              description:res.message
            });
          }
        });
      },