update 项目管理

This commit is contained in:
2021-05-07 20:34:55 +08:00
parent be24cf2558
commit ab138ed22f
6 changed files with 67 additions and 48 deletions

View File

@@ -16,17 +16,8 @@
<a-input allow-clear placeholder="请输入姓名、账号、手机号" v-model="query.searchValue" />
</a-form-model-item>
<a-form-model-item label="状态">
<a-select
:style="{ width: '170px' }"
allow-clear
placeholder="请选择状态"
v-model="query.searchStatus"
>
<a-select-option
:key="i"
:value="item.code"
v-for="(item, i) in codes.find(p => p.code === 'common_status').values"
>{{ item.value }}</a-select-option>
<a-select :style="{ width: '170px' }" allow-clear placeholder="请选择状态" v-model="query.searchStatus">
<a-select-option :key="i" :value="item.code" v-for="(item, i) in codes.find((p) => p.code === 'common_status').values">{{ item.value }}</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item>
@@ -75,14 +66,7 @@
<a-list-item-meta>
<div slot="title">{{ record.nickName || record.name }}</div>
<div slot="description">{{ record.account }}</div>
<yo-image
:id="record.avatar"
:size="48"
icon="user"
shape="square"
slot="avatar"
type="avatar"
/>
<yo-image :id="record.avatar" :size="48" icon="user" shape="square" slot="avatar" type="avatar" />
</a-list-item-meta>
<div class="yo-list-content--h">
<div class="yo-list-content--h--item">
@@ -95,13 +79,7 @@
</div>
<Auth auth="sysUser:changeStatus">
<div class="yo-list-content--h--item">
<a-switch
:checked="!record.status"
:checked-children="bindCodeValue(0, 'common_status')"
:loading="record.statusChanging"
:un-checked-children="bindCodeValue(1, 'common_status')"
@change="checked => onSetUserStatus(record, checked)"
/>
<a-switch :checked="!record.status" :checked-children="bindCodeValue(0, 'common_status')" :loading="record.statusChanging" :un-checked-children="bindCodeValue(1, 'common_status')" @change="(checked) => onSetUserStatus(record, checked)" />
</div>
</Auth>
</div>
@@ -216,15 +194,10 @@ export default {
* 加载字典数据时的必要方法
*/
onLoadCodes() {
this.$api
.$queue([
this.$api.sysDictTypeDropDownAwait({ code: 'sex' }),
this.$api.sysDictTypeDropDownAwait({ code: 'common_status' }),
])
.then(([sex, commonStatus]) => {
this.codes.find((p) => p.code === 'sex').values = sex.data;
this.codes.find((p) => p.code === 'common_status').values = commonStatus.data;
});
this.$api.$queue([this.$api.sysDictTypeDropDownAwait({ code: 'sex' }), this.$api.sysDictTypeDropDownAwait({ code: 'common_status' })]).then(([sex, commonStatus]) => {
this.codes.find((p) => p.code === 'sex').values = sex.data;
this.codes.find((p) => p.code === 'common_status').values = commonStatus.data;
});
},
bindCodeValue(code, name) {
const c = this.codes.find((p) => p.code == name).values.find((p) => p.code == code);