123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- <template>
- <div>
- <a-card :class="$style.tabclass">
- <a-tabs type="line" class="ant-card sd-has-table">
- <a-tab-pane key="1" tab="用户信息">
- <template v-if="groupId">
- <sd-data-table
- ref="userTable"
- :data-url="`api/framework/v1/user-manager/${groupId}/members`"
- :filter-expressions="expressions"
- :columns="columns"
- :row-key="'id'"
- :search-fields="['addrUser']"
- :process-res="processRes"
- @rowClick="handleUserClick"
- />
- </template>
- <sd-user-info
- ref="signatureDetail"
- :record-id="signatureId"
- page-id="base/signature/oaUserSignature"
- :user="curUserObj"
- @saved="saved"
- />
- </a-tab-pane>
- </a-tabs>
- </a-card>
- </div>
- </template>
- <script>
- import TableColumnTypes from '@/common/services/table-column-types'
- import SignaturemanageService from './signaturemanage-service'
- import components from './_import-components/sd-user-list-import'
- export default {
- name: 'SdUserList',
- components,
- props: {
- groupId: {
- type: String,
- default: '',
- },
- isContainSubOrg: {
- type: Boolean,
- default: false,
- },
- },
- data() {
- return {
- expressions: [
- {
- name: 'isContainsSub',
- stringValue: 'y',
- },
- ], // 默认搜索
- columns: [
- {
- title: '姓名',
- dataIndex: 'name',
- sdClickable: true,
- },
- {
- title: '更新时间',
- dataIndex: 'props.signDate',
- sdRender: TableColumnTypes.dateTime,
- },
- {
- title: '状态',
- dataIndex: 'status',
- },
- ],
- signatureId: null,
- curUserObj: {},
- attachmentNum: -1,
- }
- },
- computed: {},
- watch: {
- isContainSubOrg(val) {
- this.$set(
- this.expressions,
- 0,
- Object.assign(
- {},
- {
- name: 'isContainsSub',
- stringValue: val ? 'y' : 'n',
- }
- )
- )
- },
- },
- methods: {
- handleUserClick(record, dataIndex, value) {
- if (record) {
- const params = {
- columns: '',
- maxResults: 1, // 用户签名列表仅有一条数据
- startPosition: 0,
- expressions: [
- {
- dataType: 'str',
- name: 'userId',
- op: 'eq',
- stringValue: record.id,
- },
- ],
- formId: 'oaUserSignature',
- }
- SignaturemanageService.getUserSignatureList(params).then((res) => {
- if (res.data.data.length > 0) {
- this.signatureId = res.data.data[0].id
- } else {
- // 该用户无签名
- this.curUserObj = { ...record }
- this.signatureId = null
- }
- this.$nextTick(() => {
- this.$refs.signatureDetail.show()
- })
- })
- }
- },
- processRes(data) {
- const dataBase = data.data
- dataBase.forEach((e) => {
- e.props.signDate = parseInt(e.props.signDate)
- if (e.status === '0') {
- e.status = '未激活'
- } else if (e.status === '1') {
- e.status = '正常'
- } else if (e.status === '2') {
- e.status = '已注销'
- } else if (e.status === '4') {
- e.status = '账号已过期'
- } else if (e.status === '8') {
- e.status = '密码已过期'
- } else if (e.status === '16') {
- e.status = '已被锁定'
- } else if (e.status === '32') {
- e.status = '用户停用'
- } else if (e.status === '64') {
- e.status = '用户禁止登录'
- } else {
- e.status = '未标识的编号'
- }
- })
- return {
- datas: dataBase,
- total: data.totalSize,
- }
- },
- saved() {
- this.$refs.userTable.refresh()
- },
- },
- }
- </script>
- <style module lang="scss">
- @use '@/common/design' as *;
- .use-sign {
- position: relative;
- :global(.ant-form-item-label),
- :global(.ant-input) {
- visibility: hidden;
- }
- :global(.has-error) {
- position: relative;
- top: -96px;
- }
- }
- .tabclass {
- :global(.sd-has-table.ant-tabs) {
- .wrapper {
- margin-top: -64px;
- }
- }
- }
- </style>
|