|
|
@@ -1,117 +1,12 @@
|
|
|
<template>
|
|
|
- <scTable ref="xGridTable" :apiObj="$API.carwash.record" :formConfig="formConfig" :paramsColums="paramsColums" :toolbarConfig="toolbarConfig" :columns="columns">
|
|
|
- <template #default_imgUrl="{ row, column }">
|
|
|
- <vxe-image v-if="XEUtils.get(row, `folders.${column.field}.entities[0].path`)" :src="'/api/folder/' + XEUtils.get(row, `folders.${column.field}.entities[0].path`)" width="40" height="40"></vxe-image>
|
|
|
- </template>
|
|
|
-
|
|
|
- <template #action="{ row }">
|
|
|
- <el-button type="primary" link @click="table_edit(row)">
|
|
|
- <template #icon><sc-iconify icon="ant-design:edit-outlined"></sc-iconify></template>修改
|
|
|
- </el-button>
|
|
|
- <el-button type="primary" link @click="table_del(row)">
|
|
|
- <template #icon><sc-iconify icon="ant-design:delete-outlined"></sc-iconify></template>删除
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </scTable>
|
|
|
+ <data-table ref="tableRef" isTemp></data-table>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import moment from "moment";
|
|
|
-import XEUtils from "xe-utils";
|
|
|
-import API from "@/api";
|
|
|
-import TOOL from "@/utils/tool";
|
|
|
-import { mapFormItemInput, mapFormItemSelect, mapFormItemDatePicker } from "@/components/scTable/helper";
|
|
|
-import { carWashDic } from "@/views/dataMock/carwash/main";
|
|
|
+import dataTable from "../record";
|
|
|
|
|
|
-const proConfig = reactive({
|
|
|
- storageKey: "PROJECT",
|
|
|
- resetValue: TOOL.data.get("PROJECT_ID"),
|
|
|
- optionProps: { label: "projectName", value: "fpiId" },
|
|
|
- events: {
|
|
|
- change: data => XEUtils.assign(formConfig.data, data)
|
|
|
- }
|
|
|
+const tableRef = ref();
|
|
|
+defineExpose({
|
|
|
+ table_add: () => tableRef.value.table_add()
|
|
|
})
|
|
|
-
|
|
|
-const selectConfig = reactive({
|
|
|
- options: carWashDic.carType.map((label, value) => ({ label, value })),
|
|
|
- events: {
|
|
|
- change: data => XEUtils.merge(formConfig.data, data)
|
|
|
- }
|
|
|
-})
|
|
|
-
|
|
|
-const datetimerangeConfig = reactive({
|
|
|
- span: 7,
|
|
|
- resetValue: () => [moment().startOf("month").format("YYYY-MM-DD HH:mm:ss"), moment().format("YYYY-MM-DD HH:mm:ss")],
|
|
|
- props: {
|
|
|
- popperClass: "datetime-picker-popper",
|
|
|
- type: "datetimerange",
|
|
|
- startPlaceholder: "开始时间",
|
|
|
- endPlaceholder: "结束时间",
|
|
|
- format: "YYYY-MM-DD HH:mm"
|
|
|
- }
|
|
|
-})
|
|
|
-
|
|
|
-const toolbarConfig = reactive({
|
|
|
- enabled: true,
|
|
|
- print: false
|
|
|
-})
|
|
|
-
|
|
|
-const formConfig = reactive({
|
|
|
- data: {
|
|
|
- projectId: TOOL.data.get("PROJECT_ID"),
|
|
|
- createTime: [moment().startOf("month").format("YYYY-MM-DD HH:mm:ss"), moment().format("YYYY-MM-DD HH:mm:ss")]
|
|
|
- },
|
|
|
- items: [
|
|
|
- mapFormItemSelect("projectId", "所属项目", proConfig),
|
|
|
- mapFormItemInput("licensePlate", "车牌号"),
|
|
|
- mapFormItemSelect("carType", "车辆类型", selectConfig),
|
|
|
- mapFormItemSelect("alarmType", "识别结果", { ...selectConfig, options: carWashDic.alarmType.map((label, value) => ({ label, value })) }),
|
|
|
- mapFormItemDatePicker("createTime", "抓拍时间", datetimerangeConfig)
|
|
|
- ]
|
|
|
-})
|
|
|
-
|
|
|
-const paramsColums = reactive([
|
|
|
- { column: "fpiId", field: "projectId" },
|
|
|
- { column: "licensePlate" },
|
|
|
- { column: "carType" },
|
|
|
- { column: "alarmType" },
|
|
|
- { column: "beginCaptureTime", field: "createTime[0]" },
|
|
|
- { column: "endCaptureTime", field: "createTime[1]" }
|
|
|
-])
|
|
|
-
|
|
|
-const columns = reactive([
|
|
|
- { type: "seq", width: 60 },
|
|
|
- { type: "html", field: "captureTime", title: "抓拍时间", minWidth: 160, sortable: true },
|
|
|
- { type: "html", field: "enterTime", title: "车辆入场时间", minWidth: 160, sortable: true },
|
|
|
- { type: "html", field: "leaveTime", title: "车辆出场时间", minWidth: 160, sortable: true },
|
|
|
- { type: "html", field: "licensePlate", title: "车牌号", minWidth: 120, sortable: true },
|
|
|
- { type: "html", field: "licensePlateColor", title: "车牌颜色", minWidth: 120, sortable: true, formatter: ({ cellValue }) => XEUtils.get(carWashDic.plateColor, cellValue, cellValue) },
|
|
|
- { type: "html", field: "carType", title: "车辆类型", minWidth: 120, sortable: true, formatter: ({ cellValue }) => XEUtils.get(carWashDic.carType, cellValue, cellValue) },
|
|
|
- { type: "html", field: "alarmType", title: "识别结果", minWidth: 100, sortable: true, formatter: ({ cellValue }) => XEUtils.get(carWashDic.alarmType, cellValue, cellValue) },
|
|
|
- { field: "carrinse/attach", title: "车身清洗图片", minWidth: 110, align: "center", slots: { default: "default_imgUrl" } },
|
|
|
- { field: "carrinse/side", title: "后盖密闭图片", minWidth: 110, align: "center", slots: { default: "default_imgUrl" } },
|
|
|
- { title: "操作", fixed: "right", width: 140, align: "center", slots: { default: "action" } }
|
|
|
-])
|
|
|
-
|
|
|
-// 显示隐藏 筛选表单
|
|
|
-const xGridTable = ref();
|
|
|
-const toggleFormEnabled = () => xGridTable.value.toggleFormEnabled();
|
|
|
-
|
|
|
-const refreshTable = () => {
|
|
|
- xGridTable.value.reloadColumn(columns);
|
|
|
- xGridTable.value.searchData();
|
|
|
-}
|
|
|
-
|
|
|
-const table_stop = row => {
|
|
|
- ElMessageBox.confirm("是否确认终止该任务?", "提示", {
|
|
|
- type: "warning",
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消"
|
|
|
- }).then(() => {
|
|
|
- API.common.opsTask.stop({ id: row.id }).then(() => {
|
|
|
- ElMessage.success("操作成功");
|
|
|
- refreshTable();
|
|
|
- });
|
|
|
- });
|
|
|
-}
|
|
|
</script>
|