master
lzq 2025-12-19 17:54:34 +08:00
parent 56d68ac723
commit 5af47b43f1
5 changed files with 1267 additions and 1090 deletions

View File

@ -44,6 +44,7 @@ var dTsName = dc + ".d.ts";
import ${ucc}Api from '@/pages/${moduleName}<%if(subModuleName != null){%>/${subModuleName}<%}%>/${apiTsName}'
import Strings from '@/common/utils/strings.ts'
import FormUtil from '@/common/utils/formUtil.ts'
import Utils from '@/common/utils'
import {
ElMessage,
type FormInstance,
@ -57,7 +58,7 @@ const status = ref<'add' | 'view' | 'modify'>('add')
const ${lcc}FormIns = useTemplateRef<FormInstance>('${lcc}Form')
const formData = ref<${ucc}Types.Search${ucc}Result>({})
const formData = Utils.resetAble(reactive<${ucc}Types.Search${ucc}Result>({}))
const rules = reactive<FormRules<${ucc}Types.Search${ucc}Result>>({
<%
for(column in table.columns) {
@ -67,14 +68,14 @@ ${toCamelCase(column.name)}: [{ required: true, message: '请填写${column.comm
})
function dialogCloseHandler() {
formData.value = {}
formData.$reset()
}
function submitHandler() {
if (status.value === 'view') return
submiting.value = true
if (formData.value.id != null) {
FormUtil.submit(${lcc}FormIns, () => ${ucc}Api.modify(formData.value))
if (formData.id != null) {
FormUtil.submit(${lcc}FormIns, () => ${ucc}Api.modify(formData))
.then(() => {
ElMessage.success('修改成功')
emits('editSucc')
@ -84,7 +85,7 @@ function submitHandler() {
submiting.value = false
})
} else {
FormUtil.submit(${lcc}FormIns, () => ${ucc}Api.add(formData.value))
FormUtil.submit(${lcc}FormIns, () => ${ucc}Api.add(formData))
.then(() => {
ElMessage.success('添加成功')
emits('editSucc')
@ -103,11 +104,11 @@ defineExpose({
status.value = 'modify'
${ucc}Api.detail(data.id!)
.then(res => {
formData.value = res.data
formData.$reset(res.data)
})
} else {
status.value = 'add'
formData.value = data
formData.$reset(data)
}
}
})

View File

@ -68,11 +68,14 @@ var dTsName = dc + ".d.ts";
</ElTableColumn>
</ElTable>
<ElPagination
class="pagination"
layout="prev, pager, next"
:page-size="pagination.size"
:total="pagination.total"
@change="pageChangeHandler"/>
layout="->, sizes, total, prev, pager, next"
v-model:current-page="searchForm.current"
v-model:page-size="searchForm.size"
:total="totalCount"
:page-sizes="[10, 20, 50, 100, 500]"
:hide-on-single-page="false"
:teleported="false"
@change="paging"/>
<${ucc}Form ref="${lcc}Form" @edit-succ="paging"/>
</Page>
</template>
@ -82,26 +85,19 @@ import ${ucc}Api from '@/pages/${moduleName}<%if(subModuleName != null){%>/${sub
import ${ucc}Form from '@/pages/${moduleName}<%if(subModuleName != null){%>/${subModuleName}<%}%>/${formVueName}'
import Page from '@/components/page/Page.vue'
import { elIcons } from '@/common/element/element.ts'
import Utils from '@/common/utils'
const tableData = ref<${ucc}Types.Search${ucc}Result[]>([])
const searchForm = ref<${ucc}Types.Search${ucc}Param>({
const totalCount = ref(0)
const tableData = Utils.resetAble(reactive<${ucc}Types.Search${ucc}Result[]>([]))
const searchForm = Utils.resetAble(reactive<${ucc}Types.Search${ucc}Param>({
current: 1,
size: 20,
})
}))
const searching = ref(false)
const deling = ref(false)
const showSearchForm = ref(true)
const ${lcc}FormIns = useTemplateRef<InstanceType<typeof ${ucc}Form>>('${lcc}Form')
const pagination = reactive<G.Pagination>({
total: 0,
current: 1,
size: 1,
})
function pageChangeHandler(currentPage: number, pageSize: number) {
searchForm.value.current = currentPage
searchForm.value.size = pageSize
paging()
}
function showDialog(data?: ${ucc}Types.Search${ucc}Result) {
${lcc}FormIns.value?.open(data)
}
@ -127,18 +123,16 @@ function addHandler() {
}
function reset() {
searchForm.value = {
current: 1,
size: 20,
}
searchForm.$reset()
paging()
}
function paging() {
searching.value = true
${ucc}Api.paging(searchForm.value)
${ucc}Api.paging(searchForm)
.then(res => {
tableData.value = res.data?.records ?? []
totalCount.value = res.data?.total ?? 0
tableData.$reset(res.data?.records ?? [])
})
.finally(() => {
searching.value = false
@ -153,6 +147,7 @@ onMounted(() => {
<style lang="stylus" scoped>
.table-list {
flex 1;
margin 0 0 20px 0
width 100%
:deep(.table-header) {
@ -201,9 +196,4 @@ onMounted(() => {
justify-content space-between
margin 0 0 20px 0
}
.pagination {
justify-content: end;
margin: 8px;
}
</style>

View File

@ -24,6 +24,9 @@ public class SearchCustomerParam {
private String keywords;
private Boolean manager;
/**
* YueJie-->YuE-->XianFu-->
*/

View File

@ -44,7 +44,7 @@
FROM cst_customer a
INNER JOIN sys_user b ON b.id = a.user_id AND b.deleted = 0
INNER JOIN sys_user_account c ON c.user_id = b.id AND b.deleted = 0
LEFT JOIN cst_org d ON c.id = a.org_id AND d.deleted = 0
LEFT JOIN cst_org d ON d.id = a.org_id AND d.deleted = 0
</sql>
<resultMap id="searchCustomerResultMap" autoMapping="true" type="com.njzscloud.dispose.cst.customer.pojo.result.SearchCustomerResult">

File diff suppressed because it is too large Load Diff