123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811 |
- ##计算查询条件的折叠按钮
- #set( $queryCount = 0)
- ##计算列宽度
- #set( $listColumnCount = 0)
- #set( $columnWidth = 0)
- #set( $operationColumnWidth = 0)
- #foreach ($column in $columns)
- #if($column.isList == '1')
- #set( $listColumnCount = $listColumnCount + 1)
- #end
- #end
- ##计算是否可以整除
- #if($listColumnCount == 1)
- #set( $columnWidth = 80)
- #set( $operationColumnWidth = 20)
- #elseif ($listColumnCount == 2)
- #set( $columnWidth = 40)
- #set( $operationColumnWidth = 20)
- #elseif ($listColumnCount == 3)
- #set( $columnWidth = 30)
- #set( $operationColumnWidth = 10)
- #elseif ($listColumnCount == 4)
- #set( $columnWidth = 22.5)
- #set( $operationColumnWidth = 10)
- #elseif ($listColumnCount == 5)
- #set( $columnWidth = 18)
- #set( $operationColumnWidth = 10)
- #elseif ($listColumnCount == 6)
- #set( $columnWidth = 15)
- #set( $operationColumnWidth = 10)
- #elseif ($listColumnCount == 7)
- #set( $columnWidth = 12.8)
- #set( $operationColumnWidth = 10)
- #elseif ($listColumnCount == 8)
- #set( $columnWidth = 11.25)
- #set( $operationColumnWidth = 10)
- #elseif ($listColumnCount == 9)
- #set( $columnWidth = 10)
- #set( $operationColumnWidth = 10)
- #elseif ($listColumnCount == 10)
- #set( $columnWidth = 9)
- #set( $operationColumnWidth = 10)
- #elseif ($listColumnCount == 11)
- #set( $columnWidth = 8)
- #set( $operationColumnWidth = 12)
- #elseif ($listColumnCount == 12)
- #set( $columnWidth = 8)
- #set( $operationColumnWidth = 12)
- #elseif ($listColumnCount == 13)
- #set( $columnWidth = 7)
- #set( $operationColumnWidth = 9)
- #elseif ($listColumnCount == 14)
- #set( $columnWidth = 6)
- #set( $operationColumnWidth = 16)
- #elseif ($listColumnCount == 15)
- #set( $columnWidth = 6)
- #set( $operationColumnWidth = 10)
- #else
- #set( $columnWidth = 5)
- #set( $operationColumnWidth = 10)
- #end
- #set( $querySize = $!{queryColumns.size()})
- ##判断是否包含用户选择框的标志位
- #set( $hasUser = 0)
- ##判断是否包含用户选择框的标志位
- #set( $hasDept = 0)
- #foreach($column in $columns)
- #if($column.htmlType == )
- #set( $hasUser = $hasUser + 1)
- #elseif($column.htmlType == )
- #set( $hasDept = $hasDept + 1)
- #end
- #end
- <template>
- <div>
- #if($querySize > 0)
- <a-card :bordered= style=>
- <!-- 条件搜索 -->
- <div class=>
- <a-form :labelCol= :wrapperCol= ref=>
- <a-row :gutter=>
- #foreach($column in $queryColumns)
- #set($dictType=$column.dictType)
- #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
- #set($parentheseIndex=$column.columnComment.indexOf())
- #if($parentheseIndex != -1)
- #set($comment=$column.columnComment.substring(0, $parentheseIndex))
- #else
- #set($comment=$column.columnComment)
- #end
- #if($column.htmlType == || $column.htmlType == )
- #set( $queryCount = $queryCount + 1)
- <a-col :span= #if($queryCount > 3 )v-if=#end>
- <a-form-item label=>
- <a-input v-model= placeholder= allow-clear @keyup.enter.native=/>
- </a-form-item>
- </a-col>
- #elseif(($column.htmlType == ))
- #set( $queryCount = $queryCount + 1)
- <a-col :span= #if($queryCount > 3 )v-if=#end>
- <a-form-item label=>
- <a-input-number v-model= :min= style=/>
- </a-form-item>
- </a-col>
- #elseif(($column.htmlType == ))
- #if($column.queryType == 'GTE' || $column.queryType == 'GT' || $column.queryType == 'EQ')
- #set( $queryCount = $queryCount + 1)
- <a-col :span= #if($queryCount > 3 )v-if=#end>
- <a-form-item label=>
- <a-date-picker
- v-model=
- valueFormat=
- :show-today=
- placeholder=
- style=
- />
- </a-form-item>
- </a-col>
- #elseif($column.queryType == 'LTE' || $column.queryType == 'LT')
- #set( $queryCount = $queryCount + 1)
- <a-col :span= #if($queryCount > 3 )v-if=#end>
- <a-form-item label=>
- <a-date-picker
- v-model=
- valueFormat=
- :show-today=
- placeholder=
- style=
- />
- </a-form-item>
- </a-col>
- #elseif($column.queryType == 'BETWEEN')
- #set( $queryCount = $queryCount + 1)
- <a-col :span= #if($queryCount > 3 )v-if=#end>
- <a-form-item label=>
- <a-range-picker style= v-model= valueFormat= format= allow-clear />
- </a-form-item>
- </a-col>
- #end
- #elseif(($column.htmlType == ))
- #if($column.queryType == 'GTE' || $column.queryType == 'GT' || $column.queryType == 'EQ' )
- #set( $queryCount = $queryCount + 1)
- <a-col :span= #if($queryCount > 3 )v-if=#end>
- <a-form-item label=>
- <a-date-picker
- v-model=
- valueFormat=
- :show-today=
- placeholder=
- style=
- />
- </a-form-item>
- </a-col>
- #elseif($column.queryType == 'LTE' || $column.queryType == 'LT')
- #set( $queryCount = $queryCount + 1)
- <a-col :span= #if($queryCount > 3 )v-if=#end>
- <a-form-item label=>
- <a-date-picker
- v-model=
- valueFormat=
- :show-today=
- :show-today=
- placeholder=
- style=
- />
- </a-form-item>
- </a-col>
- #elseif($column.queryType == 'BETWEEN')
- #set( $queryCount = $queryCount + 1)
- <a-col :span= #if($queryCount > 3 )v-if=#end>
- <a-form-item label=>
- <a-range-picker style= v-model= valueFormat= format= allow-clear />
- </a-form-item>
- </a-col>
- #end
- #elseif(($column.htmlType == ) && != $dictType)
- #set( $queryCount = $queryCount + 1)
- <a-col :span= #if($queryCount > 3 )v-if=#end>
- <a-form-item label= prop=>
- <a-select placeholder= v-model= style= allow-clear>
- <a-select-option v-for= :key= :value=>{{ d.dictLabel }}</a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- #elseif(($column.htmlType == ) && != $dictType)
- #set( $queryCount = $queryCount + 1)
- <a-col :span= #if($queryCount > 3 )v-if=#end>
- <a-form-item label= prop=>
- <a-select placeholder= v-model= style= mode= allow-clear>
- <a-select-option v-for= :key= :value=>{{ dict.dictLabel }}</a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- #elseif(($column.htmlType == ))
- #set( $queryCount = $queryCount + 1)
- <a-col :span= #if($queryCount > 3 )v-if=#end>
- <a-form-model-item label= prop=>
- <select-user
- v-model=
- select-model=
- />
- </a-form-model-item>
- </a-col>
- #elseif(($column.htmlType == ))
- #set( $queryCount = $queryCount + 1)
- <a-col :span= #if($queryCount > 3 )v-if=#end>
- <a-form-model-item label= prop=>
- <select-dept
- v-model=
- select-model=
- select-scope=
- />
- </a-form-model-item>
- </a-col>
- #elseif(($column.htmlType == ) && != $dictType)
- #set( $queryCount = $queryCount + 1)
- <a-col :span= #if($queryCount > 3 )v-if=#end>
- <a-form-item label= prop=>
- <a-radio-group v-model= button-style=>
- <a-radio-button
- v-for=
- :key=
- :value=
- >
- {{ dict.dictLabel }}
- </a-radio-button>
- </a-radio-group>
- </a-form-item>
- </a-col>
- #elseif(($column.htmlType == ) && != $dictType)
- #set( $queryCount = $queryCount + 1)
- <a-col :span= #if($queryCount > 3 )v-if=#end>
- <a-form-item label= prop=>
- <a-radio-group v-model=>
- <a-radio
- v-for=
- :key=
- :value=
- >
- {{ dict.dictLabel }}
- </a-radio>
- </a-radio-group>
- </a-form-item>
- </a-col>
- #end
- #end
- #if($queryColumns.size() > 0)
- #if($queryColumns.size() <= 3)
- <a-col>
- <span class= style=>
- <a-button type= @click=><a-icon type= />查询</a-button>
- <a-button style= @click=><a-icon type= />重置</a-button>
- </span>
- </a-col>
- #elseif($queryColumns.size() > 3)
- <a-col>
- <span class= style=>
- <a-button type= @click=><a-icon type= />查询</a-button>
- <a-button style= @click=><a-icon type= />重置</a-button>
- <a @click= style=>
- {{ advanced ? '收起' : '展开' }}
- <a-icon :type=/>
- </a>
- </span>
- </a-col>
- #end
- #end
- </a-row>
- </a-form>
- </div>
- </a-card>
- #end
- <a-card :bordered= #if(${isSub} != 'true')class=#end>
- <!-- 增加 -->
- <${tableNameUnderline}-add-form
- v-if=
- ref=
- #foreach ($column in $columns)
- #if(${column.dictType} != '')
- :${column.javaField}Options=
- #end
- #end
- #if(${isSub} == 'true')
- :${subTableFkNameUnCap}=
- #end
- @ok=
- @close=
- />
- <!-- 编辑 -->
- <${tableNameUnderline}-edit-form
- v-if=
- ref=
- #foreach ($column in $columns)
- #if(${column.dictType} != '')
- :${column.javaField}Options=
- #end
- #end
- #if(${isSub} == 'true')
- :${subTableFkNameUnCap}=
- #end
- @ok=
- @close=
- />
- #if(${isSub} == 'true')
- <div class=>
- <a-button type= @click= v-hasPermi=>
- <a-icon type= />新增
- </a-button>
- <a-button type= v-if= :disabled= @click= v-hasPermi=>
- <a-icon type= />删除
- </a-button>
- <a-button type= @click= v-hasPermi=>
- <a-icon type= />导出
- </a-button>
- <a-tooltip title=>
- <a-icon @click= class= :type= />
- </a-tooltip>
- </div>
- <a-table
- :loading=
- rowKey=
- size=
- @change=
- @refresh=
- :columns=
- :data-source=
- :row-selection=
- :pagination=
- >
- #else
- <advance-table
- title=
- :pagination=
- tableKey=
- @change=
- rowKey=
- size=
- @refresh=
- :columns=
- :data-source=
- :loading=
- :format-conditions=
- :row-selection=
- >
- #end
- #if(${isSub} != 'true')
- <div class= slot=>
- <a-button type= @click= v-hasPermi=>
- <a-icon type= />新增
- </a-button>
- #if($hasCopyRecordOption)
- <a-button type= v-if= :disabled= @click= v-hasPermi=>
- <a-icon type= />复制
- </a-button>
- #end
- <a-button type= v-if= :disabled= @click= v-hasPermi=>
- <a-icon type= />删除
- </a-button>
- <a-button type= @click= v-hasPermi=>
- <a-icon type= />导出
- </a-button>
- </div>
- #end
- #if(${hasSubParam} == 'true')
- <span
- slot=
- slot-scope=
- >
- <${subComponentName}-index
- ref=
- title=
- :${subTableFkNameUnCap}=
- />
- </span>
- #end
- ##页面通用代码转换
- #foreach ($column in $columns)
- #if(${column.dictType} != '' && ( ${column.javaField} != 'status' || (${column.javaField} == 'status' && ${hasDisableEnable} == 'false')))
- #if(${column.javaField} == 'status' && ${hasDisableEnable} == 'false')
- <span slot=#if(${isSub} == 'true') slot-scope=#else slot-scope=#end>
- <a-badge :status= :text= />
- </span>
- #else
- <span slot=#if(${isSub} == 'true') slot-scope=#else slot-scope=#end>
- {{ ${column.javaField}Format(record) }}
- </span>
- #end
- #end
- #if(${column.javaField} == 'status' && ${hasDisableEnable} == 'true')
- <span slot= slot-scope=>
- <a-popconfirm
- ok-text=
- cancel-text=
- @confirm=
- @cancel=
- >
- <span slot=>确认更新${column.columnComment}为<b>{{ record.status === '1' ? '启用' : '停用' }}</b>吗?</span>
- <a-switch checked-children= un-checked-children= :checked= />
- </a-popconfirm>
- </span>
- #end
- #end
- <span slot=#if(${isSub} == 'true') slot-scope=#else slot-scope=#end>
- <a @click= v-hasPermi=>
- 修改
- </a>
- <a-divider type= v-hasPermi=/>
- <a @click= v-hasPermi=>
- 删除
- </a>
- </span>
- #if(${isSub} == 'true')
- </a-table>
- #else
- </advance-table>
- #end
- </a-card>
- </div>
- </template>
- <script>
- import { list${BusinessName}, del${BusinessName}, export${BusinessName}#if($dictColumns.size() > 0), getInitData#end#if(${hasDisableEnable} == 'true'), updateStatus#end } from '@/api/${moduleName}/${businessName}'
- import AdvanceTable from '@/components/pt/table/AdvanceTable'
- import ${BusinessName}AddForm from '@/views/${moduleName}/${businessNameLowerCase}/modules/${BusinessName}AddForm'
- import ${BusinessName}EditForm from '@/views/${moduleName}/${businessNameLowerCase}/modules/${BusinessName}EditForm'
- #if($hasUser > 0)
- import SelectUser from '@/components/pt/selectUser/SelectUser'
- #end
- #if($hasDept > 0)
- import SelectDept from '@/components/pt/selectDept/SelectDept'
- #end
- #if(${hasSubParam} == 'true')
- import ${subTableJavaNameCap}Index from '@/views/${moduleName}/${businessNameLowerCase}/${subTableJavaNameCap}Index'
- #end
- export default {
- name: '${BusinessName}',
- #if(${isSub} == 'true')
- props: {
- ${subTableFkNameUnCap}: {
- type: String,
- required: true
- },
- title: {
- type: String,
- default: '子表'
- }
- },
- #end
- components: {
- AdvanceTable,
- #if(${hasSubParam} == 'true')
- ${subTableJavaNameCap}Index,
- #end
- ${BusinessName}AddForm,
- ${BusinessName}EditForm#if($hasDept > 0 || $hasUser > 0),
- #end
- #if($hasUser > 0)
- SelectUser#if($hasDept > 0),
- #end
- #end
- #if($hasDept > 0)
- SelectDept
- },
- #else
- },
- #end
- data () {
- return {
- showAddModal: false,
- showEditModal: false,
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- // 选中的主键集合
- selectedRowKeys: [],
- // 选中的数据集合
- selectedRows: [],
- // 高级搜索 展开/关闭
- advanced: false,
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 总条数
- total: 0,
- // label的百分比
- labelCol: { span: 6 },
- // 内容区域的百分比
- wrapperCol: { span: 18 },
- // ${functionName}表格数据
- ${businessName}List: [],
- #foreach ($column in $columns)
- #set($parentheseIndex=$column.columnComment.indexOf())
- #if($parentheseIndex != -1)
- #set($comment=$column.columnComment.substring(0, $parentheseIndex))
- #else
- #set($comment=$column.columnComment)
- #end
- #if(${column.dictType} != '')
- // $comment字典
- ${column.javaField}Options: [],
- #elseif(($column.htmlType == || $column.htmlType == ) && $column.queryType == )
- #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
- // $comment时间范围
- dateRange${AttrName}: [],
- #end
- #end
- // 查询参数
- queryParam: {
- pageNum: 1,
- ##子表时,防止超过10条记录,设置子表的分页数大于10
- #if($queryColumns.size() > 0)
- #if(${isSub} == 'true')
- pageSize: 1000,
- #else
- pageSize: 10,
- #end
- #foreach ($column in $queryColumns)
- #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
- #if(($column.htmlType == || $column.htmlType == ) && ($column.queryType == 'GTE' || $column.queryType == 'GT' || $column.queryType == 'EQ'))
- begin$AttrName: undefined#if($foreach.hasNext),#end
- #elseif(($column.htmlType == || $column.htmlType == ) && ($column.queryType == 'GTE' || $column.queryType == 'GT' || $column.queryType == 'EQ'))
- end$AttrName: undefined#if($foreach.hasNext),#end
- #elseif(($column.htmlType == || $column.htmlType == ) && ($column.queryType == 'BETWEEN'))
- begin$AttrName: undefined,
- end$AttrName: undefined#if($foreach.hasNext),#end
- #else
- $column.javaField: undefined#if($foreach.hasNext),#end
- #end
- #end
- #else
- #if(${isSub} == 'true')
- pageSize: 1000
- #else
- pageSize: 10
- #end
- #end
- },
- columns: [
- #foreach ($column in $columns)
- #set($parentheseIndex=$column.columnComment.indexOf())
- #if($parentheseIndex != -1)
- #set($comment=$column.columnComment.substring(0, $parentheseIndex))
- #else
- #set($comment=$column.columnComment)
- #end
- #if($column.isList == '1')
- {
- title: '$comment',
- dataIndex: '$column.javaField#if($column.htmlType == "user" || $column.htmlType == "dept")Name#end',
- #if(${column.dictType} != '')
- scopedSlots: { customRender: '$column.javaField' },
- #end
- #if($column.htmlType == || $column.htmlType == )
- ellipsis: true,
- #end
- #if($column.isColumnSort != && $column.isColumnSort == )
- sorter: true,
- #end
- #if($column.alignType != )
- align: '$column.alignType',
- #end
- width: '$columnWidth%'
- },
- #end
- #end
- {
- title: '操作',
- dataIndex: 'operation',
- align: 'center',
- width: '$operationColumnWidth%',
- scopedSlots: { customRender: 'operation' }
- }
- ]
- }
- },
- #set( $dictTypeLoopFlag = 0 )
- created () {
- this.getList()
- #if($dictColumns.size() > 0)
- getInitData('#foreach ($column in $columns)#if(${column.dictType} != '')#if($dictTypeLoopFlag == 0)${column.dictType}#else,${column.dictType}#end#set( $dictTypeLoopFlag = $dictTypeLoopFlag + 1 )#end#end').then(response => {
- #foreach ($column in $columns)
- #if(${column.dictType} != '')
- this.${column.javaField}Options = response.data.${column.dictType}
- #end
- #end
- })
- #end
- },
- methods: {
- /** 查询${functionName}列表 */
- getList () {
- this.loading = true
- #if(${isSub} == 'true')
- this.queryParam.${subTableFkNameUnCap} = this.${subTableFkNameUnCap}
- #end
- #foreach ($column in $columns)
- #if(($column.htmlType == || $column.htmlType == ) && $column.queryType == )
- #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
- if (this.dateRange${AttrName} !== null && this.dateRange${AttrName} !== '') {
- this.queryParam.begin${AttrName} = this.dateRange${AttrName}[0]
- this.queryParam.end${AttrName} = this.dateRange${AttrName}[1]
- }
- #end
- #end
- list${BusinessName}(this.queryParam).then(response => {
- this.${businessName}List = response.data.list
- this.total = response.data.total
- this.loading = false
- })
- },
- #if(${hasDisableEnable} == 'true')
- /* 状态修改 */
- confirmHandleStatus (row) {
- const text = row.status === '1' ? '启用' : '停用'
- const successText = text + '成功'
- const failText = text + '发生异常'
- row.status = row.status === '0' ? '1' : '0'
- updateStatus(row.id, row.status).then(() => {
- this.$message.success(
- successText,
- 3
- )
- }).catch(function () {
- this.$message.error(
- failText,
- 3
- )
- })
- },
- cancelHandleStatus (row) {
- },
- #end
- #foreach ($column in $columns)
- #if(${column.dictType} != '')
- #set($parentheseIndex=$column.columnComment.indexOf())
- #if($parentheseIndex != -1)
- #set($comment=$column.columnComment.substring(0, $parentheseIndex))
- #else
- #set($comment=$column.columnComment)
- #end
- // $comment字典翻译
- ${column.javaField}Format (row) {
- if (row.${column.javaField}) {
- return this.selectDictLabel#if($column.htmlType == || $column.htmlType == )s#end(this.${column.javaField}Options, row.${column.javaField})
- } else {
- return ''
- }
- },
- #end
- #end
- /** 搜索按钮操作 */
- handleQuery () {
- this.queryParam.pageNum = 1
- this.getList()
- },
- /** 重置按钮操作 */
- resetQuery () {
- #foreach ($column in $columns)
- #if($column.htmlType == && $column.queryType == )
- #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
- this.dateRange${AttrName} = []
- #end
- #end
- this.queryParam = {
- pageNum: 1,
- ##子表时,防止超过10条记录,设置子表的分页数大于10
- #if($queryColumns.size() > 0)
- #if(${isSub} == 'true')
- pageSize: 1000,
- #else
- pageSize: 10,
- #end
- #foreach ($column in $queryColumns)
- #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
- #if(($column.htmlType == || $column.htmlType == ) && ($column.queryType == 'GTE' || $column.queryType == 'GT' || $column.queryType == 'EQ'))
- begin$AttrName: undefined#if($foreach.hasNext),#end
- #elseif(($column.htmlType == || $column.htmlType == ) && ($column.queryType == 'GTE' || $column.queryType == 'GT' || $column.queryType == 'EQ'))
- end$AttrName: undefined#if($foreach.hasNext),#end
- #elseif(($column.htmlType == || $column.htmlType == ) && ($column.queryType == 'BETWEEN'))
- begin$AttrName: undefined,
- end$AttrName: undefined#if($foreach.hasNext),#end
- #else
- $column.javaField: undefined#if($foreach.hasNext),#end
- #end
- #end
- #else
- #if(${isSub} == 'true')
- pageSize: 1000
- #else
- pageSize: 10
- #end
- #end
- }
- this.handleQuery()
- },
- /** 翻页操作 */
- onShowSizeChange (current, pageSize) {
- this.queryParam.pageSize = pageSize
- this.getList()
- },
- /** 翻页操作 */
- onSizeChange (current, size) {
- this.queryParam.pageNum = 1
- this.queryParam.pageSize = size
- this.getList()
- },
- /** 翻页操作 */
- changeSize (current, pageSize) {
- this.queryParam.pageNum = current
- this.queryParam.pageSize = pageSize
- this.getList()
- },
- /** 翻页操作 */
- onSelectChange (selectedRowKeys, selectedRows) {
- this.selectedRowKeys = selectedRowKeys
- this.selectedRows = selectedRows
- this.ids = this.selectedRows.map(item => item.id)
- this.single = selectedRowKeys.length !== 1
- this.multiple = !selectedRowKeys.length
- },
- /** 查询折叠和展开操作 */
- toggleAdvanced () {
- this.advanced = !this.advanced
- },
- handleAdd () {
- this.showAddModal = true
- this.$nextTick(() => (
- this.$refs.${businessName}AddForm.handleAdd()
- ))
- },
- #if($hasCopyRecordOption)
- handleCopy (record, ids) {
- if (this.ids.length > 1) {
- this.$message.warning('只能选择一条记录复制!', 3)
- return
- }
- this.showAddModal = true
- this.$nextTick(() => (
- this.$refs.${businessName}AddForm.handleCopy(this.ids)
- ))
- },
- #end
- handleUpdate (record, ids) {
- this.showEditModal = true
- this.$nextTick(() => (
- this.$refs.${businessName}EditForm.handleUpdate(record, ids)
- ))
- },
- /** 删除按钮操作 */
- handleDelete (row) {
- var that = this
- const ${businessName}Ids = row.id || this.ids
- this.$confirm({
- title: '确认删除所选中数据?',
- onOk () {
- return del${BusinessName}(${businessName}Ids)
- .then(() => {
- that.onSelectChange([], [])
- that.getList()
- that.$message.success(
- '删除成功',
- 3
- )
- })
- },
- onCancel () {}
- })
- },
- /** 导出按钮操作 */
- handleExport () {
- var that = this
- this.$confirm({
- title: '是否确认导出?',
- content: '此操作将导出当前条件下所有数据而非选中数据',
- onOk () {
- return export${BusinessName}(that.queryParam)
- .then(response => {
- that.download(response.msg)
- that.$message.success(
- '导出成功',
- 3
- )
- })
- },
- onCancel () {}
- })
- },
- handleTableChange (pagination, filters, sorter) {
- if (sorter.field !== undefined && sorter.field !== null && sorter.field !== '') {
- this.queryParam.orderByColumn = 'a.' + sorter.field
- this.queryParam.isAsc = sorter.order
- }
- this.getList()
- }
- }
- }
- </script>
|