[积分商城]用户管理-优化
This commit is contained in:
@@ -92,6 +92,9 @@ class User extends Backend
|
|||||||
$data = $this->applyInputFilter($data);
|
$data = $this->applyInputFilter($data);
|
||||||
$data = $this->excludeFields($data);
|
$data = $this->excludeFields($data);
|
||||||
|
|
||||||
|
//保存管理员admin_id
|
||||||
|
$data['admin_id'] = $this->auth->id;
|
||||||
|
|
||||||
$result = false;
|
$result = false;
|
||||||
$this->model->startTrans();
|
$this->model->startTrans();
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ export default {
|
|||||||
daily_claim: '每日限额',
|
daily_claim: '每日限额',
|
||||||
daily_claim_use: '每日限额(已使用)',
|
daily_claim_use: '每日限额(已使用)',
|
||||||
available_for_withdrawal: '可提现金额',
|
available_for_withdrawal: '可提现金额',
|
||||||
admin_id: '归属管理员',
|
admin_id: '归属管理员id',
|
||||||
admin__username: '用户名',
|
admin__username: '归属管理员',
|
||||||
create_time: '创建时间',
|
create_time: '创建时间',
|
||||||
update_time: '修改时间',
|
update_time: '修改时间',
|
||||||
'quick Search Fields': 'ID',
|
'quick Search Fields': 'ID',
|
||||||
|
|||||||
@@ -47,21 +47,61 @@ const baTable = new baTableClass(
|
|||||||
column: [
|
column: [
|
||||||
{ type: 'selection', align: 'center', operator: false },
|
{ type: 'selection', align: 'center', operator: false },
|
||||||
{ label: t('mall.user.id'), prop: 'id', align: 'center', width: 70, operator: 'RANGE', sortable: 'custom' },
|
{ label: t('mall.user.id'), prop: 'id', align: 'center', width: 70, operator: 'RANGE', sortable: 'custom' },
|
||||||
{ label: t('mall.user.username'), prop: 'username', align: 'center', operatorPlaceholder: t('Fuzzy query'), sortable: false, operator: 'LIKE' },
|
{
|
||||||
|
label: t('mall.user.username'),
|
||||||
|
prop: 'username',
|
||||||
|
align: 'center',
|
||||||
|
operatorPlaceholder: t('Fuzzy query'),
|
||||||
|
sortable: false,
|
||||||
|
operator: 'LIKE',
|
||||||
|
},
|
||||||
{ label: t('mall.user.phone'), prop: 'phone', align: 'center', operatorPlaceholder: t('Fuzzy query'), sortable: false, operator: 'LIKE' },
|
{ label: t('mall.user.phone'), prop: 'phone', align: 'center', operatorPlaceholder: t('Fuzzy query'), sortable: false, operator: 'LIKE' },
|
||||||
{ label: t('mall.user.score'), prop: 'score', align: 'center', sortable: false, operator: 'RANGE' },
|
{ label: t('mall.user.score'), prop: 'score', align: 'center', sortable: false, operator: 'RANGE' },
|
||||||
{ label: t('mall.user.daily_claim'), prop: 'daily_claim', align: 'center', sortable: false, operator: 'RANGE' },
|
{ label: t('mall.user.daily_claim'), prop: 'daily_claim', align: 'center', sortable: false, operator: 'RANGE' },
|
||||||
{ label: t('mall.user.daily_claim_use'), prop: 'daily_claim_use', align: 'center', sortable: false, operator: 'RANGE' },
|
{ label: t('mall.user.daily_claim_use'), prop: 'daily_claim_use', align: 'center', sortable: false, operator: 'RANGE' },
|
||||||
{ label: t('mall.user.available_for_withdrawal'), prop: 'available_for_withdrawal', align: 'center', sortable: false, operator: 'RANGE' },
|
{ label: t('mall.user.available_for_withdrawal'), prop: 'available_for_withdrawal', align: 'center', sortable: false, operator: 'RANGE' },
|
||||||
{ label: t('mall.user.admin__username'), prop: 'admin.username', align: 'center', operatorPlaceholder: t('Fuzzy query'), render: 'tags', operator: 'LIKE', comSearchRender: 'string' },
|
{
|
||||||
{ label: t('mall.user.create_time'), prop: 'create_time', align: 'center', render: 'datetime', operator: 'RANGE', comSearchRender: 'datetime', sortable: 'custom', width: 160, timeFormat: 'yyyy-mm-dd hh:MM:ss' },
|
label: t('mall.user.admin__username'),
|
||||||
{ label: t('mall.user.update_time'), prop: 'update_time', align: 'center', render: 'datetime', operator: 'RANGE', comSearchRender: 'datetime', sortable: 'custom', width: 160, timeFormat: 'yyyy-mm-dd hh:MM:ss' },
|
prop: 'admin.username',
|
||||||
|
align: 'center',
|
||||||
|
operatorPlaceholder: t('Fuzzy query'),
|
||||||
|
render: 'tags',
|
||||||
|
operator: 'LIKE',
|
||||||
|
comSearchRender: 'string',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('mall.user.create_time'),
|
||||||
|
prop: 'create_time',
|
||||||
|
align: 'center',
|
||||||
|
render: 'datetime',
|
||||||
|
operator: 'RANGE',
|
||||||
|
comSearchRender: 'datetime',
|
||||||
|
sortable: 'custom',
|
||||||
|
width: 160,
|
||||||
|
timeFormat: 'yyyy-mm-dd hh:MM:ss',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('mall.user.update_time'),
|
||||||
|
prop: 'update_time',
|
||||||
|
align: 'center',
|
||||||
|
render: 'datetime',
|
||||||
|
operator: 'RANGE',
|
||||||
|
comSearchRender: 'datetime',
|
||||||
|
sortable: 'custom',
|
||||||
|
width: 160,
|
||||||
|
timeFormat: 'yyyy-mm-dd hh:MM:ss',
|
||||||
|
},
|
||||||
{ label: t('Operate'), align: 'center', width: 100, render: 'buttons', buttons: optButtons, operator: false },
|
{ label: t('Operate'), align: 'center', width: 100, render: 'buttons', buttons: optButtons, operator: false },
|
||||||
],
|
],
|
||||||
dblClickNotEditColumn: [undefined],
|
dblClickNotEditColumn: [undefined],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
defaultItems: {},
|
defaultItems: {
|
||||||
|
score: 0,
|
||||||
|
daily_claim: 100,
|
||||||
|
daily_claim_use: 0,
|
||||||
|
available_for_withdrawal: 0,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<div
|
<div
|
||||||
class="ba-operate-form"
|
class="ba-operate-form"
|
||||||
:class="'ba-' + baTable.form.operate + '-form'"
|
:class="'ba-' + baTable.form.operate + '-form'"
|
||||||
:style="config.layout.shrink ? '':'width: calc(100% - ' + baTable.form.labelWidth! / 2 + 'px)'"
|
:style="config.layout.shrink ? '' : 'width: calc(100% - ' + baTable.form.labelWidth! / 2 + 'px)'"
|
||||||
>
|
>
|
||||||
<el-form
|
<el-form
|
||||||
v-if="!baTable.form.loading"
|
v-if="!baTable.form.loading"
|
||||||
@@ -29,14 +29,59 @@
|
|||||||
:label-width="baTable.form.labelWidth + 'px'"
|
:label-width="baTable.form.labelWidth + 'px'"
|
||||||
:rules="rules"
|
:rules="rules"
|
||||||
>
|
>
|
||||||
<FormItem :label="t('mall.user.username')" type="string" v-model="baTable.form.items!.username" prop="username" :placeholder="t('Please input field', { field: t('mall.user.username') })" />
|
<FormItem
|
||||||
<FormItem :label="t('mall.user.phone')" type="string" v-model="baTable.form.items!.phone" prop="phone" :placeholder="t('Please input field', { field: t('mall.user.phone') })" />
|
:label="t('mall.user.username')"
|
||||||
<FormItem :label="t('mall.user.password')" type="password" v-model="baTable.form.items!.password" prop="password" :placeholder="t('Please input field', { field: t('mall.user.password') })" />
|
type="string"
|
||||||
<FormItem :label="t('mall.user.score')" type="number" v-model="baTable.form.items!.score" prop="score" :input-attr="{ step: 1 }" :placeholder="t('Please input field', { field: t('mall.user.score') })" />
|
v-model="baTable.form.items!.username"
|
||||||
<FormItem :label="t('mall.user.daily_claim')" type="number" v-model="baTable.form.items!.daily_claim" prop="daily_claim" :input-attr="{ step: 1 }" :placeholder="t('Please input field', { field: t('mall.user.daily_claim') })" />
|
prop="username"
|
||||||
<FormItem :label="t('mall.user.daily_claim_use')" type="number" v-model="baTable.form.items!.daily_claim_use" prop="daily_claim_use" :input-attr="{ step: 1 }" :placeholder="t('Please input field', { field: t('mall.user.daily_claim_use') })" />
|
:placeholder="t('Please input field', { field: t('mall.user.username') })"
|
||||||
<FormItem :label="t('mall.user.available_for_withdrawal')" type="number" v-model="baTable.form.items!.available_for_withdrawal" prop="available_for_withdrawal" :input-attr="{ step: 1 }" :placeholder="t('Please input field', { field: t('mall.user.available_for_withdrawal') })" />
|
/>
|
||||||
<FormItem :label="t('mall.user.admin_id')" type="remoteSelect" v-model="baTable.form.items!.admin_id" prop="admin_id" :input-attr="{ pk: 'admin.id', field: 'username', remoteUrl: '/admin/auth.Admin/index' }" :placeholder="t('Please select field', { field: t('mall.user.admin_id') })" />
|
<FormItem
|
||||||
|
:label="t('mall.user.phone')"
|
||||||
|
type="string"
|
||||||
|
v-model="baTable.form.items!.phone"
|
||||||
|
prop="phone"
|
||||||
|
:placeholder="t('Please input field', { field: t('mall.user.phone') })"
|
||||||
|
/>
|
||||||
|
<FormItem
|
||||||
|
:label="t('mall.user.password')"
|
||||||
|
type="password"
|
||||||
|
v-model="baTable.form.items!.password"
|
||||||
|
prop="password"
|
||||||
|
:placeholder="t('Please input field', { field: t('mall.user.password') })"
|
||||||
|
/>
|
||||||
|
<FormItem
|
||||||
|
:label="t('mall.user.score')"
|
||||||
|
type="number"
|
||||||
|
v-model="baTable.form.items!.score"
|
||||||
|
prop="score"
|
||||||
|
:input-attr="{ step: 1 }"
|
||||||
|
:placeholder="t('Please input field', { field: t('mall.user.score') })"
|
||||||
|
/>
|
||||||
|
<FormItem
|
||||||
|
:label="t('mall.user.daily_claim')"
|
||||||
|
type="number"
|
||||||
|
v-model="baTable.form.items!.daily_claim"
|
||||||
|
prop="daily_claim"
|
||||||
|
:input-attr="{ step: 1 }"
|
||||||
|
:placeholder="t('Please input field', { field: t('mall.user.daily_claim') })"
|
||||||
|
/>
|
||||||
|
<FormItem
|
||||||
|
:label="t('mall.user.daily_claim_use')"
|
||||||
|
type="number"
|
||||||
|
v-model="baTable.form.items!.daily_claim_use"
|
||||||
|
prop="daily_claim_use"
|
||||||
|
:input-attr="{ step: 1 }"
|
||||||
|
:placeholder="t('Please input field', { field: t('mall.user.daily_claim_use') })"
|
||||||
|
/>
|
||||||
|
<FormItem
|
||||||
|
:label="t('mall.user.available_for_withdrawal')"
|
||||||
|
type="number"
|
||||||
|
v-model="baTable.form.items!.available_for_withdrawal"
|
||||||
|
prop="available_for_withdrawal"
|
||||||
|
:input-attr="{ step: 1 }"
|
||||||
|
:placeholder="t('Please input field', { field: t('mall.user.available_for_withdrawal') })"
|
||||||
|
/>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
|
|||||||
Reference in New Issue
Block a user