添加用户编辑

main
home.fengxinyhyl 6 months ago
parent 72a5633891
commit f64d4cd91f
  1. 50
      app/common/repositories/user/UserRepository.php
  2. 2
      public/system.html
  3. 2
      view/admin/src/views/user/list/index.vue

@ -133,31 +133,31 @@ class UserRepository extends BaseRepository
Elm::input('card_id', '身份证'), Elm::input('card_id', '身份证'),
Elm::input('addres', '用户地址'), Elm::input('addres', '用户地址'),
Elm::textarea('mark', '备注'), Elm::textarea('mark', '备注'),
Elm::select('group_id', '用户分组')->options(function () { // Elm::select('group_id', '用户分组')->options(function () {
$data = app()->make(UserGroupRepository::class)->allOptions(); // $data = app()->make(UserGroupRepository::class)->allOptions();
$options = [['value' => 0, 'label' => '请选择']]; // $options = [['value' => 0, 'label' => '请选择']];
foreach ($data as $value => $label) { // foreach ($data as $value => $label) {
$options[] = compact('value', 'label'); // $options[] = compact('value', 'label');
} // }
return $options; // return $options;
}), // }),
Elm::selectMultiple('label_id', '用户标签')->options(function () { // Elm::selectMultiple('label_id', '用户标签')->options(function () {
$data = app()->make(UserLabelRepository::class)->allOptions(); // $data = app()->make(UserLabelRepository::class)->allOptions();
$options = []; // $options = [];
foreach ($data as $value => $label) { // foreach ($data as $value => $label) {
$value = (string)$value; // $value = (string)$value;
$options[] = compact('value', 'label'); // $options[] = compact('value', 'label');
} // }
return $options; // return $options;
}), // }),
Elm::radio('status', '状态', 1)->options([ // Elm::radio('status', '状态', 1)->options([
['value' => 0, 'label' => '关闭'], // ['value' => 0, 'label' => '关闭'],
['value' => 1, 'label' => '开启'], // ['value' => 1, 'label' => '开启'],
])->requiredNum(), // ])->requiredNum(),
Elm::radio('is_promoter', '推广员', 1)->options([ // Elm::radio('is_promoter', '推广员', 1)->options([
['value' => 0, 'label' => '关闭'], // ['value' => 0, 'label' => '关闭'],
['value' => 1, 'label' => '开启'], // ['value' => 1, 'label' => '开启'],
])->requiredNum() // ])->requiredNum()
])->setTitle('编辑')->formData($user->toArray()); ])->setTitle('编辑')->formData($user->toArray());
} }

File diff suppressed because one or more lines are too long

@ -182,7 +182,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" min-width="130" fixed="right"> <el-table-column label="操作" min-width="130" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button v-if="!scope.row.cancel_time" type="text" size="small" class="mr10" @click="onEdit(scope.row.uid)">编辑</el-button>--> <el-button v-if="!scope.row.cancel_time" type="text" size="small" class="mr10" @click="onEdit(scope.row.uid)">编辑</el-button>
<el-button v-if="!scope.row.cancel_time" type="text" size="small" class="mr10" @click="onDetails(scope.row.uid)">用户详情</el-button> <el-button v-if="!scope.row.cancel_time" type="text" size="small" class="mr10" @click="onDetails(scope.row.uid)">用户详情</el-button>
<!-- <el-button v-if="!scope.row.cancel_time" type="text" size="small" class="mr10" @click="onEdit(scope.row.uid)">设为项目经理</el-button>--> <!-- <el-button v-if="!scope.row.cancel_time" type="text" size="small" class="mr10" @click="onEdit(scope.row.uid)">设为项目经理</el-button>-->

Loading…
Cancel
Save