123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- import request from '@/utils/request'
- // 查询${functionName}列表
- export function list${BusinessName} (query, id, expandLevel) {
- if (id == null || id === '') {
- id = '0'
- }
- if (expandLevel == null || expandLevel === '') {
- expandLevel = '1'
- }
- return request({
- url: '/${moduleName}/${businessName}/list/' + expandLevel + '/' + id,
- method: 'get',
- params: query
- })
- }
- // 查询${functionName}树结构
- export function listTree (id, expandLevel) {
- if (id == null || id === '') {
- id = '0'
- }
- if (expandLevel == null || expandLevel === '') {
- expandLevel = '1'
- }
- return request({
- url: '/${moduleName}/${businessName}/listTree/' + expandLevel + '/' + id,
- method: 'get'
- })
- }
- // 查询${functionName}树结构(排除当前节点及子节点)
- export function listTreeExcludeChild (id, expandLevel) {
- return request({
- url: '/${moduleName}/${businessName}/listTreeExcludeChild/' + expandLevel + '/0/' + id,
- method: 'get'
- })
- }
- // 查询${functionName}详细
- export function get${BusinessName} (id) {
- return request({
- url: '/${moduleName}/${businessName}/' + id,
- method: 'get'
- })
- }
- // 查询${functionName}下拉结构
- export function treeGridSelect (id, expandLevel) {
- if (id == null || id === '') {
- id = '0'
- }
- if (expandLevel == null || expandLevel === '') {
- expandLevel = '1'
- }
- return request({
- url: '/system/menu/treeGridSelect/' + expandLevel + '/' + id,
- method: 'get'
- })
- }
- // 新增${functionName}
- export function add${BusinessName} (data) {
- return request({
- url: '/${moduleName}/${businessName}',
- method: 'post',
- data: data
- })
- }
- // 修改${functionName}
- export function update${BusinessName} (data) {
- return request({
- url: '/${moduleName}/${businessName}',
- method: 'put',
- data: data
- })
- }
- // 删除${functionName}
- export function del${BusinessName} (id) {
- return request({
- url: '/${moduleName}/${businessName}/' + id,
- method: 'delete'
- })
- }
- #foreach($column in $columns)
- #if($column.columnName == "status" && ${hasDisableEnable} == 'true')
- // 状态修改
- export function updateStatus (id, status) {
- const data = {
- id,
- status
- }
- return request({
- url: '/${moduleName}/${businessName}/updateStatus',
- method: 'put',
- data: data
- })
- }
- #break
- #end
- #end
- // 查询最大编号
- export function findMaxSort (parentId) {
- return request({
- url: '/${moduleName}/${businessName}/findMaxSort/' + parentId,
- method: 'get'
- })
- }
- #foreach($column in $uniqueColumns)
- #set($attrName = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
- ##循环标志为1和上面的排序号不存在,则预留空行
- #if($velocityCount == 1)
- #end
- // 校验${column.columnComment}是否存在
- export function check${attrName}Unique (id, ${column.javaField}) {
- if (id === undefined) {
- id = ''
- }
- return request({
- url: '/${moduleName}/${businessName}/check${attrName}Unique/' + ${column.javaField} + '/' + id,
- method: 'get'
- })
- }
- #if($foreach.hasNext)
- #end
- #end
- // 获取初始化数据
- export function getInitData (dictTypes) {
- return request({
- url: '/${moduleName}/${businessName}/getInitData/' + dictTypes,
- method: 'get'
- })
- }
- // 树表格检索
- export function search${BusinessName}List (searchInfo) {
- return request({
- url: '/${moduleName}/${businessName}/search${BusinessName}List',
- method: 'get',
- params: searchInfo
- })
- }
- // 树检索
- export function search${BusinessName} (searchInfo) {
- return request({
- url: '/${moduleName}/${businessName}/search${BusinessName}',
- method: 'get',
- params: searchInfo
- })
- }
|