|
|
@@ -0,0 +1,67 @@
|
|
|
+import { addCar, addFace, addFrock, delCarById, delFaceById, delFrockById, getCarById, getCarPage, getFaceById, getFacePage, getFrockById, getFrockPage } from '@/api/cvs/feature'
|
|
|
+import { message } from 'ant-design-vue'
|
|
|
+
|
|
|
+export class FeatureController {
|
|
|
+ static async facePage (params: COMMON.API.QueryParams & {faceName?: string}) {
|
|
|
+ return getFacePage(params)
|
|
|
+ }
|
|
|
+
|
|
|
+ static async faceById (id: string) {
|
|
|
+ const { code, data } = await getFaceById(id)
|
|
|
+ if (code === 200) {
|
|
|
+ return data
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ static async addFace (data: CVS.Feature.Face) {
|
|
|
+ const { code, msg } = await addFace(data)
|
|
|
+ code === 200 ? message.success('新增成功') : message.error(msg)
|
|
|
+ }
|
|
|
+
|
|
|
+ static async delFaceById (id: string) {
|
|
|
+ const { code, msg } = await delFaceById(id)
|
|
|
+ code === 200 ? message.success('删除成功') : message.error(msg)
|
|
|
+ }
|
|
|
+
|
|
|
+ static async carPage (params: COMMON.API.QueryParams & {carNo?: string}) {
|
|
|
+ return getCarPage(params)
|
|
|
+ }
|
|
|
+
|
|
|
+ static async carById (id: string) {
|
|
|
+ const { code, data } = await getCarById(id)
|
|
|
+ if (code === 200) {
|
|
|
+ return data
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ static async addCar (data: CVS.Feature.Car) {
|
|
|
+ const { code, msg } = await addCar(data)
|
|
|
+ code === 200 ? message.success('新增成功') : message.error(msg)
|
|
|
+ }
|
|
|
+
|
|
|
+ static async delCarById (id: string) {
|
|
|
+ const { code, msg } = await delCarById(id)
|
|
|
+ code === 200 ? message.success('删除成功') : message.error(msg)
|
|
|
+ }
|
|
|
+
|
|
|
+ static async frockPage (params: COMMON.API.QueryParams & {frockName?: string}) {
|
|
|
+ return getFrockPage(params)
|
|
|
+ }
|
|
|
+
|
|
|
+ static async frockById (id: string) {
|
|
|
+ const { code, data } = await getFrockById(id)
|
|
|
+ if (code === 200) {
|
|
|
+ return data
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ static async addFrock (data: CVS.Feature.Frock) {
|
|
|
+ const { code, msg } = await addFrock(data)
|
|
|
+ code === 200 ? message.success('新增成功') : message.error(msg)
|
|
|
+ }
|
|
|
+
|
|
|
+ static async delFrockById (id: string) {
|
|
|
+ const { code, msg } = await delFrockById(id)
|
|
|
+ code === 200 ? message.success('删除成功') : message.error(msg)
|
|
|
+ }
|
|
|
+}
|