<template>
  <div class="p-2 wcs-subtask-template-page">
    <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
      <div v-show="showSearch" class="mb-[10px] subtask-template-search-wrap">
        <el-card class="subtask-template-search-card" shadow="hover">
          <el-form ref="queryFormRef" class="subtask-template-query-form" :model="queryParams" :inline="true">
            <el-form-item label="子任务编码" prop="subtaskCode">
              <el-input v-model="queryParams.subtaskCode" placeholder="请输入子任务编码" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="子任务名称" prop="subtaskName">
              <el-input v-model="queryParams.subtaskName" placeholder="请输入子任务名称" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="子任务类型" prop="subtaskType">
              <el-select v-model="queryParams.subtaskType" placeholder="请选择子任务类型" clearable>
                <el-option v-for="dict in subtask_type" :key="dict.value" :label="dict.label" :value="dict.value" />
              </el-select>
            </el-form-item>
            <el-form-item label="设备类型" prop="deviceType">
              <el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" clearable>
                <el-option v-for="dict in subtask_device_type" :key="dict.value" :label="dict.label" :value="dict.value" />
              </el-select>
            </el-form-item>
            <el-form-item label="设备动作" prop="deviceAction">
              <el-input v-model="queryParams.deviceAction" placeholder="请输入设备动作" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="源位置类型" prop="sourceLocationType">
              <el-select v-model="queryParams.sourceLocationType" placeholder="请选择源位置类型" clearable>
                <el-option v-for="dict in location_type" :key="dict.value" :label="dict.label" :value="dict.value" />
              </el-select>
            </el-form-item>
            <el-form-item label="源位置编码模板" prop="sourceLocationCode">
              <el-input v-model="queryParams.sourceLocationCode" placeholder="请输入源位置编码模板" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="目标位置类型" prop="targetLocationType">
              <el-select v-model="queryParams.targetLocationType" placeholder="请选择目标位置类型" clearable>
                <el-option v-for="dict in location_type" :key="dict.value" :label="dict.label" :value="dict.value" />
              </el-select>
            </el-form-item>
            <el-form-item label="目标位置编码模板" prop="targetLocationCode">
              <el-input v-model="queryParams.targetLocationCode" placeholder="请输入目标位置编码模板" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="物料操作" prop="materialAction">
              <el-select v-model="queryParams.materialAction" placeholder="请选择物料操作" clearable>
                <el-option v-for="dict in material_action" :key="dict.value" :label="dict.label" :value="dict.value" />
              </el-select>
            </el-form-item>
            <el-form-item label="容器类型" prop="containerType">
              <el-select v-model="queryParams.containerType" placeholder="请选择容器类型" clearable>
                <el-option v-for="dict in container_type" :key="dict.value" :label="dict.label" :value="dict.value" />
              </el-select>
            </el-form-item>
            <el-form-item label="是否携带物料" prop="isCarryMaterial">
              <el-select v-model="queryParams.isCarryMaterial" placeholder="请选择" clearable>
                <el-option v-for="dict in carry_material" :key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
              </el-select>
            </el-form-item>
            <el-form-item label="状态" prop="status">
              <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
                <el-option v-for="dict in enable_status" :key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
              </el-select>
            </el-form-item>
            <el-form-item label="必需的参数列表" prop="requiredParams">
              <el-input v-model="queryParams.requiredParams" placeholder="请输入必需的参数列表" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="创建时间" prop="createtime">
              <el-date-picker clearable
                v-model="queryParams.createtime"
                type="date"
                value-format="YYYY-MM-DD"
                placeholder="请选择创建时间"
              />
            </el-form-item>
            <el-form-item class="subtask-template-query-actions">
              <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
              <el-button icon="Refresh" @click="resetQuery">重置</el-button>
            </el-form-item>
          </el-form>
        </el-card>
      </div>
    </transition>

    <el-card shadow="never">
      <template #header>
        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['wcs:subtaskTemplate:add']">新增</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['wcs:subtaskTemplate:edit']">修改</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['wcs:subtaskTemplate:remove']">删除</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['wcs:subtaskTemplate:export']">导出</el-button>
          </el-col>
          <right-toolbar v-model:show-search="showSearch" :columns="columns" @query-table="getList"></right-toolbar>
        </el-row>
      </template>

      <el-table v-loading="loading" border :data="subtaskTemplateList" @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55" align="center" />
        <el-table-column v-if="columns[0].visible" type="index" label="序号" width="60" align="center" />
        <el-table-column v-if="columns[1].visible" label="子任务编码" align="center" prop="subtaskCode" min-width="130" :show-overflow-tooltip="true" />
        <el-table-column v-if="columns[2].visible" label="子任务名称" align="center" prop="subtaskName" min-width="150" :show-overflow-tooltip="true" />
        <el-table-column v-if="columns[3].visible" label="子任务类型" align="center" prop="subtaskType" min-width="120" :show-overflow-tooltip="true">
          <template #default="scope">
            <dict-tag :options="subtask_type" :value="scope.row.subtaskType" />
          </template>
        </el-table-column>
        <el-table-column v-if="columns[4].visible" label="设备类型" align="center" prop="deviceType" min-width="120" :show-overflow-tooltip="true">
          <template #default="scope">
            <dict-tag :options="subtask_device_type" :value="scope.row.deviceType" />
          </template>
        </el-table-column>
        <el-table-column v-if="columns[5].visible" label="设备动作" align="center" prop="deviceAction" min-width="120" :show-overflow-tooltip="true" />
        <el-table-column v-if="columns[6].visible" label="源位置类型" align="center" prop="sourceLocationType" min-width="120">
          <template #default="scope">
            <dict-tag :options="location_type" :value="scope.row.sourceLocationType" />
          </template>
        </el-table-column>
        <el-table-column v-if="columns[7].visible" label="源位置模板" align="center" prop="sourceLocationCode" min-width="150" :show-overflow-tooltip="true" />
        <el-table-column v-if="columns[8].visible" label="目标位置类型" align="center" prop="targetLocationType" min-width="120">
          <template #default="scope">
            <dict-tag :options="location_type" :value="scope.row.targetLocationType" />
          </template>
        </el-table-column>
        <el-table-column v-if="columns[9].visible" label="目标位置模板" align="center" prop="targetLocationCode" min-width="150" :show-overflow-tooltip="true" />
        <el-table-column v-if="columns[10].visible" label="物料操作" align="center" prop="materialAction" width="110">
          <template #default="scope">
            <dict-tag :options="material_action" :value="scope.row.materialAction" />
          </template>
        </el-table-column>
        <el-table-column v-if="columns[11].visible" label="容器类型" align="center" prop="containerType" width="110">
          <template #default="scope">
            <dict-tag :options="container_type" :value="scope.row.containerType" />
          </template>
        </el-table-column>
        <el-table-column v-if="columns[12].visible" label="携带物料" align="center" prop="isCarryMaterial" width="100">
          <template #default="scope">
            <dict-tag :options="carry_material" :value="scope.row.isCarryMaterial" />
          </template>
        </el-table-column>
        <el-table-column v-if="columns[13].visible" label="必需参数" align="center" prop="requiredParams" min-width="160" :show-overflow-tooltip="true" />
        <el-table-column v-if="columns[14].visible" label="状态" align="center" prop="status" width="90">
          <template #default="scope">
            <dict-tag :options="enable_status" :value="scope.row.status" />
          </template>
        </el-table-column>
        <el-table-column v-if="columns[15].visible" label="备注" align="center" prop="remark" min-width="160" :show-overflow-tooltip="true" />
        <el-table-column v-if="columns[16].visible" label="创建时间" align="center" prop="createtime" width="170">
          <template #default="scope">
            <span>{{ parseTime(scope.row.createtime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
          </template>
        </el-table-column>
        <el-table-column v-if="columns[17].visible" label="创建人" align="center" prop="createuser" width="110" />
        <el-table-column v-if="columns[18].visible" label="更新人" align="center" prop="updateuser" width="110" />
        <el-table-column label="操作" align="center" fixed="right"  class-name="small-padding fixed-width">
          <template #default="scope">
            <el-tooltip content="修改" placement="top">
              <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['wcs:subtaskTemplate:edit']"></el-button>
            </el-tooltip>
            <el-tooltip content="删除" placement="top">
              <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['wcs:subtaskTemplate:remove']"></el-button>
            </el-tooltip>
          </template>
        </el-table-column>
      </el-table>

      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
    </el-card>
    <!-- 添加或修改子任务模板对话框 -->
    <el-dialog class="subtask-template-edit-dialog" :title="dialog.title" v-model="dialog.visible" width="860px" append-to-body>
      <el-form ref="subtaskTemplateFormRef" class="subtask-template-dialog-form" :model="form" :rules="rules" label-width="132px">
        <el-form-item label="子任务编码" prop="subtaskCode">
          <el-input v-model="form.subtaskCode" placeholder="请输入子任务编码" />
        </el-form-item>
        <el-form-item label="子任务名称" prop="subtaskName">
          <el-input v-model="form.subtaskName" placeholder="请输入子任务名称" />
        </el-form-item>
        <el-form-item label="子任务类型" prop="subtaskType">
          <el-select v-model="form.subtaskType" placeholder="请选择子任务类型">
            <el-option v-for="dict in subtask_type" :key="dict.value" :label="dict.label" :value="dict.value" />
          </el-select>
        </el-form-item>
        <el-form-item label="设备类型" prop="deviceType">
          <el-select v-model="form.deviceType" placeholder="请选择设备类型">
            <el-option v-for="dict in subtask_device_type" :key="dict.value" :label="dict.label" :value="dict.value" />
          </el-select>
        </el-form-item>
        <el-form-item label="设备动作" prop="deviceAction">
          <el-input v-model="form.deviceAction" placeholder="请输入设备动作" />
        </el-form-item>
        <el-form-item label="源位置类型" prop="sourceLocationType">
          <el-select v-model="form.sourceLocationType" placeholder="请选择源位置类型" clearable>
            <el-option v-for="dict in location_type" :key="dict.value" :label="dict.label" :value="dict.value" />
          </el-select>
        </el-form-item>
        <el-form-item label="源位置编码模板" prop="sourceLocationCode">
          <el-input v-model="form.sourceLocationCode" placeholder="请输入源位置编码模板" />
        </el-form-item>
        <el-form-item label="目标位置类型" prop="targetLocationType">
          <el-select v-model="form.targetLocationType" placeholder="请选择目标位置类型" clearable>
            <el-option v-for="dict in location_type" :key="dict.value" :label="dict.label" :value="dict.value" />
          </el-select>
        </el-form-item>
        <el-form-item label="目标位置编码模板" prop="targetLocationCode">
          <el-input v-model="form.targetLocationCode" placeholder="请输入目标位置编码模板" />
        </el-form-item>
        <el-form-item label="物料操作" prop="materialAction">
          <el-select v-model="form.materialAction" placeholder="请选择物料操作" clearable>
            <el-option v-for="dict in material_action" :key="dict.value" :label="dict.label" :value="dict.value" />
          </el-select>
        </el-form-item>
        <el-form-item label="容器类型" prop="containerType">
          <el-select v-model="form.containerType" placeholder="请选择容器类型" clearable>
            <el-option v-for="dict in container_type" :key="dict.value" :label="dict.label" :value="dict.value" />
          </el-select>
        </el-form-item>
        <el-form-item label="状态" prop="status">
          <el-radio-group v-model="form.status">
            <el-radio v-for="dict in enable_status" :key="dict.value" :value="parseInt(dict.value)">{{ dict.label }}</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="是否携带物料" prop="isCarryMaterial">
          <el-radio-group v-model="form.isCarryMaterial">
            <el-radio v-for="dict in carry_material" :key="dict.value" :value="parseInt(dict.value)">{{ dict.label }}</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item class="subtask-template-dialog-span" label="必需的参数列表" prop="requiredParams">
            <el-input v-model="form.requiredParams" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item class="subtask-template-dialog-span" label="备注" prop="remark">
            <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="创建时间" prop="createtime">
          <el-date-picker clearable
            v-model="form.createtime"
            type="datetime"
            value-format="YYYY-MM-DD HH:mm:ss"
            placeholder="请选择创建时间">
          </el-date-picker>
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
          <el-button @click="cancel">取 消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script setup name="SubtaskTemplate" lang="ts">
import { listSubtaskTemplate, getSubtaskTemplate, delSubtaskTemplate, addSubtaskTemplate, updateSubtaskTemplate } from '@/api/wcs/subtaskTemplate';
import { SubtaskTemplateVO, SubtaskTemplateQuery, SubtaskTemplateForm } from '@/api/wcs/subtaskTemplate/types';

const { proxy } = getCurrentInstance() as ComponentInternalInstance;
// 与 BaseSubtaskTemplateVo @ExcelDictFormat 对齐，调度模板的枚举值统一走系统字典，避免页面硬编码流转规则。
const { subtask_type, subtask_device_type, location_type, material_action, container_type, carry_material, enable_status } = toRefs<any>(
  proxy?.useDict('subtask_type', 'subtask_device_type', 'location_type', 'material_action', 'container_type', 'carry_material', 'enable_status')
);

const subtaskTemplateList = ref<SubtaskTemplateVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);

const queryFormRef = ref<ElFormInstance>();
const subtaskTemplateFormRef = ref<ElFormInstance>();

const dialog = reactive<DialogOption>({
  visible: false,
  title: ''
});

// 子任务模板是调度拆解规则，隐藏主键和逻辑删除标记，优先展示规则扩展点和现场排障字段。
const columns = ref<FieldOption[]>([
  { key: 0, label: '序号', visible: true, children: [] },
  { key: 1, label: '子任务编码', visible: true, children: [] },
  { key: 2, label: '子任务名称', visible: true, children: [] },
  { key: 3, label: '子任务类型', visible: true, children: [] },
  { key: 4, label: '设备类型', visible: true, children: [] },
  { key: 5, label: '设备动作', visible: true, children: [] },
  { key: 6, label: '源位置类型', visible: true, children: [] },
  { key: 7, label: '源位置模板', visible: true, children: [] },
  { key: 8, label: '目标位置类型', visible: true, children: [] },
  { key: 9, label: '目标位置模板', visible: true, children: [] },
  { key: 10, label: '物料操作', visible: true, children: [] },
  { key: 11, label: '容器类型', visible: true, children: [] },
  { key: 12, label: '携带物料', visible: true, children: [] },
  { key: 13, label: '必需参数', visible: true, children: [] },
  { key: 14, label: '状态', visible: true, children: [] },
  { key: 15, label: '备注', visible: true, children: [] },
  { key: 16, label: '创建时间', visible: true, children: [] },
  { key: 17, label: '创建人', visible: true, children: [] },
  { key: 18, label: '更新人', visible: true, children: [] }
]);

const initFormData: SubtaskTemplateForm = {
  id: undefined,
  subtaskCode: undefined,
  subtaskName: undefined,
  subtaskType: undefined,
  deviceType: undefined,
  deviceAction: undefined,
  sourceLocationType: undefined,
  sourceLocationCode: undefined,
  targetLocationType: undefined,
  targetLocationCode: undefined,
  materialAction: undefined,
  containerType: undefined,
  isCarryMaterial: undefined,
  requiredParams: undefined,
  status: undefined,
  isDeleted: undefined,
  remark: undefined,
  createtime: undefined,
}
const data = reactive<PageData<SubtaskTemplateForm, SubtaskTemplateQuery>>({
  form: {...initFormData},
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    subtaskCode: undefined,
    subtaskName: undefined,
    subtaskType: undefined,
    deviceType: undefined,
    deviceAction: undefined,
    sourceLocationType: undefined,
    sourceLocationCode: undefined,
    targetLocationType: undefined,
    targetLocationCode: undefined,
    materialAction: undefined,
    containerType: undefined,
    isCarryMaterial: undefined,
    requiredParams: undefined,
    status: undefined,
    isDeleted: undefined,
    createtime: undefined,
    params: {
    }
  },
  rules: {
    id: [
      { required: true, message: "主键不能为空", trigger: "blur" }
    ],
    subtaskCode: [
      { required: true, message: "子任务编码不能为空", trigger: "blur" }
    ],
    subtaskName: [
      { required: true, message: "子任务名称不能为空", trigger: "blur" }
    ],
    subtaskType: [
      { required: true, message: "子任务类型不能为空", trigger: "change" }
    ],
    deviceType: [
      { required: true, message: "执行设备类型不能为空", trigger: "change" }
    ],
    deviceAction: [
      { required: true, message: "设备动作不能为空", trigger: "blur" }
    ],
  }
});

const { queryParams, form, rules } = toRefs(data);

/** 查询子任务模板列表 */
const getList = async () => {
  loading.value = true;
  const res = await listSubtaskTemplate(queryParams.value);
  subtaskTemplateList.value = res.rows;
  total.value = res.total;
  loading.value = false;
}

/** 取消按钮 */
const cancel = () => {
  reset();
  dialog.visible = false;
}

/** 表单重置 */
const reset = () => {
  form.value = {...initFormData};
  subtaskTemplateFormRef.value?.resetFields();
}

/** 搜索按钮操作 */
const handleQuery = () => {
  queryParams.value.pageNum = 1;
  getList();
}

/** 重置按钮操作 */
const resetQuery = () => {
  queryFormRef.value?.resetFields();
  handleQuery();
}

/** 多选框选中数据 */
const handleSelectionChange = (selection: SubtaskTemplateVO[]) => {
  ids.value = selection.map(item => item.id);
  single.value = selection.length != 1;
  multiple.value = !selection.length;
}

/** 新增按钮操作 */
const handleAdd = () => {
  reset();
  dialog.visible = true;
  dialog.title = "添加子任务模板";
}

/** 修改按钮操作 */
const handleUpdate = async (row?: SubtaskTemplateVO) => {
  reset();
  const _id = row?.id || ids.value[0]
  const res = await getSubtaskTemplate(_id);
  Object.assign(form.value, res.data);
  dialog.visible = true;
  dialog.title = "修改子任务模板";
}

/** 提交按钮 */
const submitForm = () => {
  subtaskTemplateFormRef.value?.validate(async (valid: boolean) => {
    if (valid) {
      buttonLoading.value = true;
      if (form.value.id) {
        await updateSubtaskTemplate(form.value).finally(() =>  buttonLoading.value = false);
      } else {
        await addSubtaskTemplate(form.value).finally(() =>  buttonLoading.value = false);
      }
      proxy?.$modal.msgSuccess("操作成功");
      dialog.visible = false;
      await getList();
    }
  });
}

/** 删除按钮操作 */
const handleDelete = async (row?: SubtaskTemplateVO) => {
  const _ids = row?.id || ids.value;
  await proxy?.$modal.confirm('是否确认删除子任务模板编号为"' + _ids + '"的数据项？').finally(() => loading.value = false);
  await delSubtaskTemplate(_ids);
  proxy?.$modal.msgSuccess("删除成功");
  await getList();
}

/** 导出按钮操作 */
const handleExport = () => {
  proxy?.download('wcs/subtaskTemplate/export', {
    ...queryParams.value
  }, `subtaskTemplate_${new Date().getTime()}.xlsx`)
}

onMounted(() => {
  getList();
});
</script>

<style scoped lang="scss">
.wcs-subtask-template-page {
  /* 子任务模板筛选字段多且标签长，独立栅格避免挤压源/目标位置模板。 */
  :deep(.subtask-template-search-card) {
    border: 1px solid var(--el-border-color-lighter);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgb(15 23 42 / 6%);
  }

  :deep(.subtask-template-search-card .el-card__body) {
    padding: 16px 18px 6px;
  }

  :deep(.subtask-template-query-form) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    column-gap: 16px;
    align-items: start;
  }

  :deep(.subtask-template-query-form .el-form-item) {
    margin-right: 0;
    margin-bottom: 12px;
  }

  :deep(.subtask-template-query-form .el-form-item__label) {
    justify-content: flex-start;
    width: 128px;
    color: var(--el-text-color-regular);
  }

  :deep(.subtask-template-query-form .el-input),
  :deep(.subtask-template-query-form .el-select),
  :deep(.subtask-template-query-form .el-date-editor) {
    width: 100%;
  }

  :deep(.subtask-template-query-actions) {
    grid-column: 1 / -1;
  }

  :deep(.subtask-template-query-actions .el-form-item__content) {
    justify-content: flex-end;
    gap: 8px;
  }
}

:global(.subtask-template-edit-dialog) {
  width: min(860px, calc(100vw - 32px)) !important;
}

:global(.subtask-template-edit-dialog .el-dialog__header) {
  padding: 18px 22px 14px;
  background: linear-gradient(90deg, rgb(37 99 235 / 8%), rgb(20 184 166 / 6%));
}

:global(.subtask-template-edit-dialog .el-dialog__body) {
  padding: 20px 24px 8px !important;
}

:global(.subtask-template-edit-dialog .subtask-template-dialog-form) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
}

:global(.subtask-template-edit-dialog .el-form-item) {
  margin-bottom: 18px;
}

:global(.subtask-template-edit-dialog .subtask-template-dialog-span) {
  grid-column: 1 / -1;
}

:global(.subtask-template-edit-dialog .el-input),
:global(.subtask-template-edit-dialog .el-select),
:global(.subtask-template-edit-dialog .el-date-editor) {
  width: 100%;
}

:global(.subtask-template-edit-dialog .el-textarea__inner) {
  min-height: 76px !important;
}

:global(.subtask-template-edit-dialog .el-dialog__footer) {
  padding: 12px 24px 18px;
  border-top: 1px solid var(--el-border-color-lighter);
}

@media (max-width: 768px) {
  .wcs-subtask-template-page {
    :deep(.subtask-template-query-form) {
      grid-template-columns: 1fr;
    }
  }

  :global(.subtask-template-edit-dialog .subtask-template-dialog-form) {
    grid-template-columns: 1fr;
  }
}
</style>
