编码配置
parent
b59325da55
commit
c9d02287e4
|
|
@ -1,15 +1,13 @@
|
||||||
<template>
|
<template>
|
||||||
<FormPage
|
<ATablePage
|
||||||
ref="formPage"
|
ref="tablePage"
|
||||||
:action-column="actionColumn"
|
v-bind="tablePageProps">
|
||||||
:left-tools="leftTools"
|
<template #simpleFormItem="formData">
|
||||||
:paging="searchHandler">
|
<ElFormItem>
|
||||||
<template #searchFormItem="{searchForm}">
|
<ElInput v-model="formData.snname" clearable placeholder="请输入规则名称"/>
|
||||||
<ElFormItem label="规则名称">
|
|
||||||
<ElInput v-model="searchForm.snname" clearable placeholder="请输入规则名称"/>
|
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
<ElFormItem label="规则代码">
|
<ElFormItem>
|
||||||
<ElInput v-model="searchForm.sncode" clearable placeholder="请输入规则代码"/>
|
<ElInput v-model="formData.sncode" clearable placeholder="请输入规则代码"/>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
</template>
|
</template>
|
||||||
<template #columns>
|
<template #columns>
|
||||||
|
|
@ -27,29 +25,59 @@
|
||||||
<ElTableColumn label="备注" prop="memo" width="200"/>
|
<ElTableColumn label="备注" prop="memo" width="200"/>
|
||||||
</template>
|
</template>
|
||||||
<SnConfigForm ref="snConfigForm" @close="research"/>
|
<SnConfigForm ref="snConfigForm" @close="research"/>
|
||||||
</FormPage>
|
</ATablePage>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import SnConfigApi from '@/pages/sys/sn-config/sn-config-api.ts'
|
import SnConfigApi from '@/pages/sys/sn-config/sn-config-api.ts'
|
||||||
import SnConfigForm from '@/pages/sys/sn-config/SnConfigForm.vue'
|
import SnConfigForm from '@/pages/sys/sn-config/SnConfigForm.vue'
|
||||||
import Strings from '@/common/utils/strings.ts'
|
import Strings from '@/common/utils/strings.ts'
|
||||||
import FormPage from '@/components/page/FormPage.vue'
|
import ATablePage, {
|
||||||
import type {
|
type ATablePageInstance,
|
||||||
ActionColumnType,
|
buildTablePageProps,
|
||||||
ToolType,
|
} from '@/components/a-page/a-table-page/ATablePage.tsx'
|
||||||
} from '@/components/page/a-page-type.ts'
|
import { descConfig } from '@/pages/sys/sn-config/sn-config-util.ts'
|
||||||
import type { ComponentExposed } from 'vue-component-type-helpers'
|
|
||||||
|
|
||||||
const snConfigFormIns = useTemplateRef<InstanceType<typeof SnConfigForm>>('snConfigForm')
|
const snConfigFormIns = useTemplateRef<InstanceType<typeof SnConfigForm>>('snConfigForm')
|
||||||
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
|
const tablePageIns = useTemplateRef<ATablePageInstance>('tablePage')
|
||||||
|
|
||||||
|
function research() {
|
||||||
function searchHandler(param: SnConfigTypes.SearchSnConfigParam) {
|
tablePageIns.value?.doSearch()
|
||||||
return SnConfigApi.paging(param)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const actionColumn = reactive<ActionColumnType<SnConfigTypes.SnConfigDetail>>({
|
const tablePageProps = buildTablePageProps<SnConfigTypes.SearchSnConfigParam, SnConfigTypes.SnConfigDetail>({
|
||||||
|
pageLayout: {
|
||||||
|
enableHighForm: false,
|
||||||
|
},
|
||||||
|
searchForm: {
|
||||||
|
paging(param) {
|
||||||
|
return SnConfigApi.paging(param)
|
||||||
|
.then((res) => {
|
||||||
|
res.data.records = res.data.records.map((it) => ({
|
||||||
|
key: it.id,
|
||||||
|
...it,
|
||||||
|
configDesc: descConfig(it.config).join('\n'),
|
||||||
|
}))
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
simpleForm: {
|
||||||
|
colCount: 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
toolBar: {
|
||||||
|
leftTools: [
|
||||||
|
{
|
||||||
|
icon: 'Plus',
|
||||||
|
label: '新建',
|
||||||
|
action() {
|
||||||
|
snConfigFormIns.value?.open()
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
table: {
|
||||||
|
actionColumn: {
|
||||||
tableActions: [
|
tableActions: [
|
||||||
{
|
{
|
||||||
tooltip: '编辑',
|
tooltip: '编辑',
|
||||||
|
|
@ -76,20 +104,9 @@ const actionColumn = reactive<ActionColumnType<SnConfigTypes.SnConfigDetail>>({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
const leftTools: ToolType[] = [
|
|
||||||
{
|
|
||||||
icon: 'Plus',
|
|
||||||
label: '新建',
|
|
||||||
action() {
|
|
||||||
snConfigFormIns.value?.open()
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
function research() {
|
|
||||||
formPageIns.value?.doSearch()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import {
|
||||||
} from '@/pages/sys/sn-config/contant.ts'
|
} from '@/pages/sys/sn-config/contant.ts'
|
||||||
import Colls from '@/common/utils/colls.ts'
|
import Colls from '@/common/utils/colls.ts'
|
||||||
import { elIcons } from '@/common/element/element.ts'
|
import { elIcons } from '@/common/element/element.ts'
|
||||||
|
import ADialog from '@/components/a-dialog/ADialog.vue'
|
||||||
|
|
||||||
defineOptions({name: 'SnConfigForm'})
|
defineOptions({name: 'SnConfigForm'})
|
||||||
const emits = defineEmits([ 'close' ])
|
const emits = defineEmits([ 'close' ])
|
||||||
|
|
@ -203,9 +204,9 @@ defineExpose({
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ElDialog v-model="visible"
|
<ADialog v-model:show="visible"
|
||||||
:title="Strings.isBlank(snConfig.id) ? '新增编码配置' : '修改编码配置'" class="config-dialog" footer-class="panel-footer" width="950px"
|
:title="Strings.isBlank(snConfig.id) ? '新增编码配置' : '修改编码配置'" class="config-dialog" footer-class="panel-footer" width="950px"
|
||||||
@close="onCloseHandler">
|
:closed="onCloseHandler">
|
||||||
<div class="config-panel">
|
<div class="config-panel">
|
||||||
<div class="config-title">
|
<div class="config-title">
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -351,7 +352,7 @@ defineExpose({
|
||||||
</template>
|
</template>
|
||||||
</ElDropdown>
|
</ElDropdown>
|
||||||
</template>
|
</template>
|
||||||
</ElDialog>
|
</ADialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue