优化移动端代码生成

This commit is contained in:
不做码农 2023-07-05 07:49:53 +08:00
parent 7ac3a7b647
commit 861cfded06
2 changed files with 21 additions and 17 deletions

View File

@ -73,7 +73,7 @@ $end
<view class="btn-item">
<u-button text="取消" shape="circle" icon="close" type="info" @click="handleCancel"></u-button>
</view>
<view class="btn-item">
<view class="btn-item" v-if="opertype != 3">
<u-button text="确定" shape="circle" icon="checkmark" type="primary" @click="submit"></u-button>
</view>
</view>
@ -92,7 +92,7 @@ $if(replaceDto.ShowBtnEdit)
$end
}
from '@/api/${tool.FirstLowerCase(genTable.ModuleName)}/${genTable.BusinessName.ToLower()}.js'
export default {
dicts: [
$foreach(item in genTable.Columns)

View File

@ -37,6 +37,12 @@ $end
$end
$end
<view class="info-btn-wrap justify-end">
$if(replaceDto.ShowBtnView)
<view class="tag-item">
<u-tag text="详情" plain shape="circle" type="info" icon="eye" @click="handleView(item)"
v-if="checkPermi(['${replaceDto.PermissionPrefix}:query'])"></u-tag>
</view>
$end
$if(replaceDto.ShowBtnEdit)
<view class="tag-item">
<u-tag text="编辑" plain shape="circle" icon="edit-pen" @click="handleEdit(item)"
@ -128,25 +134,12 @@ $end
import "@/static/scss/page.scss";
import {
list${genTable.BusinessName},
get${genTable.BusinessName},
$if(replaceDto.ShowBtnAdd)
add${genTable.BusinessName},
$end
$if(replaceDto.ShowBtnDelete || replaceDto.ShowBtnMultiDel)
del${genTable.BusinessName},
$end
$if(replaceDto.ShowBtnEdit)
update${genTable.BusinessName},
$end
$if(replaceDto.ShowBtnTruncate)
clear${genTable.BusinessName},
$end
$if(showCustomInput)
changeSort
$end
}
from '@/api/${tool.FirstLowerCase(genTable.ModuleName)}/${genTable.BusinessName.ToLower()}.js'
from '@/api/${tool.FirstLowerCase(genTable.ModuleName)}/${genTable.BusinessName.ToLower()}.js'
import {
getDate
} from '@/utils/common.js'
@ -216,12 +209,22 @@ $end
}
})
},
$if(replaceDto.ShowBtnAdd)
handleAdd() {
this.${tab}tab.navigateTo('./edit?opertype=1')
},
$end
$if(replaceDto.ShowBtnEdit)
handleEdit(e) {
this.${tab}tab.navigateTo('./edit?opertype=2&${replaceDto.FistLowerPk}=' + e.id)
},
$end
$if(replaceDto.ShowBtnView)
handleView(e) {
this.${tab}tab.navigateTo('./edit?opertype=3&${replaceDto.FistLowerPk}=' + e.id)
},
$end
$if(replaceDto.ShowBtnDelete || replaceDto.ShowBtnMultiDel)
handleDelete(row) {
const Ids = row.${replaceDto.FistLowerPk};
@ -234,6 +237,7 @@ $end
})
.catch(() => {});
},
$end
resetQuery() {
this.${refs}refs.uForm.resetFields()
$foreach(column in genTable.Columns)