autumnal_wind@yeah.net
2024-05-29 646ff849dbe8e07a63d81ae86917373cd39ef223
hs-modules/hs-generator/src/main/resources/vm/vue/index.vue.vm
@@ -73,6 +73,9 @@
            <el-button type="primary" plain icon="Plus" @click="openForm('create')" v-hasPermi="['${moduleName}:${businessName}:add']">新增</el-button>
          </el-col>
          <el-col :span="1.5">
                <el-button type="success" plain icon="Edit" :disabled="single" @click="openForm('update')" v-hasPermi="['system:post:edit']">修改</el-button>
            </el-col>
          <el-col :span="1.5">
            <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['${moduleName}:${businessName}:remove']">删除</el-button>
          </el-col>
          <el-col :span="1.5">
@@ -123,7 +126,7 @@
        <el-table-column label="操作" align="center" 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="['${moduleName}:${businessName}:edit']"></el-button>
              <el-button link type="primary" icon="Edit" @click="openForm('update',scope.row)" v-hasPermi="['${moduleName}:${businessName}:edit']"></el-button>
            </el-tooltip>
            <el-tooltip content="删除" placement="top">
              <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${moduleName}:${businessName}:remove']"></el-button>
@@ -131,7 +134,7 @@
          </template>
        </el-table-column>
      </el-table>
        <!-- 翻页组件 -->
      <pagination
          v-show="total>0"
          :total="total"
@@ -148,8 +151,8 @@
<script setup name="${BusinessName}" lang="ts">
/** 模块导入 */
import { list${BusinessName}, del${BusinessName}} from '@/api/${moduleName}/${businessName}';
import { ${BusinessName}VO, ${BusinessName}Query} from '@/api/${moduleName}/${businessName}/types';
import DetailForm from "@/views/${moduleName}/${businessName}/DetailForm.vue";
import { ${BusinessName}VO} from '@/api/${moduleName}/${businessName}/types';
import DetailForm from './DetailForm.vue';
defineOptions({ name: '${BusinessName}' })
@@ -180,7 +183,7 @@
const dateRange${AttrName} = ref<[DateModelType, DateModelType]>(['', '']);
#end
#end
// 查询窗体Ref
const queryFormRef = ref<ElFormInstance>();
// 查询参数
const queryParams = reactive({
@@ -218,7 +221,7 @@
/** 搜索按钮操作 */
const handleQuery = () => {
  queryParams.value.pageNum = 1;
  queryParams.pageNum = 1;
  getList();
}
@@ -258,7 +261,8 @@
}
/** 弹出框(增加、修改) */
const detailFormRef = ref();
const openForm = (type: string, id?: number) => {
const openForm = (type: string, row?: ${BusinessName}VO) => {
    const id = row?.${pkColumn.javaField} || ids.value[0];
    detailFormRef?.value.open(type, id)
}
onMounted(() => {