优化代码生成模板
This commit is contained in:
parent
f9afb403cc
commit
6fc10455a4
@ -7,29 +7,35 @@
|
|||||||
* @LastEditTime: (${replaceDto.AddTime})
|
* @LastEditTime: (${replaceDto.AddTime})
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div>
|
||||||
<!-- :model属性用于表单验证使用 比如下面的el-form-item 的 prop属性用于对表单值进行验证操作 -->
|
<el-form :model="queryParams" label-position="right" inline ref="queryRef" v-show="showSearch" @submit.prevent>
|
||||||
<el-form :model="queryParams" label-position="right" inline ref="queryRef" v-show="showSearch"
|
|
||||||
@submit.prevent>
|
|
||||||
$foreach(column in genTable.Columns)
|
$foreach(column in genTable.Columns)
|
||||||
$set(labelName = "")
|
$set(labelName = "")
|
||||||
$set(columnName = "")
|
$set(columnName = "")
|
||||||
$set(numLabel = "")
|
$set(numLabel = "")
|
||||||
$if(column.IsQuery == true)
|
$set(columnName = column.CsharpFieldFl)
|
||||||
$set(columnName = column.CsharpFieldFl)
|
$if(column.ColumnComment != "")
|
||||||
$if(column.ColumnComment != "")
|
$set(labelName = column.ColumnComment)
|
||||||
$set(labelName = column.ColumnComment)
|
$else
|
||||||
$else
|
$set(labelName = column.CsharpFieldFl)
|
||||||
$set(labelName = column.CsharpFieldFl)
|
$end
|
||||||
$end
|
$if(column.CsharpType == "int" || column.CsharpType == "long")
|
||||||
$if(column.CsharpType == "int" || column.CsharpType == "long")
|
$set(numLabel = ".number")
|
||||||
$set(numLabel = ".number")
|
$end
|
||||||
$end
|
|
||||||
|
|
||||||
$if(column.HtmlType == "datetime")
|
$if(column.HtmlType == "datetime")
|
||||||
<el-form-item label="$labelName">
|
<el-form-item label="$labelName">
|
||||||
<el-date-picker v-model="dateRange${column.CsharpField}" style="width: 240px" type="daterange" range-separator="-"
|
<el-date-picker
|
||||||
start-placeholder="开始日期" end-placeholder="结束日期" placeholder="请选择$labelName" :picker-options="{ firstDayOfWeek: 1}"></el-date-picker>
|
v-model="dateRange${column.CsharpField}"
|
||||||
|
type="datetimerange"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
placeholder="请选择$labelName"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
:default-time="defaultTime"
|
||||||
|
:shortcuts="dateOptions">
|
||||||
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
$elseif(column.HtmlType == "select" || column.HtmlType == "radio" || column.HtmlType == "selectMulti")
|
$elseif(column.HtmlType == "select" || column.HtmlType == "radio" || column.HtmlType == "selectMulti")
|
||||||
<el-form-item label="${labelName}" prop="${columnName}">
|
<el-form-item label="${labelName}" prop="${columnName}">
|
||||||
@ -92,8 +98,7 @@ $end
|
|||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
:default-expand-all="isExpandAll"
|
:default-expand-all="isExpandAll"
|
||||||
row-key="${tool.FirstLowerCase(genTable.Options.TreeCode)}"
|
row-key="${tool.FirstLowerCase(genTable.Options.TreeCode)}"
|
||||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
|
||||||
>
|
|
||||||
<el-table-column type="selection" width="50" align="center"/>
|
<el-table-column type="selection" width="50" align="center"/>
|
||||||
$foreach(column in genTable.Columns)
|
$foreach(column in genTable.Columns)
|
||||||
$set(labelName = "")
|
$set(labelName = "")
|
||||||
@ -291,7 +296,7 @@ $end
|
|||||||
</template>
|
</template>
|
||||||
<script setup name="${genTable.BusinessName.ToLower()}">
|
<script setup name="${genTable.BusinessName.ToLower()}">
|
||||||
import { treelist${genTable.BusinessName}, list${genTable.BusinessName}, add${genTable.BusinessName}, del${genTable.BusinessName}, update${genTable.BusinessName}, get${genTable.BusinessName},
|
import { treelist${genTable.BusinessName}, list${genTable.BusinessName}, add${genTable.BusinessName}, del${genTable.BusinessName}, update${genTable.BusinessName}, get${genTable.BusinessName},
|
||||||
$if(replaceDto.ShowBtnExport) export${genTable.BusinessName}, $end $if(showCustomInput) changeSort $end } from '@/api/${tool.FirstLowerCase(genTable.ModuleName)}/${genTable.BusinessName.ToLower()}.js'
|
$if(showCustomInput) changeSort $end } from '@/api/${tool.FirstLowerCase(genTable.ModuleName)}/${genTable.BusinessName.ToLower()}.js'
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
// 是否展开,默认全部折叠
|
// 是否展开,默认全部折叠
|
||||||
@ -308,15 +313,10 @@ function toggleExpandAll() {
|
|||||||
|
|
||||||
// 选中${replaceDto.FistLowerPk}数组数组
|
// 选中${replaceDto.FistLowerPk}数组数组
|
||||||
const ids = ref([])
|
const ids = ref([])
|
||||||
// 非单选禁用
|
|
||||||
const single = ref(true)
|
const single = ref(true)
|
||||||
// 非多个禁用
|
|
||||||
const multiple = ref(true)
|
const multiple = ref(true)
|
||||||
// 遮罩层
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
// 显示搜索条件
|
|
||||||
const showSearch = ref(true)
|
const showSearch = ref(true)
|
||||||
// 查询参数
|
|
||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
@ -328,39 +328,11 @@ $if(item.IsQuery == true)
|
|||||||
$end
|
$end
|
||||||
$end
|
$end
|
||||||
})
|
})
|
||||||
// 弹出层标题
|
|
||||||
const title = ref("")
|
|
||||||
// 操作类型 1、add 2、edit
|
|
||||||
const opertype = ref(0)
|
|
||||||
// 是否显示弹出层
|
|
||||||
const open = ref(false)
|
|
||||||
// 表单参数
|
|
||||||
const state = reactive({
|
|
||||||
form: {},
|
|
||||||
rules: {
|
|
||||||
$foreach(column in genTable.Columns)
|
|
||||||
$if(column.IsRequired && column.IsIncrement == false)
|
|
||||||
${column.CsharpFieldFl}: [{ required: true, message: "${column.ColumnComment}不能为空", trigger: $if(column.htmlType == "select")"change"$else"blur"$end
|
|
||||||
$if(column.CsharpType == "int" || column.CsharpType == "long"), type: "number"$end }],
|
|
||||||
$end
|
|
||||||
$end
|
|
||||||
},
|
|
||||||
options: {
|
|
||||||
$foreach(column in genTable.Columns)
|
|
||||||
$if(column.HtmlType == "radio" || column.HtmlType == "select" || column.HtmlType == "checkbox" || column.HtmlType == "selectMulti")
|
|
||||||
//$if(column.ColumnComment != "") ${column.ColumnComment} $else ${column.CsharpFieldFl}$end选项列表 格式 eg:{ dictLabel: '标签', dictValue: '0'}
|
|
||||||
$if(column.DictType != "")${column.DictType}$else${column.CsharpFieldFl}Options$end: [],
|
|
||||||
$end
|
|
||||||
$end
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const { form, rules, options } = toRefs(state)
|
|
||||||
// 总记录数
|
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
const dataList = ref([])
|
const dataList = ref([])
|
||||||
const queryRef = ref()
|
const queryRef = ref()
|
||||||
const formRef = ref()
|
const defaultTime = ref([new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)])
|
||||||
|
|
||||||
$foreach(item in genTable.Columns)
|
$foreach(item in genTable.Columns)
|
||||||
$if(item.HtmlType == "datetime" && item.IsQuery == true)
|
$if(item.HtmlType == "datetime" && item.IsQuery == true)
|
||||||
// ${item.ColumnComment}时间范围
|
// ${item.ColumnComment}时间范围
|
||||||
@ -391,7 +363,6 @@ function handleChangeSort(info) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
// ******************自定义编辑 end **********************
|
// ******************自定义编辑 end **********************
|
||||||
|
|
||||||
$end
|
$end
|
||||||
$end
|
$end
|
||||||
|
|
||||||
@ -421,7 +392,8 @@ $end
|
|||||||
$end
|
$end
|
||||||
loading.value = true
|
loading.value = true
|
||||||
treelist${genTable.BusinessName}(queryParams).then(res => {
|
treelist${genTable.BusinessName}(queryParams).then(res => {
|
||||||
if (res.code == 200) {
|
const { code, data } = res
|
||||||
|
if (code == 200) {
|
||||||
//dataList.value = res.data.result
|
//dataList.value = res.data.result
|
||||||
//total.value = res.data.totalNum
|
//total.value = res.data.totalNum
|
||||||
dataList.value = res.data
|
dataList.value = res.data
|
||||||
@ -430,94 +402,12 @@ $end
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 关闭dialog
|
|
||||||
function cancel(){
|
|
||||||
open.value = false
|
|
||||||
reset()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 重置表单
|
|
||||||
function reset() {
|
|
||||||
proxy.resetForm("formRef")
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询
|
// 查询
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.pageNum = 1
|
queryParams.pageNum = 1
|
||||||
getList()
|
getList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加
|
|
||||||
function handleAdd() {
|
|
||||||
reset();
|
|
||||||
open.value = true
|
|
||||||
title.value = '添加'
|
|
||||||
opertype.value = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除按钮操作
|
|
||||||
function handleDelete(row) {
|
|
||||||
const Ids = row.${replaceDto.FistLowerPk} || ids.value
|
|
||||||
|
|
||||||
proxy.${confirm}confirm('是否确认删除参数编号为"' + Ids + '"的数据项?')
|
|
||||||
.then(function () {
|
|
||||||
return del${genTable.BusinessName}(Ids)
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
handleQuery()
|
|
||||||
proxy.${modal}modal.msgSuccess("删除成功")
|
|
||||||
})
|
|
||||||
.catch(() => {})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改按钮操作
|
|
||||||
function handleUpdate(row) {
|
|
||||||
reset()
|
|
||||||
const id = row.${replaceDto.FistLowerPk} || ids.value
|
|
||||||
get${genTable.BusinessName}(id).then((res) => {
|
|
||||||
const { code, data } = res
|
|
||||||
if (code == 200) {
|
|
||||||
open.value = true
|
|
||||||
title.value = "修改数据"
|
|
||||||
opertype.value = 2
|
|
||||||
|
|
||||||
form.value = {
|
|
||||||
...data,
|
|
||||||
$foreach(item in genTable.Columns)
|
|
||||||
$if(item.HtmlType == "checkbox")
|
|
||||||
${item.CsharpFieldFl}Checked: data.${item.CsharpFieldFl} ? data.${item.CsharpFieldFl}.split(',') : [],
|
|
||||||
$end
|
|
||||||
$end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 表单提交
|
|
||||||
function submitForm() {
|
|
||||||
proxy.${refs}refs["formRef"].validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
if (form.value.${replaceDto.FistLowerPk} != undefined && opertype.value === 2) {
|
|
||||||
update${genTable.BusinessName}(form.value).then((res) => {
|
|
||||||
proxy.${modal}modal.msgSuccess("修改成功")
|
|
||||||
open.value = false
|
|
||||||
getList()
|
|
||||||
})
|
|
||||||
.catch(() => {})
|
|
||||||
} else {
|
|
||||||
add${genTable.BusinessName}(form.value).then((res) => {
|
|
||||||
proxy.${modal}modal.msgSuccess("新增成功")
|
|
||||||
open.value = false
|
|
||||||
getList()
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
//TODO 错误逻辑
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 重置查询操作
|
// 重置查询操作
|
||||||
function resetQuery(){
|
function resetQuery(){
|
||||||
$foreach(item in genTable.Columns)
|
$foreach(item in genTable.Columns)
|
||||||
@ -529,20 +419,6 @@ $end
|
|||||||
proxy.resetForm("queryRef")
|
proxy.resetForm("queryRef")
|
||||||
handleQuery()
|
handleQuery()
|
||||||
}
|
}
|
||||||
$if(replaceDto.ShowBtnExport)
|
|
||||||
// 导出按钮操作
|
|
||||||
function handleExport() {
|
|
||||||
proxy
|
|
||||||
.${confirm}confirm("是否确认导出所有${genTable.functionName}数据项?", "警告", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "warning",
|
|
||||||
})
|
|
||||||
.then(async () => {
|
|
||||||
await export${genTable.BusinessName}(queryParams)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
$end
|
|
||||||
|
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
@ -573,5 +449,128 @@ ${end}
|
|||||||
handleQuery()
|
handleQuery()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*************** form操作 ***************/
|
||||||
|
const formRef = ref()
|
||||||
|
const title = ref("")
|
||||||
|
// 操作类型 1、add 2、edit
|
||||||
|
const opertype = ref(0)
|
||||||
|
const open = ref(false)
|
||||||
|
const state = reactive({
|
||||||
|
form: {},
|
||||||
|
rules: {
|
||||||
|
$foreach(column in genTable.Columns)
|
||||||
|
$if(column.IsRequired && column.IsIncrement == false)
|
||||||
|
${column.CsharpFieldFl}: [{ required: true, message: "${column.ColumnComment}不能为空", trigger: $if(column.htmlType == "select")"change"$else"blur"$end
|
||||||
|
$if(column.CsharpType == "int" || column.CsharpType == "long"), type: "number"$end }],
|
||||||
|
$end
|
||||||
|
$end
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
$foreach(column in genTable.Columns)
|
||||||
|
$if(column.HtmlType == "radio" || column.HtmlType == "select" || column.HtmlType == "checkbox" || column.HtmlType == "selectMulti")
|
||||||
|
//$if(column.ColumnComment != "") ${column.ColumnComment} $else ${column.CsharpFieldFl}$end选项列表 格式 eg:{ dictLabel: '标签', dictValue: '0'}
|
||||||
|
$if(column.DictType != "")${column.DictType}$else${column.CsharpFieldFl}Options$end: [],
|
||||||
|
$end
|
||||||
|
$end
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const { form, rules, options } = toRefs(state)
|
||||||
|
|
||||||
|
// 关闭dialog
|
||||||
|
function cancel(){
|
||||||
|
open.value = false
|
||||||
|
reset()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重置表单
|
||||||
|
function reset() {
|
||||||
|
proxy.resetForm("formRef")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加按钮操作
|
||||||
|
function handleAdd() {
|
||||||
|
reset();
|
||||||
|
open.value = true
|
||||||
|
title.value = '添加'
|
||||||
|
opertype.value = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改按钮操作
|
||||||
|
function handleUpdate(row) {
|
||||||
|
reset()
|
||||||
|
const id = row.${replaceDto.FistLowerPk} || ids.value
|
||||||
|
get${genTable.BusinessName}(id).then((res) => {
|
||||||
|
const { code, data } = res
|
||||||
|
if (code == 200) {
|
||||||
|
open.value = true
|
||||||
|
title.value = "修改数据"
|
||||||
|
opertype.value = 2
|
||||||
|
|
||||||
|
form.value = {
|
||||||
|
...data,
|
||||||
|
$foreach(item in genTable.Columns)
|
||||||
|
$if(item.HtmlType == "checkbox")
|
||||||
|
${item.CsharpFieldFl}Checked: data.${item.CsharpFieldFl} ? data.${item.CsharpFieldFl}.split(',') : [],
|
||||||
|
$end
|
||||||
|
$end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加&修改 表单提交
|
||||||
|
function submitForm() {
|
||||||
|
proxy.${refs}refs["formRef"].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (form.value.${replaceDto.FistLowerPk} != undefined && opertype.value === 2) {
|
||||||
|
update${genTable.BusinessName}(form.value).then((res) => {
|
||||||
|
proxy.${modal}modal.msgSuccess("修改成功")
|
||||||
|
open.value = false
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
.catch(() => {})
|
||||||
|
} else {
|
||||||
|
add${genTable.BusinessName}(form.value).then((res) => {
|
||||||
|
proxy.${modal}modal.msgSuccess("新增成功")
|
||||||
|
open.value = false
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
.catch(() => {})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除按钮操作
|
||||||
|
function handleDelete(row) {
|
||||||
|
const Ids = row.${replaceDto.FistLowerPk} || ids.value
|
||||||
|
|
||||||
|
proxy.${confirm}confirm('是否确认删除参数编号为"' + Ids + '"的数据项?')
|
||||||
|
.then(function () {
|
||||||
|
return del${genTable.BusinessName}(Ids)
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
getList()
|
||||||
|
proxy.${modal}modal.msgSuccess("删除成功")
|
||||||
|
})
|
||||||
|
.catch(() => {})
|
||||||
|
}
|
||||||
|
|
||||||
|
$if(replaceDto.ShowBtnExport)
|
||||||
|
// 导出按钮操作
|
||||||
|
function handleExport() {
|
||||||
|
proxy
|
||||||
|
.${confirm}confirm("是否确认导出${genTable.functionName}数据项?", "警告", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
await proxy.downFile('/${genTable.ModuleName}/${genTable.BusinessName}/export', { ...queryParams })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
$end
|
||||||
|
|
||||||
handleQuery()
|
handleQuery()
|
||||||
</script>
|
</script>
|
||||||
@ -202,7 +202,7 @@ $else
|
|||||||
$if(column.HtmlType == "inputNumber" || column.HtmlType == "customInput")
|
$if(column.HtmlType == "inputNumber" || column.HtmlType == "customInput")
|
||||||
<el-col :lg="${options.ColNum}">
|
<el-col :lg="${options.ColNum}">
|
||||||
<el-form-item label="${labelName}" prop="${columnName}">
|
<el-form-item label="${labelName}" prop="${columnName}">
|
||||||
<el-input-number v-model.number="form.${columnName}" controls-position="right" placeholder="请输入${labelName}" ${column.DisabledStr}/>
|
<el-input-number v-model.number="form.${columnName}" :controls="true" controls-position="right" placeholder="请输入${labelName}" ${column.DisabledStr}/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
$elseif(column.HtmlType == "datetime")
|
$elseif(column.HtmlType == "datetime")
|
||||||
@ -439,7 +439,6 @@ ${end}
|
|||||||
handleQuery()
|
handleQuery()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************** form操作 ***************/
|
/*************** form操作 ***************/
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
const title = ref("")
|
const title = ref("")
|
||||||
@ -489,21 +488,6 @@ $end
|
|||||||
proxy.resetForm("formRef")
|
proxy.resetForm("formRef")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除按钮操作
|
|
||||||
function handleDelete(row) {
|
|
||||||
const Ids = row.${replaceDto.FistLowerPk} || ids.value
|
|
||||||
|
|
||||||
proxy.${confirm}confirm('是否确认删除参数编号为"' + Ids + '"的数据项?')
|
|
||||||
.then(function () {
|
|
||||||
return del${genTable.BusinessName}(Ids)
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
handleQuery()
|
|
||||||
proxy.${modal}modal.msgSuccess("删除成功")
|
|
||||||
})
|
|
||||||
.catch(() => {})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 添加按钮操作
|
// 添加按钮操作
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
reset();
|
reset();
|
||||||
@ -557,47 +541,29 @@ $end
|
|||||||
open.value = false
|
open.value = false
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch(() => {})
|
||||||
//TODO 错误逻辑
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
$if(replaceDto.ShowBtnExport)
|
// 删除按钮操作
|
||||||
// 导出按钮操作
|
function handleDelete(row) {
|
||||||
function handleExport() {
|
const Ids = row.${replaceDto.FistLowerPk} || ids.value
|
||||||
proxy
|
|
||||||
.${confirm}confirm("是否确认导出${genTable.functionName}数据项?", "警告", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "warning",
|
|
||||||
})
|
|
||||||
.then(async () => {
|
|
||||||
await proxy.downFile('/${genTable.ModuleName}/${genTable.BusinessName}/export', { ...queryParams })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
$end
|
|
||||||
|
|
||||||
$if(replaceDto.ShowBtnView)
|
proxy.${confirm}confirm('是否确认删除参数编号为"' + Ids + '"的数据项?')
|
||||||
/**
|
.then(function () {
|
||||||
* 预览
|
return del${genTable.BusinessName}(Ids)
|
||||||
* @param {*} row
|
})
|
||||||
*/
|
.then(() => {
|
||||||
function handlePreview(row) {
|
getList()
|
||||||
reset()
|
proxy.${modal}modal.msgSuccess("删除成功")
|
||||||
open.value = true
|
})
|
||||||
title.value = '预览'
|
.catch(() => {})
|
||||||
opertype.value = 3
|
|
||||||
form.value = row
|
|
||||||
}
|
}
|
||||||
$end
|
|
||||||
|
|
||||||
$if(replaceDto.ShowBtnTruncate)
|
$if(replaceDto.ShowBtnTruncate)
|
||||||
/**
|
// 清空
|
||||||
* 清空
|
|
||||||
*/
|
|
||||||
function handleClear() {
|
function handleClear() {
|
||||||
proxy
|
proxy
|
||||||
.${confirm}confirm("是否确认清空所有数据项?", "警告", {
|
.${confirm}confirm("是否确认清空所有数据项?", "警告", {
|
||||||
@ -615,5 +581,34 @@ function handleClear() {
|
|||||||
}
|
}
|
||||||
$end
|
$end
|
||||||
|
|
||||||
|
$if(replaceDto.ShowBtnView)
|
||||||
|
/**
|
||||||
|
* 查看
|
||||||
|
* @param {*} row
|
||||||
|
*/
|
||||||
|
function handlePreview(row) {
|
||||||
|
reset()
|
||||||
|
open.value = true
|
||||||
|
title.value = '查看'
|
||||||
|
opertype.value = 3
|
||||||
|
form.value = row
|
||||||
|
}
|
||||||
|
$end
|
||||||
|
|
||||||
|
$if(replaceDto.ShowBtnExport)
|
||||||
|
// 导出按钮操作
|
||||||
|
function handleExport() {
|
||||||
|
proxy
|
||||||
|
.${confirm}confirm("是否确认导出${genTable.functionName}数据项?", "警告", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
await proxy.downFile('/${genTable.ModuleName}/${genTable.BusinessName}/export', { ...queryParams })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
$end
|
||||||
|
|
||||||
handleQuery()
|
handleQuery()
|
||||||
</script>
|
</script>
|
||||||
Loading…
x
Reference in New Issue
Block a user