| | |
| | | <!-- 删除按钮 --> |
| | | <cl-multi-delete-btn /> |
| | | <cl-flex1 /> |
| | | <cl-filter label="上传时间"> |
| | | <cl-date-picker type="daterange" /> |
| | | </cl-filter> |
| | | <!-- 条件搜索 --> |
| | | <cl-search ref="Search" /> |
| | | </cl-row> |
| | |
| | | name: "push-weight", |
| | | }); |
| | | |
| | | import { ref } from "vue"; |
| | | import { useCrud, useTable, useUpsert, useSearch } from "@cool-vue/crud"; |
| | | import { useCool } from "/@/cool"; |
| | | import { useI18n } from "vue-i18n"; |
| | | |
| | | const { service } = useCool(); |
| | | const { t } = useI18n(); |
| | | |
| | | const garbageTypeOptions = ref<{ label: string; value: string }[]>([]); |
| | | |
| | | // cl-upsert |
| | | const Upsert = useUpsert({ |
| | |
| | | component: { name: "cl-date-text" }, |
| | | }, |
| | | { label: t("垃圾类型"), prop: "garbageType", minWidth: 120 }, |
| | | { label: t("垃圾分类"), prop: "garbageName", minWidth: 140 }, |
| | | { |
| | | label: t("垃圾重量"), |
| | | prop: "weight", |
| | |
| | | }); |
| | | |
| | | // cl-search |
| | | const Search = useSearch(); |
| | | const Search = useSearch({ |
| | | items: [ |
| | | { |
| | | prop: "deviceNo", |
| | | component: { |
| | | name: "el-input", |
| | | props: { |
| | | placeholder: t("搜索设备号"), |
| | | clearable: true, |
| | | }, |
| | | style: { width: "150px" }, |
| | | }, |
| | | }, |
| | | { |
| | | prop: "garbageType", |
| | | component: { |
| | | name: "el-select", |
| | | props: { |
| | | placeholder: t("垃圾类型"), |
| | | filterable: true, |
| | | clearable: true, |
| | | }, |
| | | options: garbageTypeOptions, |
| | | style: { width: "180px" }, |
| | | }, |
| | | }, |
| | | ], |
| | | }); |
| | | |
| | | // cl-crud |
| | | const Crud = useCrud( |
| | |
| | | service: service.push.weight, |
| | | }, |
| | | (app) => { |
| | | service.basicdata.wastetype.list({ status: 1 }).then((res) => { |
| | | garbageTypeOptions.value = (res || []) |
| | | .filter((item: any) => item.status === 1) |
| | | .map((item: any) => ({ |
| | | label: item.name, |
| | | value: item.code, |
| | | })); |
| | | }); |
| | | app.refresh(); |
| | | }, |
| | | ); |