init
This commit is contained in:
63
DOAN.Admin.WebApi/wwwroot/CodeGenTemplate/app/api.txt
Normal file
63
DOAN.Admin.WebApi/wwwroot/CodeGenTemplate/app/api.txt
Normal file
@@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* ${genTable.functionName}分页查询
|
||||
* @param {查询条件} data
|
||||
*/
|
||||
export function list${genTable.BusinessName}(query) {
|
||||
return request({
|
||||
url: '/${genTable.ModuleName}/${genTable.BusinessName}/list',
|
||||
method: 'get',
|
||||
data: query,
|
||||
})
|
||||
}
|
||||
|
||||
$if(replaceDto.ShowBtnAdd)
|
||||
/**
|
||||
* 新增${genTable.functionName}
|
||||
* @param data
|
||||
*/
|
||||
export function add${genTable.BusinessName}(data) {
|
||||
return request({
|
||||
url: '/${genTable.ModuleName}/${genTable.BusinessName}',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
$end
|
||||
$if(replaceDto.ShowBtnEdit)
|
||||
/**
|
||||
* 修改${genTable.functionName}
|
||||
* @param data
|
||||
*/
|
||||
export function update${genTable.BusinessName}(data) {
|
||||
return request({
|
||||
url: '/${genTable.ModuleName}/${genTable.BusinessName}',
|
||||
method: 'PUT',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
$end
|
||||
/**
|
||||
* 获取${genTable.functionName}详情
|
||||
* @param {Id}
|
||||
*/
|
||||
export function get${genTable.BusinessName}(id) {
|
||||
return request({
|
||||
url: '/${genTable.ModuleName}/${genTable.BusinessName}/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
$if(replaceDto.ShowBtnDelete || replaceDto.ShowBtnMultiDel)
|
||||
/**
|
||||
* 删除${genTable.functionName}
|
||||
* @param {主键} pid
|
||||
*/
|
||||
export function del${genTable.BusinessName}(pid) {
|
||||
return request({
|
||||
url: '/${genTable.ModuleName}/${genTable.BusinessName}/delete/' + pid,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
$end
|
||||
214
DOAN.Admin.WebApi/wwwroot/CodeGenTemplate/app/form.txt
Normal file
214
DOAN.Admin.WebApi/wwwroot/CodeGenTemplate/app/form.txt
Normal file
@@ -0,0 +1,214 @@
|
||||
<template>
|
||||
<view class="edit-wrap">
|
||||
<view class="edit-form">
|
||||
<u--form labelPosition="left" :model="form" labelWidth="90px" :rules="rules" ref="uForm">
|
||||
$foreach(column in genTable.Columns)
|
||||
$set(columnName = column.CsharpFieldFl)
|
||||
$set(value = "item.value")
|
||||
$set(number = "")
|
||||
$set(labelName = column.ColumnComment)
|
||||
$if(column.CsharpType == "int" || column.CsharpType == "long")
|
||||
$set(value = "parseInt(item.value)")
|
||||
$set(number = ".number")
|
||||
$end
|
||||
|
||||
$if(column.IsPK || column.IsIncrement)
|
||||
$if(column.IsPK && column.IsIncrement == false && replaceDto.useSnowflakeId == false)
|
||||
<u-form-item label="${labelName}" prop="${columnName}">
|
||||
<u--input type="number" v-model.number="form.${columnName}" placeholder="请输入${labelName}" :disabled="opertype != 1"></u--input>
|
||||
</u-form-item>
|
||||
$else
|
||||
<u-form-item label="${labelName}" prop="${columnName}" v-if="opertype != 1">
|
||||
<u--input type="number" v-model.number="form.${columnName}" placeholder="请输入${labelName}" :disabled="true"/>
|
||||
</u-form-item>
|
||||
$end
|
||||
$else
|
||||
$if(column.HtmlType == "radio" || column.HtmlType == "selectRadio")
|
||||
<u-form-item label="${labelName}" prop="${columnName}">
|
||||
<u-radio-group v-model="form.${columnName}">
|
||||
<u-radio v-for="item in ${if(column.DictType != "")}dict.type.${column.DictType}${else}${column.CsharpFieldFl}Options$end" :name="${value}" class="margin-right-xl">{{item.label}}</u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
$elseif(column.HtmlType == "checkbox")
|
||||
<u-form-item label="${labelName}" prop="${columnName}">
|
||||
<view class="">
|
||||
<u-checkbox-group v-model="form.${columnName}Checked">
|
||||
<u-checkbox :customStyle="{marginRight: '20px', marginBottom: '15px'}" v-for="(item, index) in ${if(column.DictType != "")}dict.type.${column.DictType}${else}${column.CsharpFieldFl}Options$end" :key="index"
|
||||
:label="item.label" :name="${value}">
|
||||
</u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
</u-form-item>
|
||||
$elseif(column.HtmlType == "inputNumber" || column.HtmlType == "customInput")
|
||||
<u-form-item label="${labelName}" prop="${columnName}">
|
||||
<u-number-box v-model="form.${columnName}"></u-number-box>
|
||||
</u-form-item>
|
||||
$elseif(column.HtmlType == "datetime" || column.HtmlType == "month")
|
||||
<u-form-item label="${labelName}" prop="${columnName}">
|
||||
<uni-datetime-picker v-model="form.${columnName}" />
|
||||
</u-form-item>
|
||||
$elseif(column.HtmlType == "textarea")
|
||||
<u-form-item label="${labelName}" prop="${columnName}">
|
||||
<u--textarea v-model="form.${columnName}" placeholder="请输入内容" count ></u--textarea>
|
||||
</u-form-item>
|
||||
$elseif(column.HtmlType == "imageUpload" || column.HtmlType == "fileUpload")
|
||||
<u-form-item label="${labelName}" prop="${columnName}">
|
||||
<uploadImage v-model="form.${columnName}"></uploadImage>
|
||||
</u-form-item>
|
||||
$elseif(column.HtmlType == "select" || column.HtmlType == "selectMulti")
|
||||
<u-form-item label="${labelName}" prop="${columnName}">
|
||||
<uni-data-select v-model="form.${columnName}" :clear="true" :localdata="${if(column.DictType != "")}dict.type.${column.DictType}${else}${column.CsharpFieldFl}Options$end"
|
||||
format="{label} - {value}"></uni-data-select>
|
||||
</u-form-item>
|
||||
$else
|
||||
<u-form-item label="${labelName}" prop="${columnName}">
|
||||
<u--input v-model${number}="form.${columnName}" placeholder="请输入${labelName}" ${column.DisabledStr}/>
|
||||
</u-form-item>
|
||||
$end
|
||||
$end
|
||||
$end
|
||||
|
||||
</u--form>
|
||||
</view>
|
||||
|
||||
<view class="form-footer">
|
||||
<view class="btn_wrap">
|
||||
<view class="btn-item">
|
||||
<u-button text="取消" shape="circle" type="info" @click="handleCancel"></u-button>
|
||||
</view>
|
||||
<view class="btn-item" v-if="opertype != 3">
|
||||
<u-button text="确定" shape="circle" type="primary" @click="submit"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
get${genTable.BusinessName},
|
||||
$if(replaceDto.ShowBtnAdd)
|
||||
add${genTable.BusinessName},
|
||||
$end
|
||||
$if(replaceDto.ShowBtnEdit)
|
||||
update${genTable.BusinessName},
|
||||
$end
|
||||
} from '@/api/${tool.FirstLowerCase(genTable.ModuleName)}/${genTable.BusinessName.ToLower()}.js'
|
||||
|
||||
export default {
|
||||
dicts: [
|
||||
$foreach(item in genTable.Columns)
|
||||
$if((item.HtmlType == "radio" || item.HtmlType.Contains("select") || item.HtmlType == "checkbox") && item.DictType != "")
|
||||
"${item.DictType}",
|
||||
$end
|
||||
$end
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
$foreach(item in genTable.Columns)
|
||||
$if(item.HtmlType == "checkbox")
|
||||
${item.CsharpFieldFl}Checked: [],
|
||||
$else
|
||||
$item.CsharpFieldFl: undefined,
|
||||
$end
|
||||
$end
|
||||
},
|
||||
rules: {
|
||||
$foreach(column in genTable.Columns)
|
||||
$if(column.IsRequired && column.IsIncrement == false)
|
||||
${column.CsharpFieldFl}: [{
|
||||
required: true,
|
||||
message: "${column.ColumnComment}不能为空",
|
||||
trigger: [ 'change', 'blur' ],
|
||||
$if(column.CsharpType == "int" || column.CsharpType == "long") type: "number"$end
|
||||
}],
|
||||
$end
|
||||
$end
|
||||
},
|
||||
opertype: 0,
|
||||
$foreach(item in genTable.Columns)
|
||||
$if((item.HtmlType == "radio" || item.HtmlType == "select" || item.HtmlType == "checkbox") && item.DictType == "")
|
||||
// ${item.ColumnComment}选项列表 格式 eg:{ label: '标签', value: '0'}
|
||||
${item.CsharpFieldFl}Options: [],
|
||||
$end
|
||||
$end
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
// 需要在onReady中设置规则
|
||||
setTimeout(() => {
|
||||
this.${refs}refs.uForm.setRules(this.rules)
|
||||
}, 300)
|
||||
},
|
||||
onLoad(e) {
|
||||
this.opertype = e.opertype
|
||||
if (e.id) {
|
||||
get${genTable.BusinessName}(e.id).then(res => {
|
||||
const {
|
||||
code,
|
||||
data
|
||||
} = res
|
||||
if (code == 200) {
|
||||
this.form = {
|
||||
...data,
|
||||
$foreach(item in genTable.Columns)
|
||||
$if(item.HtmlType == "checkbox")
|
||||
${item.CsharpFieldFl}Checked: data.${item.CsharpFieldFl} ? data.${item.CsharpFieldFl}.split(',') : [],
|
||||
$end
|
||||
$end
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.reset()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
reset(){
|
||||
this.form = {
|
||||
$foreach(item in genTable.Columns)
|
||||
$if((item.HtmlType == "checkbox"))
|
||||
${item.CsharpFieldFl}Checked: [],
|
||||
$else
|
||||
$item.CsharpFieldFl: undefined,
|
||||
$end
|
||||
$end
|
||||
};
|
||||
},
|
||||
submit() {
|
||||
this.${refs}refs.uForm.validate().then(res => {
|
||||
this.${modal}modal.msg('表单校验通过')
|
||||
|
||||
$foreach(item in genTable.Columns)
|
||||
$if(item.HtmlType == "checkbox")
|
||||
this.form.${item.CsharpFieldFl} = this.form.${item.CsharpFieldFl}Checked.toString();
|
||||
$end
|
||||
$end
|
||||
if (this.form.${replaceDto.FistLowerPk} != undefined && this.opertype == 2) {
|
||||
update${genTable.BusinessName}(this.form).then((res) => {
|
||||
this.${modal}modal.msgSuccess("修改成功")
|
||||
})
|
||||
} else {
|
||||
add${genTable.BusinessName}(this.form).then((res) => {
|
||||
this.${modal}modal.msgSuccess("新增成功")
|
||||
})
|
||||
}
|
||||
}).catch(errors => {
|
||||
this.${modal}modal.msg('表单校验失败')
|
||||
})
|
||||
},
|
||||
handleCancel() {
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "@/static/scss/page.scss";
|
||||
.btn-wrap {
|
||||
margin: 150rpx auto 0 auto;
|
||||
width: 80%
|
||||
}
|
||||
</style>
|
||||
245
DOAN.Admin.WebApi/wwwroot/CodeGenTemplate/app/form3.txt
Normal file
245
DOAN.Admin.WebApi/wwwroot/CodeGenTemplate/app/form3.txt
Normal file
@@ -0,0 +1,245 @@
|
||||
<template>
|
||||
<view class="edit-wrap">
|
||||
<view class="edit-form">
|
||||
<up-form labelPosition="left" :model="form" labelWidth="90px" :rules="rules" ref="uFormRef">
|
||||
$foreach(column in genTable.Columns)
|
||||
$set(columnName = column.CsharpFieldFl)
|
||||
$set(value = "item.value")
|
||||
$set(number = "")
|
||||
$set(labelName = column.ColumnComment)
|
||||
$if(column.CsharpType == "int" || column.CsharpType == "long")
|
||||
$set(value = "parseInt(item.value)")
|
||||
$set(number = ".number")
|
||||
$end
|
||||
|
||||
$if(column.IsPK || column.IsIncrement)
|
||||
$if(column.IsPK && column.IsIncrement == false && replaceDto.useSnowflakeId == false)
|
||||
<up-form-item label="${labelName}" prop="${columnName}">
|
||||
<up-input type="number" v-model.number="form.${columnName}" placeholder="请输入${labelName}" :disabled="opertype != 1"></up-input>
|
||||
</up-form-item>
|
||||
$else
|
||||
<up-form-item label="${labelName}" prop="${columnName}" v-if="opertype != 1">
|
||||
<up-input type="number" v-model.number="form.${columnName}" placeholder="请输入${labelName}" :disabled="true"/>
|
||||
</up-form-item>
|
||||
$end
|
||||
$else
|
||||
$if(column.HtmlType == "radio" || column.HtmlType == "selectRadio")
|
||||
<up-form-item label="${labelName}" prop="${columnName}">
|
||||
<u-radio-group v-model="form.${columnName}">
|
||||
<u-radio v-for="item in ${if(column.DictType != "")}options.${column.DictType}${else}${column.CsharpFieldFl}Options$end" :name="${value}" class="margin-right-xl" :label="item.label"></u-radio>
|
||||
</u-radio-group>
|
||||
</up-form-item>
|
||||
$elseif(column.HtmlType == "checkbox")
|
||||
<up-form-item label="${labelName}" prop="${columnName}">
|
||||
<view class="">
|
||||
<u-checkbox-group v-model="form.${columnName}Checked">
|
||||
<u-checkbox :customStyle="{marginRight: '20px', marginBottom: '15px'}" v-for="(item, index) in ${if(column.DictType != "")}options.${column.DictType}${else}${column.CsharpFieldFl}Options$end" :key="index"
|
||||
:label="item.label" :name="${value}">
|
||||
</u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
</up-form-item>
|
||||
$elseif(column.HtmlType == "inputNumber" || column.HtmlType == "customInput")
|
||||
<up-form-item label="${labelName}" prop="${columnName}">
|
||||
<u-number-box v-model="form.${columnName}"></u-number-box>
|
||||
</up-form-item>
|
||||
$elseif(column.HtmlType == "datetime" || column.HtmlType == "month")
|
||||
<up-form-item label="${labelName}" prop="${columnName}">
|
||||
<uni-datetime-picker v-model="form.${columnName}" />
|
||||
</up-form-item>
|
||||
$elseif(column.HtmlType == "textarea")
|
||||
<up-form-item label="${labelName}" prop="${columnName}">
|
||||
<u--textarea v-model="form.${columnName}" placeholder="请输入内容" count ></u--textarea>
|
||||
</up-form-item>
|
||||
$elseif(column.HtmlType == "imageUpload" || column.HtmlType == "fileUpload")
|
||||
<up-form-item label="${labelName}" prop="${columnName}">
|
||||
<uploadImage v-model="form.${columnName}"></uploadImage>
|
||||
</up-form-item>
|
||||
$elseif(column.HtmlType == "select" || column.HtmlType == "selectMulti")
|
||||
<up-form-item label="${labelName}" prop="${columnName}">
|
||||
<u-radio-group v-model="form.${columnName}">
|
||||
<u-radio v-for="item in ${if(column.DictType != "")}options.${column.DictType}${else}${column.CsharpFieldFl}Options$end" :name="${value}" class="margin-right-xl" :label="item.label"></u-radio>
|
||||
</u-radio-group>
|
||||
</up-form-item>
|
||||
$else
|
||||
<up-form-item label="${labelName}" prop="${columnName}">
|
||||
<up-input v-model${number}="form.${columnName}" placeholder="请输入${labelName}" ${column.DisabledStr}/>
|
||||
</up-form-item>
|
||||
$end
|
||||
$end
|
||||
$end
|
||||
</up-form>
|
||||
</view>
|
||||
|
||||
<view class="form-footer">
|
||||
<view class="btn_wrap">
|
||||
<view class="btn-item">
|
||||
<u-button text="取消" shape="circle" type="info" @click="handleCancel"></u-button>
|
||||
</view>
|
||||
<view class="btn-item" v-if="props.opertype != 3">
|
||||
<u-button text="确定" shape="circle" type="primary" @click="submit"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
get${genTable.BusinessName},
|
||||
$if(replaceDto.ShowBtnAdd)
|
||||
add${genTable.BusinessName},
|
||||
$end
|
||||
$if(replaceDto.ShowBtnEdit)
|
||||
update${genTable.BusinessName},
|
||||
$end
|
||||
} from '@/api/${tool.FirstLowerCase(genTable.ModuleName)}/${genTable.BusinessName.ToLower()}.js'
|
||||
|
||||
import {
|
||||
getCurrentInstance,
|
||||
reactive,
|
||||
ref,
|
||||
toRefs
|
||||
} from 'vue';
|
||||
const {
|
||||
proxy
|
||||
} = getCurrentInstance()
|
||||
|
||||
$set(index = 0)
|
||||
var dictParams = [
|
||||
$foreach(item in dicts)
|
||||
$if(item.DictType != "")
|
||||
'${item.DictType}',
|
||||
$set(index = index + 1)
|
||||
$end
|
||||
$end
|
||||
]
|
||||
|
||||
$if(index > 0)
|
||||
proxy.getDicts(dictParams).then((response) => {
|
||||
response.data.forEach((element) => {
|
||||
state.options[element.dictType] = element.list
|
||||
})
|
||||
})
|
||||
$end
|
||||
const state = reactive({
|
||||
form: {
|
||||
$foreach(item in genTable.Columns)
|
||||
$if(item.HtmlType == "checkbox")
|
||||
${item.CsharpFieldFl}Checked: [],
|
||||
$else
|
||||
$item.CsharpFieldFl: undefined,
|
||||
$end
|
||||
$end
|
||||
},
|
||||
rules: {
|
||||
$foreach(column in genTable.Columns)
|
||||
$if(column.IsRequired && column.IsIncrement == false)
|
||||
${column.CsharpFieldFl}: {
|
||||
required: true,
|
||||
message: "${column.ColumnComment}不能为空",
|
||||
trigger: [ 'change', 'blur' ],
|
||||
$if(column.CsharpType == "int" || column.CsharpType == "long") type: "number"$end
|
||||
},
|
||||
$end
|
||||
$end
|
||||
},
|
||||
options: {
|
||||
$foreach(column in dicts)
|
||||
$if(column.HtmlType == "radio" || column.HtmlType.Contains("select") || column.HtmlType == "checkbox")
|
||||
//$if(column.ColumnComment != "") ${column.ColumnComment} $else ${column.CsharpFieldFl}$end选项列表 格式 eg:{ label: '标签', value: '0'}
|
||||
$if(column.DictType != "") ${column.DictType}$else ${column.CsharpFieldFl}Options$end: [],
|
||||
$end
|
||||
$end
|
||||
},
|
||||
})
|
||||
const {
|
||||
form,
|
||||
rules,
|
||||
options
|
||||
} = toRefs(state)
|
||||
const opertype = ref(0)
|
||||
// 表单引用
|
||||
const uFormRef = ref(null)
|
||||
|
||||
setTimeout(() => {
|
||||
proxy.${refs}refs.uFormRef.setRules(state.rules)
|
||||
}, 300)
|
||||
|
||||
function reset(){
|
||||
form.value = {
|
||||
$foreach(item in genTable.Columns)
|
||||
$if((item.HtmlType == "checkbox"))
|
||||
${item.CsharpFieldFl}Checked: [],
|
||||
$else
|
||||
$item.CsharpFieldFl: undefined,
|
||||
$end
|
||||
$end
|
||||
}
|
||||
}
|
||||
|
||||
function submit() {
|
||||
uFormRef.value.validate().then(res => {
|
||||
$foreach(item in genTable.Columns)
|
||||
$if(item.HtmlType == "checkbox")
|
||||
form.value.${item.CsharpFieldFl} = form.value.${item.CsharpFieldFl}Checked.toString();
|
||||
$end
|
||||
$end
|
||||
if (form.value.${replaceDto.FistLowerPk} != undefined && props.opertype == 2) {
|
||||
update${genTable.BusinessName}(form.value).then((res) => {
|
||||
proxy.${modal}modal.msgSuccess("修改成功")
|
||||
setTimeout(() => {
|
||||
handleCancel()
|
||||
}, 1000)
|
||||
})
|
||||
} else {
|
||||
add${genTable.BusinessName}(form.value).then((res) => {
|
||||
proxy.${modal}modal.msgSuccess("新增成功")
|
||||
})
|
||||
}
|
||||
}).catch(errors => {
|
||||
proxy.${modal}modal.msg('表单校验失败')
|
||||
})
|
||||
}
|
||||
|
||||
function handleCancel() {
|
||||
uni.redirectTo({
|
||||
url: './index'
|
||||
})
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
id: String,
|
||||
opertype: String,
|
||||
})
|
||||
|
||||
if (props.id) {
|
||||
get${genTable.BusinessName}(props.id).then(res => {
|
||||
const {
|
||||
code,
|
||||
data
|
||||
} = res
|
||||
if (code == 200) {
|
||||
form.value = {
|
||||
...data,
|
||||
$foreach(item in genTable.Columns)
|
||||
$if(item.HtmlType == "checkbox")
|
||||
${item.CsharpFieldFl}Checked: data.${item.CsharpFieldFl} ? data.${item.CsharpFieldFl}.split(',') : [],
|
||||
$end
|
||||
$end
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
reset()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "@/static/scss/page.scss";
|
||||
|
||||
.btn-wrap {
|
||||
margin: 150rpx auto 0 auto;
|
||||
width: 80%
|
||||
}
|
||||
</style>
|
||||
287
DOAN.Admin.WebApi/wwwroot/CodeGenTemplate/app/vue2.txt
Normal file
287
DOAN.Admin.WebApi/wwwroot/CodeGenTemplate/app/vue2.txt
Normal file
@@ -0,0 +1,287 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="search-bar">
|
||||
$if(replaceDto.ShowBtnAdd)
|
||||
<u-button type="primary" size="small" shape="circle" icon="plus" v-if="checkPermi(['${replaceDto.PermissionPrefix}:add'])"
|
||||
@click="handleAdd" :customStyle="{'width': '80px', 'margin': '10px'}">新增</u-button>
|
||||
$end
|
||||
<u-search :disabled="true" placeholder="请输入要搜索的内容" @click="show=true"></u-search>
|
||||
</view>
|
||||
<u-line dashed></u-line>
|
||||
<view class="info-item" v-for="(item,index) in dataList" :key="index">
|
||||
$foreach(column in genTable.Columns)
|
||||
$set(labelName = column.ColumnComment)
|
||||
$set(columnName = column.CsharpFieldFl)
|
||||
$if(column.IsList == true)
|
||||
|
||||
$if(column.HtmlType == "imageUpload")
|
||||
<view class="info-line">
|
||||
<text class="label-name">${labelName}</text>
|
||||
<imagePreview :src="item.${columnName}"></imagePreview>
|
||||
</view>
|
||||
$elseif(column.HtmlType == "checkbox" || column.HtmlType == "select" || column.HtmlType == "radio")
|
||||
<view class="info-line">
|
||||
<text class="label-name">${labelName}</text>
|
||||
$if(column.HtmlType == "checkbox")
|
||||
<dict-tag :options="$if(column.DictType != "") dict.type.${column.DictType} $else ${column.CsharpFieldFl}Options$end" :value="item.${columnName} ? item.${columnName}.split(',') : []" />
|
||||
$else
|
||||
<dict-tag :options="$if(column.DictType != "") dict.type.${column.DictType} $else ${column.CsharpFieldFl}Options$end" :value="item.${columnName}" />
|
||||
$end
|
||||
</view>
|
||||
$else
|
||||
<view class="info-line">
|
||||
<text class="label-name">${labelName}</text>
|
||||
<text>{{item.${columnName}}}</text>
|
||||
</view>
|
||||
$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)"
|
||||
v-if="checkPermi(['${replaceDto.PermissionPrefix}:edit'])"></u-tag>
|
||||
</view>
|
||||
$end
|
||||
$if(replaceDto.ShowBtnDelete || replaceDto.ShowBtnMultiDel)
|
||||
<view class="tag-item">
|
||||
<u-tag text="删除" class="tag-item" plain shape="circle" type="error" icon="trash"
|
||||
v-if="checkPermi(['userinfo:delete'])" @click="handleDelete(item)"></u-tag>
|
||||
</view>
|
||||
$end
|
||||
</view>
|
||||
<u-line dashed></u-line>
|
||||
</view>
|
||||
<view class="page-footer">
|
||||
<u-empty mode="list" :marginTop="140" v-if="total == 0"></u-empty>
|
||||
<uni-pagination v-else show-icon="true" :total="total" :pageSize="queryParams.pageSize"
|
||||
:current="queryParams.pageNum" @change="getData"></uni-pagination>
|
||||
<view class="text-grey padding text-center"> 共 {{ total }}条数据 </view>
|
||||
</view>
|
||||
|
||||
<u-popup :show="show" mode="bottom" @close="show = false" @open="show = true">
|
||||
<view class="search-form">
|
||||
<view class="search-title">搜索</view>
|
||||
<u--form labelPosition="left" :model="queryParams" labelWidth="100px" ref="uForm">
|
||||
<u-form-item label="排序字段" prop="sort" borderBottom>
|
||||
<uni-data-select v-model="queryParams.sort" :clear="true" :localdata="sortOptions"
|
||||
format="{label}"></uni-data-select>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="排序方式" prop="sortType" borderBottom ref="item1">
|
||||
<u-radio-group v-model="queryParams.sortType">
|
||||
<u-radio label="升序" name="asc" :customStyle="{marginRight: '20px'}"></u-radio>
|
||||
<u-radio label="倒序" name="desc"></u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<u-gap height="30"></u-gap>
|
||||
$foreach(column in genTable.Columns)
|
||||
$set(labelName = "")
|
||||
$set(columnName = "")
|
||||
$if(column.IsQuery == true)
|
||||
$set(columnName = column.CsharpFieldFl)
|
||||
$if(column.ColumnComment != "")
|
||||
$set(labelName = column.ColumnComment)
|
||||
$else
|
||||
$set(labelName = column.CsharpFieldFl)
|
||||
$end
|
||||
|
||||
$if(column.HtmlType == "datetime")
|
||||
<u-form-item label="时间查询">
|
||||
<uni-datetime-picker :border="false" v-model="dateRange${column.CsharpField}" type="daterange" @change="${column.CsharpFieldFl}Select" />
|
||||
</u-form-item>
|
||||
$elseif(column.HtmlType == "radio" || column.HtmlType == "select")
|
||||
<u-form-item label="${labelName}" prop="${column.CsharpFieldFl}" borderBottom ref="item2">
|
||||
<view class="tag-wrap">
|
||||
<view class="tag-item">
|
||||
<u-tag text="全部" :plain="null != queryParams.${column.CsharpFieldFl}" name="" @click="queryParams.${column.CsharpFieldFl} = null">
|
||||
</u-tag>
|
||||
</view>
|
||||
<view class="tag-item" v-for="(item, index) in $if(column.DictType != "") dict.type.${column.DictType} $else ${column.CsharpFieldFl}Options$end" :key="index">
|
||||
<u-tag :text="item.label" :plain="item.value != queryParams.${column.CsharpFieldFl}" :name="item.value"
|
||||
@click="${column.CsharpFieldFl}Select(item)">
|
||||
</u-tag>
|
||||
</view>
|
||||
</view>
|
||||
</u-form-item>
|
||||
$else
|
||||
<u-form-item label="${labelName}" prop="${column.CsharpFieldFl}" borderBottom ref="item1">
|
||||
<u--input v-model="queryParams.${column.CsharpFieldFl}" border="none" placeholder="请输入${labelName}"></u--input>
|
||||
</u-form-item>
|
||||
$end
|
||||
$end
|
||||
$end
|
||||
</u--form>
|
||||
|
||||
<view class="btn-group">
|
||||
<u-button text="重置" icon="reload" :customStyle="{marginRight: '10px'}" shape="circle" type="success"
|
||||
@click="resetQuery"></u-button>
|
||||
<u-button text="搜索" icon="search" shape="circle" type="primary" @click="handleQuery"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-back-top :scroll-top="scrollTop" :bottom="180"></u-back-top>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
checkPermi
|
||||
} from '@/utils/permission.js'
|
||||
import {
|
||||
list${genTable.BusinessName},
|
||||
$if(replaceDto.ShowBtnDelete)
|
||||
del${genTable.BusinessName},
|
||||
$end
|
||||
} from '@/api/${tool.FirstLowerCase(genTable.ModuleName)}/${genTable.BusinessName.ToLower()}.js'
|
||||
|
||||
export default {
|
||||
dicts: [
|
||||
$foreach(item in genTable.Columns)
|
||||
$if((item.HtmlType == "radio" || item.HtmlType.Contains("select") || item.HtmlType == "checkbox") && item.DictType != "")
|
||||
"${item.DictType}",
|
||||
$end
|
||||
$end
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
scrollTop: 0,
|
||||
dataList: [],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
sortType: 'desc',
|
||||
sort: undefined,
|
||||
$foreach(item in genTable.Columns)
|
||||
$if(item.IsQuery == true)
|
||||
${item.CsharpFieldFl}: undefined,
|
||||
$end
|
||||
$end
|
||||
},
|
||||
total: 0,
|
||||
show: false,
|
||||
loading: false,
|
||||
$foreach(item in genTable.Columns)
|
||||
$if((item.HtmlType == "radio" || item.HtmlType == "select" || item.HtmlType == "checkbox") && item.DictType == "")
|
||||
// ${item.ColumnComment}选项列表 格式 eg:{ label: '标签', value: '0'}
|
||||
${item.CsharpFieldFl}Options: [],
|
||||
$elseif(item.HtmlType == "datetime" && item.IsQuery == true)
|
||||
//${item.ColumnComment}时间范围
|
||||
dateRange${item.CsharpField}: [],
|
||||
$end
|
||||
$end
|
||||
// 排序集合 格式 eg:{ label: '名称', value: 'userId'}
|
||||
sortOptions: [
|
||||
$foreach(column in genTable.Columns)
|
||||
$if(column.IsSort)
|
||||
{
|
||||
label: '${column.ColumnComment}',
|
||||
value: '${column.CsharpFieldFl}'
|
||||
},
|
||||
$end
|
||||
$end
|
||||
]
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
checkPermi,
|
||||
getList() {
|
||||
uni.showLoading({
|
||||
title: 'loading...'
|
||||
});
|
||||
$foreach(item in genTable.Columns)
|
||||
$if(item.HtmlType == "datetime" && item.IsQuery == true)
|
||||
this.addDateRange(this.queryParams, this.dateRange${item.CsharpField}, '${item.CsharpField}');
|
||||
$end
|
||||
$end
|
||||
list${genTable.BusinessName}(this.queryParams).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.dataList = [...this.dataList, ...res.data.result]
|
||||
this.total = res.data.totalNum;
|
||||
}
|
||||
})
|
||||
},
|
||||
$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};
|
||||
|
||||
this.${modal}modal.confirm('你确定要删除吗?').then(() => {
|
||||
return del${genTable.BusinessName}(Ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.handleQuery();
|
||||
this.${modal}modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
$end
|
||||
resetQuery() {
|
||||
this.${refs}refs.uForm.resetFields()
|
||||
$foreach(column in genTable.Columns)
|
||||
$if(column.HtmlType == "datetime" && column.IsQuery == true)
|
||||
this.dateRange${column.CsharpField} = []
|
||||
$end
|
||||
$end
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.dataList = []
|
||||
uni.startPullDownRefresh();
|
||||
this.getList()
|
||||
this.show = false
|
||||
},
|
||||
getData(e) {
|
||||
this.queryParams.pageNum = e.current
|
||||
this.getList()
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
uni.stopPullDownRefresh()
|
||||
this.handleQuery()
|
||||
},
|
||||
$foreach(column in genTable.Columns)
|
||||
$if(column.IsQuery == true)
|
||||
$if(column.HtmlType == "datetime")
|
||||
${column.CsharpFieldFl}Select(e) {
|
||||
this.${column.CsharpFieldFl} = e
|
||||
},
|
||||
$elseif(column.HtmlType == "radio" || column.HtmlType == "select")
|
||||
${column.CsharpFieldFl}Select(e) {
|
||||
this.queryParams.${column.CsharpFieldFl} = e.value
|
||||
},
|
||||
$end
|
||||
$end
|
||||
$end
|
||||
onPageScroll(e) {
|
||||
this.scrollTop = e.scrollTop;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "@/static/scss/page.scss";
|
||||
</style>
|
||||
331
DOAN.Admin.WebApi/wwwroot/CodeGenTemplate/app/vue3.txt
Normal file
331
DOAN.Admin.WebApi/wwwroot/CodeGenTemplate/app/vue3.txt
Normal file
@@ -0,0 +1,331 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="search-bar">
|
||||
总:{{total}}
|
||||
|
||||
<view class="right">
|
||||
$if(replaceDto.ShowBtnAdd)
|
||||
<view class="iconfont margin-right" v-if="checkPermi(['${replaceDto.PermissionPrefix}:add'])" @click="handleAdd">新增</view>
|
||||
$end
|
||||
<view class="iconfont icon-filter icon" @click="show = true">筛选 </view>
|
||||
</view>
|
||||
</view>
|
||||
<u-gap height="5"></u-gap>
|
||||
|
||||
<view class="info-item" v-for="(item,index) in dataList" :key="index">
|
||||
$foreach(column in genTable.Columns)
|
||||
$set(labelName = column.ColumnComment)
|
||||
$set(columnName = column.CsharpFieldFl)
|
||||
$if(column.IsList == true)
|
||||
|
||||
$if(column.HtmlType == "imageUpload")
|
||||
<view class="info-line">
|
||||
<text class="label-name">${labelName}</text>
|
||||
<imagePreview :src="item.${columnName}"></imagePreview>
|
||||
</view>
|
||||
$elseif(column.HtmlType == "checkbox" || column.HtmlType == "select" || column.HtmlType == "radio")
|
||||
<view class="info-line">
|
||||
<text class="label-name">${labelName}</text>
|
||||
$if(column.HtmlType == "checkbox")
|
||||
<dictTag :options="$if(column.DictType != "")options.${column.DictType}$else options.${column.CsharpFieldFl}Options$end" :value="item.${columnName} ? item.${columnName}.split(',') : []" />
|
||||
$else
|
||||
<dictTag :options="$if(column.DictType != "")options.${column.DictType}$else options.${column.CsharpFieldFl}Options$end" :value="item.${columnName}" />
|
||||
$end
|
||||
</view>
|
||||
$else
|
||||
<view class="info-line">
|
||||
<text class="label-name">${labelName}</text>
|
||||
<text>{{item.${columnName}}}</text>
|
||||
</view>
|
||||
$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)"
|
||||
v-if="checkPermi(['${replaceDto.PermissionPrefix}:edit'])"></u-tag>
|
||||
</view>
|
||||
$end
|
||||
$if(replaceDto.ShowBtnDelete || replaceDto.ShowBtnMultiDel)
|
||||
<view class="tag-item">
|
||||
<u-tag text="删除" class="tag-item" plain shape="circle" type="error" icon="trash"
|
||||
v-if="checkPermi(['userinfo:delete'])" @click="handleDelete(item)"></u-tag>
|
||||
</view>
|
||||
$end
|
||||
</view>
|
||||
<u-line dashed></u-line>
|
||||
</view>
|
||||
<view class="page-footer">
|
||||
<u-empty mode="list" :marginTop="140" v-if="total == 0"></u-empty>
|
||||
<uni-pagination v-else show-icon="true" :total="total" :pageSize="queryParams.pageSize"
|
||||
:current="queryParams.pageNum" @change="getData"></uni-pagination>
|
||||
<view class="text-grey padding text-center"> 共 {{ total }}条数据 </view>
|
||||
</view>
|
||||
|
||||
<u-popup :show="show" mode="bottom" @close="show = false" @open="show = true">
|
||||
<view class="search-form">
|
||||
<view class="search-title">搜索</view>
|
||||
<up-form labelPosition="left" :model="queryParams" labelWidth="100px" ref="uForm">
|
||||
<up-form-item label="排序字段" prop="sort" borderBottom>
|
||||
<uni-data-select v-model="queryParams.sort" :clear="true" :localdata="sortOptions"
|
||||
format="{label}"></uni-data-select>
|
||||
</up-form-item>
|
||||
|
||||
<up-form-item label="排序方式" prop="sortType" borderBottom ref="item1">
|
||||
<u-radio-group v-model="queryParams.sortType">
|
||||
<u-radio label="升序" name="asc" :customStyle="{marginRight: '20px'}"></u-radio>
|
||||
<u-radio label="倒序" name="desc"></u-radio>
|
||||
</u-radio-group>
|
||||
</up-form-item>
|
||||
<u-gap height="30"></u-gap>
|
||||
$foreach(column in genTable.Columns)
|
||||
$set(labelName = "")
|
||||
$set(columnName = "")
|
||||
$if(column.IsQuery == true)
|
||||
$set(columnName = column.CsharpFieldFl)
|
||||
$if(column.ColumnComment != "")
|
||||
$set(labelName = column.ColumnComment)
|
||||
$else
|
||||
$set(labelName = column.CsharpFieldFl)
|
||||
$end
|
||||
|
||||
$if(column.HtmlType == "datetime")
|
||||
<up-form-item label="时间查询">
|
||||
<uni-datetime-picker :border="false" v-model="dateRange${column.CsharpField}" type="daterange" />
|
||||
</up-form-item>
|
||||
$elseif(column.HtmlType == "radio" || column.HtmlType == "select")
|
||||
<up-form-item label="${labelName}" prop="${column.CsharpFieldFl}" borderBottom ref="item2">
|
||||
<view class="tag-wrap">
|
||||
<view class="tag-item">
|
||||
<u-tag text="全部" :plain="null != queryParams.${column.CsharpFieldFl}" name="" @click="queryParams.${column.CsharpFieldFl} = null">
|
||||
</u-tag>
|
||||
</view>
|
||||
<view class="tag-item" v-for="(item, index) in $if(column.DictType != "")options.${column.DictType} $else options.${column.CsharpFieldFl}Options$end" :key="index">
|
||||
<u-tag :text="item.label" :plain="item.value != queryParams.${column.CsharpFieldFl}" :name="item.value"
|
||||
@click="${column.CsharpFieldFl}Select(item)">
|
||||
</u-tag>
|
||||
</view>
|
||||
</view>
|
||||
</up-form-item>
|
||||
$else
|
||||
<up-form-item label="${labelName}" prop="${column.CsharpFieldFl}" borderBottom ref="item1">
|
||||
<u--input v-model="queryParams.${column.CsharpFieldFl}" border="none" placeholder="请输入${labelName}"></u--input>
|
||||
</up-form-item>
|
||||
$end
|
||||
$end
|
||||
$end
|
||||
</up-form>
|
||||
|
||||
<view class="btn-group">
|
||||
<u-button text="重置" icon="reload" :customStyle="{marginRight: '10px'}" shape="circle" type="success"
|
||||
@click="resetQuery"></u-button>
|
||||
<u-button text="搜索" icon="search" shape="circle" type="primary" @click="handleQuery"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-back-top :scroll-top="scrollTop" :bottom="180"></u-back-top>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
checkPermi
|
||||
} from '@/utils/permission.js'
|
||||
import {
|
||||
list${genTable.BusinessName},
|
||||
$if(replaceDto.ShowBtnDelete)
|
||||
del${genTable.BusinessName},
|
||||
$end
|
||||
} from '@/api/${tool.FirstLowerCase(genTable.ModuleName)}/${genTable.BusinessName.ToLower()}.js'
|
||||
|
||||
import {
|
||||
getCurrentInstance,
|
||||
reactive,
|
||||
ref,
|
||||
toRefs
|
||||
} from 'vue';
|
||||
const {
|
||||
proxy
|
||||
} = getCurrentInstance()
|
||||
|
||||
import {
|
||||
onPullDownRefresh,
|
||||
onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
|
||||
const queryParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
sort: '${genTable.Options.SortField}',
|
||||
sortType: '${genTable.Options.SortType}',
|
||||
$foreach(item in genTable.Columns)
|
||||
$if(item.IsQuery == true)
|
||||
${item.CsharpFieldFl}: undefined,
|
||||
$end
|
||||
$end
|
||||
})
|
||||
|
||||
$foreach(item in genTable.Columns)
|
||||
$if((item.HtmlType == "datetime" || item.HtmlType == "datePicker") && item.IsQuery == true)
|
||||
// ${item.ColumnComment}时间范围
|
||||
const dateRange${item.CsharpField} = ref([])
|
||||
$end
|
||||
$end
|
||||
|
||||
$set(index = 0)
|
||||
var dictParams = [
|
||||
$foreach(item in dicts)
|
||||
$if(item.DictType != "")
|
||||
'${item.DictType}',
|
||||
$set(index = index + 1)
|
||||
$end
|
||||
$end
|
||||
]
|
||||
|
||||
$if(index > 0)
|
||||
proxy.getDicts(dictParams).then((response) => {
|
||||
response.data.forEach((element) => {
|
||||
state.options[element.dictType] = element.list
|
||||
})
|
||||
})
|
||||
$end
|
||||
const scrollTop = ref(0)
|
||||
const state = reactive({
|
||||
dataList: [],
|
||||
total: 0,
|
||||
show: false,
|
||||
loading: false,
|
||||
options: {
|
||||
$foreach(column in dicts)
|
||||
$if(column.HtmlType == "radio" || column.HtmlType.Contains("select") || column.HtmlType == "checkbox")
|
||||
//$if(column.ColumnComment != "") ${column.ColumnComment} $else ${column.CsharpFieldFl}$end选项列表 格式 eg:{ label: '标签', value: '0'}
|
||||
$if(column.DictType != "") ${column.DictType}$else ${column.CsharpFieldFl}Options$end: [],
|
||||
$end
|
||||
$end
|
||||
},
|
||||
// 排序集合 格式 eg:{ label: '名称', value: 'userId'}
|
||||
sortOptions: [
|
||||
$foreach(column in genTable.Columns)
|
||||
$if(column.IsSort)
|
||||
{
|
||||
label: '${column.ColumnComment}',
|
||||
value: '${column.CsharpFieldFl}'
|
||||
},
|
||||
$end
|
||||
$end
|
||||
]
|
||||
})
|
||||
|
||||
const {
|
||||
options,
|
||||
dataList,
|
||||
total,
|
||||
show,
|
||||
loading,
|
||||
sortOptions
|
||||
} = toRefs(state)
|
||||
|
||||
function getList() {
|
||||
uni.showLoading({
|
||||
title: 'loading...'
|
||||
})
|
||||
state.loading = true
|
||||
$foreach(item in genTable.Columns)
|
||||
$if((item.HtmlType == "datetime" || item.HtmlType == "datePicker") && item.IsQuery == true)
|
||||
proxy.addDateRange(queryParams, dateRange${item.CsharpField}.value, '${item.CsharpField}');
|
||||
$end
|
||||
$end
|
||||
list${genTable.BusinessName}(queryParams).then(res => {
|
||||
if (res.code == 200) {
|
||||
dataList.value = [...dataList.value, ...res.data.result]
|
||||
total.value = res.data.totalNum;
|
||||
state.loaing = false
|
||||
}
|
||||
}).finally(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
$if(replaceDto.ShowBtnAdd)
|
||||
function handleAdd() {
|
||||
proxy.${tab}tab.navigateTo('./edit?opertype=1')
|
||||
}
|
||||
$end
|
||||
$if(replaceDto.ShowBtnEdit)
|
||||
function handleEdit(e) {
|
||||
proxy.${tab}tab.navigateTo('./edit?opertype=2&${replaceDto.FistLowerPk}=' + e.id)
|
||||
}
|
||||
|
||||
$end
|
||||
$if(replaceDto.ShowBtnView)
|
||||
function handleView(e) {
|
||||
proxy.${tab}tab.navigateTo('./edit?opertype=3&${replaceDto.FistLowerPk}=' + e.id)
|
||||
}
|
||||
|
||||
$end
|
||||
$if(replaceDto.ShowBtnDelete || replaceDto.ShowBtnMultiDel)
|
||||
function handleDelete(row) {
|
||||
const Ids = row.${replaceDto.FistLowerPk};
|
||||
|
||||
proxy.${modal}modal.confirm('你确定要删除吗?').then(() => {
|
||||
return del${genTable.BusinessName}(Ids);
|
||||
})
|
||||
.then(() => {
|
||||
handleQuery()
|
||||
proxy.${modal}modal.msgSuccess("删除成功");
|
||||
})
|
||||
}
|
||||
$end
|
||||
function resetQuery() {
|
||||
proxy.${refs}refs.uForm.resetFields()
|
||||
$foreach(column in genTable.Columns)
|
||||
$if(column.HtmlType == "datetime" && column.IsQuery == true)
|
||||
dateRange${column.CsharpField}.value = []
|
||||
$end
|
||||
$end
|
||||
}
|
||||
|
||||
function handleQuery(refresh) {
|
||||
queryParams.pageNum = 1;
|
||||
dataList.value = []
|
||||
state.show = false
|
||||
if (refresh) {
|
||||
uni.startPullDownRefresh();
|
||||
}
|
||||
|
||||
getList()
|
||||
}
|
||||
|
||||
function getData(e) {
|
||||
queryParams.pageNum = e.current
|
||||
getList()
|
||||
}
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
uni.stopPullDownRefresh()
|
||||
handleQuery(true)
|
||||
})
|
||||
$foreach(column in genTable.Columns)
|
||||
$if(column.IsQuery == true)
|
||||
$if(column.HtmlType == "radio" || column.HtmlType == "select")
|
||||
function ${column.CsharpFieldFl}Select(e) {
|
||||
queryParams.${column.CsharpFieldFl} = e.value
|
||||
}
|
||||
$end
|
||||
$end
|
||||
$end
|
||||
function onPageScroll(e) {
|
||||
scrollTop.value = e.scrollTop;
|
||||
}
|
||||
getList()
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "@/static/scss/page.scss";
|
||||
</style>
|
||||
Reference in New Issue
Block a user