add
This commit is contained in:
parent
9f475b8b70
commit
bf4bb399e8
|
@ -43,6 +43,9 @@
|
||||||
<el-form-item label="设备编码" prop="code">
|
<el-form-item label="设备编码" prop="code">
|
||||||
<el-input v-model="formData.code" clearable placeholder="请输入设备编码" />
|
<el-input v-model="formData.code" clearable placeholder="请输入设备编码" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="硬件ICCID" prop="iccid">
|
||||||
|
<el-input v-model="formData.iccid" clearable placeholder="请输入ICCID" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="设备图" prop="image">
|
<el-form-item label="设备图" prop="image">
|
||||||
<el-upload
|
<el-upload
|
||||||
class="avatar-uploader"
|
class="avatar-uploader"
|
||||||
|
@ -150,6 +153,7 @@ const formData = reactive({
|
||||||
id: '',
|
id: '',
|
||||||
product_id: '',
|
product_id: '',
|
||||||
code: '',
|
code: '',
|
||||||
|
iccid: '',
|
||||||
name: '',
|
name: '',
|
||||||
video_url: '',
|
video_url: '',
|
||||||
type: '',
|
type: '',
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
namespace app\api\controller;
|
namespace app\api\controller;
|
||||||
|
|
||||||
|
use app\adminapi\logic\farm\FarmLogic;
|
||||||
|
use app\adminapi\validate\farm\FarmValidate;
|
||||||
use app\common\model\farm\Farm;
|
use app\common\model\farm\Farm;
|
||||||
|
|
||||||
class FarmController extends BaseApiController
|
class FarmController extends BaseApiController
|
||||||
|
@ -14,4 +16,16 @@ class FarmController extends BaseApiController
|
||||||
$data = Farm::where($where)->order('create_time desc')->select()->toArray();
|
$data = Farm::where($where)->order('create_time desc')->select()->toArray();
|
||||||
return $this->success('请求成功',$data);
|
return $this->success('请求成功',$data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new FarmValidate())->post()->goCheck('add');
|
||||||
|
$result = FarmLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(FarmLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue