修改添加组件

This commit is contained in:
qq787203167
2022-01-21 16:54:05 +08:00
committed by xiejunyu
parent d33e38a4e0
commit bbb21b9175
30 changed files with 2661 additions and 16 deletions
@@ -0,0 +1,8 @@
1、权限系统2.0操作文档:https://nio.feishu.cn/docs/doccnUSMQMjxayqmhW619H6TA6c
3.1.1 权限需要单独开? 拥有权限系统内置的Lessee manage相关权限的人员可以使用租户管理功能
相关问题答疑:https://nio.feishu.cn/docs/doccnaW8n2CMi2DJ0fyDaS7i9Xc#5eW6BR
ADTEST环境加入:https://nio.feishu.cn/docs/doccnTrfJGXKnne12XoErTyCigh
人员组织表结构设计:https://nio.feishu.cn/docs/doccnhc51QERo9N4ULBZQvH3mke
@@ -32,6 +32,11 @@
<artifactId>jero-boot-modules</artifactId>
<version>${jero.version}</version>
</dependency>
<dependency>
<groupId>com.jero.boot</groupId>
<artifactId>jero-boot-tag-system</artifactId>
<version>${jero.version}</version>
</dependency>
</dependencies>
<build>
@@ -1,5 +1,6 @@
#code_generate_project_path
project_path=E:\\project\\jero-boot
project_path=F:\\idea-workspace\\laws-weilai\\jero-boot
#bussi_package[User defined]
bussi_package=com.jero.modules
@@ -26,4 +27,4 @@ db_filed_convert=true
page_search_filed_num=1
#page_filter_fields
page_filter_fields=create_time,create_by,update_time,update_by
exclude_table=act_,ext_act_,design_,onl_,sys_,qrtz_
exclude_table=act_,ext_act_,design_,qrtz_
+48
View File
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>jero-boot</artifactId>
<groupId>com.jero.boot</groupId>
<version>2.4.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jero-boot-tag-system</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.jero.boot</groupId>
<artifactId>jero-system-local-api</artifactId>
</dependency>
<dependency>
<groupId>com.jero.boot</groupId>
<artifactId>jero-boot-starter-redis</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-web -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.3.9</version>
</dependency>
<dependency>
<groupId>com.jero.boot</groupId>
<artifactId>jero-boot</artifactId>
<version>2.4.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
<version>3.4.1</version>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,170 @@
package com.jero.controller;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jero.common.api.vo.Result;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.com.jero.entity.OnlCgformArea;
import com.jero.modules.com.jero.service.IOnlCgformAreaService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import com.jero.common.system.base.controller.JeroController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.jero.common.aspect.annotation.AutoLog;
/**
* @Description: 区域管理表
* @Author: jero-boot
* @Date: 2022-01-21
* @Version: V1.0
*/
@Api(tags="区域管理表")
@RestController
@RequestMapping("/tag/onlCgformArea")
@Slf4j
public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlCgformAreaService> {
@Autowired
private IOnlCgformAreaService onlCgformAreaService;
/**
* 分页列表查询
*
* @param onlCgformArea
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "区域管理表-分页列表查询")
@ApiOperation(value="区域管理表-分页列表查询", notes="区域管理表-分页列表查询")
@GetMapping(value = "/page")
public Result<?> queryPageList(OnlCgformArea onlCgformArea,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<OnlCgformArea> queryWrapper = QueryGenerator.initQueryWrapper(onlCgformArea, req.getParameterMap());
Page<OnlCgformArea> page = new Page<OnlCgformArea>(pageNo, pageSize);
IPage<OnlCgformArea> pageList = onlCgformAreaService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 列表查询
*
* @return
*/
@AutoLog(value = "区域管理表-列表查询")
@ApiOperation(value="区域管理表-列表查询", notes="区域管理表-列表查询")
@GetMapping(value = "/list")
public Result<List<OnlCgformArea>> queryList() {
List<OnlCgformArea> list = onlCgformAreaService.queryList();
return Result.OK(list);
}
/**
* 添加
*
* @param onlCgformArea
* @return
*/
@AutoLog(value = "区域管理表-添加")
@ApiOperation(value="区域管理表-添加", notes="区域管理表-添加")
@PostMapping(value = "/add")
public Result<?> add(@Validated @RequestBody OnlCgformArea onlCgformArea) {
onlCgformAreaService.add(onlCgformArea);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param onlCgformArea
* @return
*/
@AutoLog(value = "区域管理表-编辑")
@ApiOperation(value="区域管理表-编辑", notes="区域管理表-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@Validated @RequestBody OnlCgformArea onlCgformArea) {
onlCgformAreaService.editById(onlCgformArea);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "区域管理表-通过id删除")
@ApiOperation(value="区域管理表-通过id删除", notes="区域管理表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
onlCgformAreaService.deleteById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "区域管理表-批量删除")
@ApiOperation(value="区域管理表-批量删除", notes="区域管理表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.onlCgformAreaService.deleteByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "区域管理表-通过id查询")
@ApiOperation(value="区域管理表-通过id查询", notes="区域管理表-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
OnlCgformArea onlCgformArea = onlCgformAreaService.queryById(id);
if(onlCgformArea==null) {
return Result.error("未找到对应数据");
}
return Result.OK(onlCgformArea);
}
/**
* 导出excel
*
* @param request
* @param onlCgformArea
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, OnlCgformArea onlCgformArea) {
return super.exportXls(request, onlCgformArea, OnlCgformArea.class, "区域管理表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, OnlCgformArea.class);
}
}
@@ -0,0 +1,110 @@
package com.jero.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
/**
* @Description: 区域管理表
* @Author: jero-boot
* @Date: 2022-01-21
* @Version: V1.0
*/
@Data
@TableName("onl_cgform_area")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="onl_cgform_area对象", description="区域管理表")
public class OnlCgformArea implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private String sysOrgCode;
/**展示区域*/
@Excel(name = "展示区域", width = 15)
@ApiModelProperty(value = "展示区域")
private String showArea;
/**英文名称*/
@Excel(name = "英文名称", width = 15)
@javax.validation.constraints.Pattern(regexp = "^[a-zA-Z]{1}$",message = "请输入正确的字母")
@ApiModelProperty(value = "英文名称")
private String enName;
/**所属模块*/
@Excel(name = "所属模块", width = 15)
private transient String isModelString;
private byte[] isModel;
public byte[] getIsModel(){
if(isModelString==null){
return null;
}
try {
return isModelString.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return null;
}
public String getIsModelString(){
if(isModel==null || isModel.length==0){
return "";
}
try {
return new String(isModel,"UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return "";
}
/**排序号*/
@Excel(name = "排序号", width = 15)
@javax.validation.constraints.Pattern(regexp = "^-?[1-9]\\d+$",message = "请输入正确的整数")
@ApiModelProperty(value = "排序号")
private Integer sort;
}
@@ -0,0 +1,17 @@
package com.jero.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.jero.modules.com.jero.entity.OnlCgformArea;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 区域管理表
* @Author: jero-boot
* @Date: 2022-01-21
* @Version: V1.0
*/
public interface OnlCgformAreaMapper extends BaseMapper<OnlCgformArea> {
}
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jero.modules.com.jero.mapper.OnlCgformAreaMapper">
<resultMap id="OnlCgformAreaResultMap" type="com.jero.modules.com.jero.entity.OnlCgformArea">
<id column="id" property="id" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" />
<result column="sys_org_code" property="sysOrgCode" />
<result column="show_area" property="showArea" />
<result column="en_name" property="enName" />
<result column="is_model" property="isModel" />
<result column="sort" property="sort" />
</resultMap>
</mapper>
@@ -0,0 +1,61 @@
package com.jero.service;
import com.jero.modules.com.jero.entity.OnlCgformArea;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @Description: 区域管理表
* @Author: jero-boot
* @Date: 2022-01-21
* @Version: V1.0
*/
public interface IOnlCgformAreaService extends IService<OnlCgformArea> {
/**
* 保存
*
* @param onlCgformArea
* @return
*/
void add(OnlCgformArea onlCgformArea);
/**
* 更新
*
* @param onlCgformArea
* @return
*/
void editById(OnlCgformArea onlCgformArea);
/**
* 通过id删除
*
* @param id
* @return
*/
void deleteById(String id);
/**
* 批量删除
*
* @param ids
* @return
*/
void deleteByIds(List<String> ids);
/**
* 通过id查询
*
* @param id
* @return
*/
OnlCgformArea queryById(String id);
/**
* 列表查询
*
* @return
*/
List<OnlCgformArea> queryList();
}
@@ -0,0 +1,89 @@
package com.jero.service.impl;
import com.jero.modules.com.jero.entity.OnlCgformArea;
import com.jero.modules.com.jero.mapper.OnlCgformAreaMapper;
import com.jero.modules.com.jero.service.IOnlCgformAreaService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Date;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 区域管理表
* @Author: jero-boot
* @Date: 2022-01-21
* @Version: V1.0
*/
@Service
public class OnlCgformAreaServiceImpl extends ServiceImpl<OnlCgformAreaMapper, OnlCgformArea> implements IOnlCgformAreaService {
/**
* 保存
*
* @param onlCgformArea
* @return
*/
@Override
public void add(OnlCgformArea onlCgformArea) {
Date now = new Date();
onlCgformArea.setCreateTime(now);
onlCgformArea.setUpdateTime(now);
save(onlCgformArea);
}
/**
* 更新
*
* @param onlCgformArea
* @return
*/
@Override
public void editById(OnlCgformArea onlCgformArea) {
Date now = new Date();
onlCgformArea.setUpdateTime(now);
saveOrUpdate(onlCgformArea);
}
/**
* 通过id删除
*
* @param id
* @return
*/
@Override
public void deleteById(String id) {
removeById(id);
}
/**
* 批量删除
*
* @param ids
* @return
*/
@Override
public void deleteByIds(List<String> ids) {
removeByIds(ids);
}
/**
* 通过id查询
*
* @param id
* @return
*/
@Override
public OnlCgformArea queryById(String id) {
return getById(id);
}
/**
* 列表查询
*
* @return
*/
@Override
public List<OnlCgformArea> queryList() {
return list();
}
}
@@ -0,0 +1,190 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('区域管理表')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<onl-cgform-area-modal ref="modalForm" @ok="modalFormOk"></onl-cgform-area-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeroListMixin } from '@/mixins/JeroListMixin'
import OnlCgformAreaModal from './modules/OnlCgformAreaModal'
export default {
name: 'OnlCgformAreaList',
mixins:[JeroListMixin, mixinDevice],
components: {
OnlCgformAreaModal
},
data () {
return {
description: '区域管理表管理页面',
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'展示区域',
align:"center",
dataIndex: 'showArea'
},
{
title:'英文名称',
align:"center",
dataIndex: 'enName'
},
{
title:'所属模块',
align:"center",
dataIndex: 'isModelString'
},
{
title:'排序号',
align:"center",
sorter: true,
dataIndex: 'sort'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/com.jero/onlCgformArea/page",
delete: "/com.jero/onlCgformArea/delete",
deleteBatch: "/com.jero/onlCgformArea/deleteBatch",
exportXlsUrl: "/com.jero/onlCgformArea/exportXls",
importExcelUrl: "com.jero/onlCgformArea/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'showArea',text:'展示区域',dictCode:''})
fieldList.push({type:'string',value:'enName',text:'英文名称',dictCode:''})
fieldList.push({type:'Blob',value:'isModel',text:'所属模块',dictCode:''})
fieldList.push({type:'int',value:'sort',text:'排序号',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
@@ -0,0 +1,191 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form :form="form" slot="detail">
<a-row>
<a-col :span="24">
<a-form-item label="展示区域" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['showArea', validatorRules.showArea]" placeholder="请输入展示区域" :maxLength="120" ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['enName', validatorRules.enName]" placeholder="请输入英文名称" :maxLength="120" ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="所属模块" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['isModelString']" placeholder="请输入所属模块" disabled></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="排序号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input-number v-decorator="['sort', validatorRules.sort]" placeholder="请输入排序号" style="width: 100%" />
</a-form-item>
</a-col>
<a-col v-if="showFlowSubmitButton" :span="24" style="text-align: center">
<a-button @click="submitForm"> </a-button>
</a-col>
</a-row>
</a-form>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import pick from 'lodash.pick'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'OnlCgformAreaForm',
components: {
},
props: {
//流程表单data
formData: {
type: Object,
default: ()=>{},
required: false
},
//表单模式:true流程表单 false普通表单
formBpm: {
type: Boolean,
default: false,
required: false
},
//表单禁用
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
form: this.$form.createForm(this),
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
showArea: {
rules: [
{ required: true, message: '请输入展示区域!'},
]
},
enName: {
rules: [
{ required: true, message: '请输入英文名称!'},
{ pattern: /^[A-Z|a-z]+$/, message: '请输入字母!'},
]
},
isModel: {
rules: [
{ required: true, message: '请输入所属模块!'},
]
},
sort: {
rules: [
{ required: true, message: '请输入排序号!'},
{ pattern: /^-?\d+$/, message: '请输入整数!'},
]
},
},
url: {
add: "/com.jero/onlCgformArea/add",
edit: "/com.jero/onlCgformArea/edit",
queryById: "/com.jero/onlCgformArea/queryById"
}
}
},
computed: {
formDisabled(){
if(this.formBpm===true){
if(this.formData.disabled===false){
return false
}
return true
}
return this.disabled
},
showFlowSubmitButton(){
if(this.formBpm===true){
if(this.formData.disabled===false){
return true
}
}
return false
}
},
created () {
//如果是流程中表单,则需要加载流程表单data
this.showFlowData();
},
methods: {
add () {
this.edit({});
},
edit (record) {
this.form.resetFields();
this.model = Object.assign({}, record);
this.visible = true;
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'showArea','enName','isModelString','sort'))
})
},
//渲染流程表单数据
showFlowData(){
if(this.formBpm === true){
let params = {id:this.formData.dataId};
getAction(this.url.queryById,params).then((res)=>{
if(res.success){
this.edit (res.result);
}
});
}
},
submitForm () {
const that = this;
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
let formData = Object.assign(this.model, values);
console.log("表单提交数据",formData)
httpAction(httpurl,formData,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
popupCallback(row){
this.form.setFieldsValue(pick(row,'showArea','enName','isModelString','sort'))
},
}
}
</script>
@@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<onl-cgform-area-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></onl-cgform-area-form>
</j-modal>
</template>
<script>
import OnlCgformAreaForm from './OnlCgformAreaForm'
export default {
name: 'OnlCgformAreaModal',
components: {
OnlCgformAreaForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>
@@ -0,0 +1,83 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
:visible="visible">
<onl-cgform-area-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></onl-cgform-area-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import OnlCgformAreaForm from './OnlCgformAreaForm'
export default {
name: 'OnlCgformAreaModal',
components: {
OnlCgformAreaForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>
+55
View File
@@ -54,6 +54,7 @@
<!-- 单体应用启动类 -->
<module>jero-boot-single-startup</module>
<module>jero-boot-modules</module>
<module>jero-boot-tag-system</module>
</modules>
<distributionManagement>
@@ -108,6 +109,60 @@
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.22</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-annotation</artifactId>
<version>3.4.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.jeecgframework</groupId>
<artifactId>autopoi</artifactId>
<version>1.2.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-core</artifactId>
<version>3.4.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-extension</artifactId>
<version>3.4.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>com.jero.boot</groupId>
<artifactId>jero-boot-base-core</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
@@ -0,0 +1,170 @@
package com.jero.modules.com.jero.controller;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jero.common.api.vo.Result;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.com.jero.entity.OnlCgformArea;
import com.jero.modules.com.jero.service.IOnlCgformAreaService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import com.jero.common.system.base.controller.JeroController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.jero.common.aspect.annotation.AutoLog;
/**
* @Description: 区域管理表
* @Author: jero-boot
* @Date: 2022-01-21
* @Version: V1.0
*/
@Api(tags="区域管理表")
@RestController
@RequestMapping("/com.jero/onlCgformArea")
@Slf4j
public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlCgformAreaService> {
@Autowired
private IOnlCgformAreaService onlCgformAreaService;
/**
* 分页列表查询
*
* @param onlCgformArea
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "区域管理表-分页列表查询")
@ApiOperation(value="区域管理表-分页列表查询", notes="区域管理表-分页列表查询")
@GetMapping(value = "/page")
public Result<?> queryPageList(OnlCgformArea onlCgformArea,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<OnlCgformArea> queryWrapper = QueryGenerator.initQueryWrapper(onlCgformArea, req.getParameterMap());
Page<OnlCgformArea> page = new Page<OnlCgformArea>(pageNo, pageSize);
IPage<OnlCgformArea> pageList = onlCgformAreaService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 列表查询
*
* @return
*/
@AutoLog(value = "区域管理表-列表查询")
@ApiOperation(value="区域管理表-列表查询", notes="区域管理表-列表查询")
@GetMapping(value = "/list")
public Result<List<OnlCgformArea>> queryList() {
List<OnlCgformArea> list = onlCgformAreaService.queryList();
return Result.OK(list);
}
/**
* 添加
*
* @param onlCgformArea
* @return
*/
@AutoLog(value = "区域管理表-添加")
@ApiOperation(value="区域管理表-添加", notes="区域管理表-添加")
@PostMapping(value = "/add")
public Result<?> add(@Validated @RequestBody OnlCgformArea onlCgformArea) {
onlCgformAreaService.add(onlCgformArea);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param onlCgformArea
* @return
*/
@AutoLog(value = "区域管理表-编辑")
@ApiOperation(value="区域管理表-编辑", notes="区域管理表-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@Validated @RequestBody OnlCgformArea onlCgformArea) {
onlCgformAreaService.editById(onlCgformArea);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "区域管理表-通过id删除")
@ApiOperation(value="区域管理表-通过id删除", notes="区域管理表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
onlCgformAreaService.deleteById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "区域管理表-批量删除")
@ApiOperation(value="区域管理表-批量删除", notes="区域管理表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.onlCgformAreaService.deleteByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "区域管理表-通过id查询")
@ApiOperation(value="区域管理表-通过id查询", notes="区域管理表-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
OnlCgformArea onlCgformArea = onlCgformAreaService.queryById(id);
if(onlCgformArea==null) {
return Result.error("未找到对应数据");
}
return Result.OK(onlCgformArea);
}
/**
* 导出excel
*
* @param request
* @param onlCgformArea
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, OnlCgformArea onlCgformArea) {
return super.exportXls(request, onlCgformArea, OnlCgformArea.class, "区域管理表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, OnlCgformArea.class);
}
}
@@ -0,0 +1,110 @@
package com.jero.modules.com.jero.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
/**
* @Description: 区域管理表
* @Author: jero-boot
* @Date: 2022-01-21
* @Version: V1.0
*/
@Data
@TableName("onl_cgform_area")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="onl_cgform_area对象", description="区域管理表")
public class OnlCgformArea implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
/**展示区域*/
@Excel(name = "展示区域", width = 15)
@ApiModelProperty(value = "展示区域")
private java.lang.String showArea;
/**英文名称*/
@Excel(name = "英文名称", width = 15)
@javax.validation.constraints.Pattern(regexp = "^[a-zA-Z]{1}$",message = "请输入正确的字母")
@ApiModelProperty(value = "英文名称")
private java.lang.String enName;
/**所属模块*/
@Excel(name = "所属模块", width = 15)
private transient java.lang.String isModelString;
private byte[] isModel;
public byte[] getIsModel(){
if(isModelString==null){
return null;
}
try {
return isModelString.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return null;
}
public String getIsModelString(){
if(isModel==null || isModel.length==0){
return "";
}
try {
return new String(isModel,"UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return "";
}
/**排序号*/
@Excel(name = "排序号", width = 15)
@javax.validation.constraints.Pattern(regexp = "^-?[1-9]\\d+$",message = "请输入正确的整数")
@ApiModelProperty(value = "排序号")
private java.lang.Integer sort;
}
@@ -0,0 +1,17 @@
package com.jero.modules.com.jero.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.jero.modules.com.jero.entity.OnlCgformArea;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 区域管理表
* @Author: jero-boot
* @Date: 2022-01-21
* @Version: V1.0
*/
public interface OnlCgformAreaMapper extends BaseMapper<OnlCgformArea> {
}
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jero.modules.com.jero.mapper.OnlCgformAreaMapper">
<resultMap id="OnlCgformAreaResultMap" type="com.jero.modules.com.jero.entity.OnlCgformArea">
<id column="id" property="id" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" />
<result column="sys_org_code" property="sysOrgCode" />
<result column="show_area" property="showArea" />
<result column="en_name" property="enName" />
<result column="is_model" property="isModel" />
<result column="sort" property="sort" />
</resultMap>
</mapper>
@@ -0,0 +1,61 @@
package com.jero.modules.com.jero.service;
import com.jero.modules.com.jero.entity.OnlCgformArea;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @Description: 区域管理表
* @Author: jero-boot
* @Date: 2022-01-21
* @Version: V1.0
*/
public interface IOnlCgformAreaService extends IService<OnlCgformArea> {
/**
* 保存
*
* @param onlCgformArea
* @return
*/
void add(OnlCgformArea onlCgformArea);
/**
* 更新
*
* @param onlCgformArea
* @return
*/
void editById(OnlCgformArea onlCgformArea);
/**
* 通过id删除
*
* @param id
* @return
*/
void deleteById(String id);
/**
* 批量删除
*
* @param ids
* @return
*/
void deleteByIds(List<String> ids);
/**
* 通过id查询
*
* @param id
* @return
*/
OnlCgformArea queryById(String id);
/**
* 列表查询
*
* @return
*/
List<OnlCgformArea> queryList();
}
@@ -0,0 +1,89 @@
package com.jero.modules.com.jero.service.impl;
import com.jero.modules.com.jero.entity.OnlCgformArea;
import com.jero.modules.com.jero.mapper.OnlCgformAreaMapper;
import com.jero.modules.com.jero.service.IOnlCgformAreaService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Date;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 区域管理表
* @Author: jero-boot
* @Date: 2022-01-21
* @Version: V1.0
*/
@Service
public class OnlCgformAreaServiceImpl extends ServiceImpl<OnlCgformAreaMapper, OnlCgformArea> implements IOnlCgformAreaService {
/**
* 保存
*
* @param onlCgformArea
* @return
*/
@Override
public void add(OnlCgformArea onlCgformArea) {
Date now = new Date();
onlCgformArea.setCreateTime(now);
onlCgformArea.setUpdateTime(now);
save(onlCgformArea);
}
/**
* 更新
*
* @param onlCgformArea
* @return
*/
@Override
public void editById(OnlCgformArea onlCgformArea) {
Date now = new Date();
onlCgformArea.setUpdateTime(now);
saveOrUpdate(onlCgformArea);
}
/**
* 通过id删除
*
* @param id
* @return
*/
@Override
public void deleteById(String id) {
removeById(id);
}
/**
* 批量删除
*
* @param ids
* @return
*/
@Override
public void deleteByIds(List<String> ids) {
removeByIds(ids);
}
/**
* 通过id查询
*
* @param id
* @return
*/
@Override
public OnlCgformArea queryById(String id) {
return getById(id);
}
/**
* 列表查询
*
* @return
*/
@Override
public List<OnlCgformArea> queryList() {
return list();
}
}
@@ -0,0 +1,190 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('区域管理表')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<onl-cgform-area-modal ref="modalForm" @ok="modalFormOk"></onl-cgform-area-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeroListMixin } from '@/mixins/JeroListMixin'
import OnlCgformAreaModal from './modules/OnlCgformAreaModal'
export default {
name: 'OnlCgformAreaList',
mixins:[JeroListMixin, mixinDevice],
components: {
OnlCgformAreaModal
},
data () {
return {
description: '区域管理表管理页面',
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'展示区域',
align:"center",
dataIndex: 'showArea'
},
{
title:'英文名称',
align:"center",
dataIndex: 'enName'
},
{
title:'所属模块',
align:"center",
dataIndex: 'isModelString'
},
{
title:'排序号',
align:"center",
sorter: true,
dataIndex: 'sort'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/com.jero/onlCgformArea/page",
delete: "/com.jero/onlCgformArea/delete",
deleteBatch: "/com.jero/onlCgformArea/deleteBatch",
exportXlsUrl: "/com.jero/onlCgformArea/exportXls",
importExcelUrl: "com.jero/onlCgformArea/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'showArea',text:'展示区域',dictCode:''})
fieldList.push({type:'string',value:'enName',text:'英文名称',dictCode:''})
fieldList.push({type:'Blob',value:'isModel',text:'所属模块',dictCode:''})
fieldList.push({type:'int',value:'sort',text:'排序号',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
@@ -0,0 +1,191 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form :form="form" slot="detail">
<a-row>
<a-col :span="24">
<a-form-item label="展示区域" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['showArea', validatorRules.showArea]" placeholder="请输入展示区域" :maxLength="120" ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['enName', validatorRules.enName]" placeholder="请输入英文名称" :maxLength="120" ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="所属模块" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['isModelString']" placeholder="请输入所属模块" disabled></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="排序号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input-number v-decorator="['sort', validatorRules.sort]" placeholder="请输入排序号" style="width: 100%" />
</a-form-item>
</a-col>
<a-col v-if="showFlowSubmitButton" :span="24" style="text-align: center">
<a-button @click="submitForm"> </a-button>
</a-col>
</a-row>
</a-form>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import pick from 'lodash.pick'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'OnlCgformAreaForm',
components: {
},
props: {
//流程表单data
formData: {
type: Object,
default: ()=>{},
required: false
},
//表单模式:true流程表单 false普通表单
formBpm: {
type: Boolean,
default: false,
required: false
},
//表单禁用
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
form: this.$form.createForm(this),
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
showArea: {
rules: [
{ required: true, message: '请输入展示区域!'},
]
},
enName: {
rules: [
{ required: true, message: '请输入英文名称!'},
{ pattern: /^[A-Z|a-z]+$/, message: '请输入字母!'},
]
},
isModel: {
rules: [
{ required: true, message: '请输入所属模块!'},
]
},
sort: {
rules: [
{ required: true, message: '请输入排序号!'},
{ pattern: /^-?\d+$/, message: '请输入整数!'},
]
},
},
url: {
add: "/com.jero/onlCgformArea/add",
edit: "/com.jero/onlCgformArea/edit",
queryById: "/com.jero/onlCgformArea/queryById"
}
}
},
computed: {
formDisabled(){
if(this.formBpm===true){
if(this.formData.disabled===false){
return false
}
return true
}
return this.disabled
},
showFlowSubmitButton(){
if(this.formBpm===true){
if(this.formData.disabled===false){
return true
}
}
return false
}
},
created () {
//如果是流程中表单,则需要加载流程表单data
this.showFlowData();
},
methods: {
add () {
this.edit({});
},
edit (record) {
this.form.resetFields();
this.model = Object.assign({}, record);
this.visible = true;
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'showArea','enName','isModelString','sort'))
})
},
//渲染流程表单数据
showFlowData(){
if(this.formBpm === true){
let params = {id:this.formData.dataId};
getAction(this.url.queryById,params).then((res)=>{
if(res.success){
this.edit (res.result);
}
});
}
},
submitForm () {
const that = this;
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
let formData = Object.assign(this.model, values);
console.log("表单提交数据",formData)
httpAction(httpurl,formData,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
popupCallback(row){
this.form.setFieldsValue(pick(row,'showArea','enName','isModelString','sort'))
},
}
}
</script>
@@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<onl-cgform-area-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></onl-cgform-area-form>
</j-modal>
</template>
<script>
import OnlCgformAreaForm from './OnlCgformAreaForm'
export default {
name: 'OnlCgformAreaModal',
components: {
OnlCgformAreaForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>
@@ -0,0 +1,83 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
:visible="visible">
<onl-cgform-area-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></onl-cgform-area-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import OnlCgformAreaForm from './OnlCgformAreaForm'
export default {
name: 'OnlCgformAreaModal',
components: {
OnlCgformAreaForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>
@@ -0,0 +1,281 @@
<template>
<div>
<div class="box-title-text">
<!-- <div class="title-text">-->
<!-- <span class="Required">*</span>-->
<!-- <span :class="{'title-text-text':false}">{{query.enName}}</span><br>-->
<!-- <span :class="{'title-text-text':false}">{{query.name}}</span>-->
<!-- </div>-->
<a-input class="box-input" :value="value" @input="indexclick($event)" :placeholder="query.placeholder"/>
<a-button type="primary" class="button-box" @click="standardClick">
标准选择
</a-button>
</div>
<a-drawer
:title="'标准选择'"
:maskClosable="true"
:width="1000"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<a-form layout="inline" @keyup.enter.native="searchQuery" style="margin-bottom: 20px">
<a-row :gutter="24">
<a-col :md="6" :sm="8" v-for="(item,index) in searchList" :key="index" style="line-height: 48px">
<div class="box-title-text-index">
<div class="title-text-index">
<span>{{item.enName}}</span><br>
<span>{{item.name}}</span>
</div>
<a-input class="box-input-index" :placeholder="item.placeholder"
v-model="queryParam[item.attrModel]"></a-input>
</div>
</a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button class="box-button" type="primary" @click="searchReset">{{$t('query')}}</a-button>
<a-button class="box-button" style="margin-left: 8px" @click="searchQuery">{{$t('reset')}}</a-button>
</span>
</a-row>
</a-form>
<a-table
:columns="columns"
:data-source="data"
:scroll="{ y: 540 }"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
bordered>
<template slot="name" slot-scope="text">
<a>{{ text }}</a>
</template>
</a-table>
<div class="drawer-bootom-button">
<a-button @click="handleCancel" type="danger" style="margin-right: 16px">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
</div>
</template>
<script>
export default {
name: 'index',
props: ['query', 'value'],
data() {
return {
visible: false,
confirmLoading: false,
selectedRowKeys: [],
content: [],
queryParam: {},
searchList: [
{ name: '标准编号', placeholder: '请输入标准编号', attrModel: 'name', enName: 'standard' },
{ name: '标准名称', placeholder: '请输入标准名称', attrModel: 'title', enName: 'standName' }
],
columns: [
{
title: 'Name',
dataIndex: 'name',
scopedSlots: { customRender: 'name' }
},
{
title: 'Cash Assets',
className: 'column-money',
dataIndex: 'money'
},
{
title: 'Address',
dataIndex: 'address'
}
],
data: [
{
key: '1',
name: 'John Brown',
money: '¥300,000.00',
address: 'New York No. 1 Lake Park'
},
{
key: '2',
name: 'Jim Green',
money: '¥1,256,000.00',
address: 'London No. 1 Lake Park'
},
{
key: '3',
name: 'Joe Black',
money: '¥120,000.00',
address: 'Sidney No. 1 Lake Park'
},
{
key: '4',
name: 'John Brown',
money: '¥300,000.00',
address: 'New York No. 1 Lake Park'
},
{
key: '5',
name: 'Jim Green',
money: '¥1,256,000.00',
address: 'London No. 1 Lake Park'
},
{
key: '6',
name: 'Joe Black',
money: '¥120,000.00',
address: 'Sidney No. 1 Lake Park'
},
{
key: '7',
name: 'John Brown',
money: '¥300,000.00',
address: 'New York No. 1 Lake Park'
},
{
key: '8',
name: 'Jim Green',
money: '¥1,256,000.00',
address: 'London No. 1 Lake Park'
},
{
key: '9',
name: 'Joe Black',
money: '¥120,000.00',
address: 'Sidney No. 1 Lake Park'
},
{
key: '10',
name: 'Jim Green',
money: '¥1,256,000.00',
address: 'London No. 1 Lake Park'
},
{
key: '11',
name: 'Joe Black',
money: '¥120,000.00',
address: 'Sidney No. 1 Lake Park'
}
]
}
},
mounted() {
},
methods: {
standardClick() {
this.visible = true
},
handleCancel() {
this.visible = false
},
handleSubmit() {
let content = []
this.content.forEach(res=>{
content.push(res.name)
})
this.$emit('input', content.join(','))
this.visible = false
},
indexclick(event) {
this.$emit('input', event.target.value)
},
onSelectChange(value) {
this.content = []
value.forEach(val => {
this.data.forEach((res) => {
if (res.key === val){
this.content.push(res)
}
})
})
this.selectedRowKeys = value
},
searchQuery() {
},
searchReset() {
}
}
}
</script>
<style scoped>
.box-title-text {
line-height: 1.4;
display: flex;
/*align-items: center;*/
}
.title-text {
width: 114px;
text-align: right;
display: inline-block;
font-weight: bold;
font-size: 14px;
margin-right: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.itemModel {
width: calc(100% - 220px);
display: inline-block;
margin-top: 2px;
}
.Required {
color: red;
margin-right: 4px;
}
.button-box {
margin-left: 10px;
height: 38px;
line-height: 38px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
.box-title-text-index {
line-height: 1.4;
display: flex;
align-items: center;
}
.title-text-index {
display: inline-block;
font-weight: bold;
font-size: 14px;
margin-right: 16px;
}
.box-input-index {
display: inline-block;
width: 80%;
height: 38px;
margin-top: 2px;
}
.box-button {
height: 38px;
margin-top: 2px;
}
</style>
+84 -14
View File
@@ -39,7 +39,7 @@
<span :class="{'title-text-text':false}">{{item.name}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.attrModel">
<a-date-picker class="box-input" v-model="formInline[item.attrModel]" @change="onChange"
<a-date-picker class="box-input" v-model="formInline[item.attrModel]"
style="width: 100%"/>
</a-form-model-item>
</div>
@@ -53,7 +53,7 @@
<span :class="{'title-text-text':false}">{{item.name}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.attrModel">
<a-input-number class="box-input" v-model="formInline[item.attrModel]" :min="1" :max="99999999" @change="onChange" />
<a-input-number class="box-input" v-model="formInline[item.attrModel]" :min="1" :max="99999999"/>
</a-form-model-item>
</div>
</a-col>
@@ -81,8 +81,8 @@
</div>
<a-form-model-item class="itemModel" :prop="item.attrModel">
<j-multi-select-tag class="box-input" v-model="formInline[item.attrModel]"
:placeholder="$t('selectStatus')" :type="'select'"
:triggerChange="false" dictCode="valid_status"/>
:placeholder="$t('selectStatus')" :type="'select'"
:triggerChange="false" dictCode="valid_status"/>
</a-form-model-item>
</div>
</a-col>
@@ -108,20 +108,57 @@
<span :class="{'title-text-text':false}">{{item.name}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.attrModel">
<a-textarea :placeholder="$t('selectStatus')" v-model="formInline[item.attrModel]" :rows="4" />
<a-textarea :placeholder="$t('selectStatus')" v-model="formInline[item.attrModel]" :rows="4"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="24" v-else-if="item.type === 'FILE'">
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.attrModel">
<a-button type="primary" style="height: 38px;width: calc(50% - 80px);line-height: 38px"
@click="clickButtonToUpload(item.attrModel)">
{{ (formInline[item.attrModel] === 'null' || formInline[item.attrModel] === '' ||
formInline[item.attrModel] == null) ? '上传文件' : '查看已上传文件'
}}
</a-button>
</a-form-model-item>
</div>
</a-col>
<a-col :span="24" v-else-if="item.type === 'STANDARD'">
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.attrModel">
<Standardselection :query="item" v-model="formInline[item.attrModel]"/>
</a-form-model-item>
</div>
</a-col>
</div>
</a-row>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile>
</a-form-model>
</a-spin>
</template>
<script>
import uploadFile from '@/components/uploadFile/file'
import Standardselection from '@/components/Standardselection/index'
export default {
name: 'index',
components: {
uploadFile,
Standardselection
},
props: {
url: {
type: Object,
@@ -178,7 +215,7 @@
enName: 'title',
placeholder: '请输入标题',
attrModel: 'checkbox',
validStatus:'valid_status',
validStatus: 'valid_status'
},
{
id: 5,
@@ -187,7 +224,7 @@
enName: 'title',
placeholder: '请输入标题',
attrModel: 'radio',
validStatus:'valid_status',
validStatus: 'valid_status'
},
{
id: 6,
@@ -195,7 +232,7 @@
name: '下拉多选',
enName: 'title',
placeholder: '请输入标题',
validStatus:'valid_status',
validStatus: 'valid_status',
attrModel: 'selectAll'
},
{
@@ -213,10 +250,27 @@
enName: 'title',
placeholder: '请输入文本框',
attrModel: 'number'
},
{
id: 9,
type: 'FILE',
name: '上传文件',
enName: 'UploadFile',
placeholder: '请输入文本框',
attrModel: 'file'
},
{
id: 10,
type: 'STANDARD',
name: '标准选择',
enName: 'standard',
placeholder: '请手动输入或者选择标准',
attrModel: 'standard'
}
],
validatorRules: {},
confirmLoading: false
confirmLoading: false,
uploadName: ''
}
},
mounted() {
@@ -225,7 +279,6 @@
},
methods: {
sumber() {
console.log(1)
this.$refs.ruleForm.validate(valid => {
if (valid) {
alert('submit!')
@@ -234,7 +287,22 @@
return false
}
})
}
},
clickButtonToUpload(current) {
this.$refs.uploadFile.visible = true
this.uploadName = current
},
/** 上传文件的回调 */
uploadSuccess(data) {
console.log(data)
let attIdList = []
data.map(item => {
attIdList.push(item.id || data.name)
})
/** 赋值给当前对应的表单文件 */
this.formInline[this.uploadName] = attIdList.join(',')
this.formInline = { ...this.formInline }
},
}
}
</script>
@@ -268,10 +336,12 @@
line-height: 38px;
height: 38px;
}
.box-input .ant-select-selection--multiple .ant-select-selection__rendered > ul > li{
margin-top:6px;
.box-input .ant-select-selection--multiple .ant-select-selection__rendered > ul > li {
margin-top: 6px;
}
.box-input .ant-input-number-input-wrap{
.box-input .ant-input-number-input-wrap {
line-height: 38px;
height: 38px;
}
+203
View File
@@ -0,0 +1,203 @@
<template>
<div>
<a-modal v-model="visible" :maskClosable="false" :footer="[]" :title="title">
<a-upload-dragger
accept='*.*'
:disabled="disabled"
class="ant-upload-list"
name="file"
:file-list="myfileList"
:multiple="true"
:action = 'uploadAction'
:headers="headers"
:before-upload="beforeUpload"
:remove='remove'
@change="handleChange">
<p><a-icon style="font-size: 67px;color: #c0c4cc;" type="cloud-upload" /></p>
<p class="ant-upload-text" style="font-size: 14px;line-height: 30px">点击上传</p>
</a-upload-dragger>
</a-modal>
</div>
</template>
<script>
import Vue from 'vue'
import { ACCESS_TOKEN } from "@/store/mutation-types"
export default {
name: 'file',
props:['disableds','disabled','thisFileUploadUrl','readonly','thisFileType'],
data(){
return{
visible:false,
title:'上传文件',
uploadAction:window._CONFIG['domianURL']+"/sys/common/upload",
myuploadAction:window._CONFIG['domianURL']+this.thisFileUploadUrl,
upDataList:[],
downLoadFileUrl:window._CONFIG['domianURL']+'/sys/common/static',
fileList:[],
myfileList:[],
isLoding:false,
}
},
created(){
const token = Vue.ls.get(ACCESS_TOKEN);
this.headers = {"X-Access-Token":token};
this.containerId = 'container-ty-'+new Date().getTime();
},
mounted(){
// console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl);
},
methods:{
perentHandleFunc(data){
this.myfileList = data
this.fileList = data
if (data && data.length > 0){
this.myfileList.forEach((res)=>{
res.name = res.fileName
res.uid = res.id
})
}else {
this.myfileList = []
this.fileList = []
}
},
beforeUpload(file) {
console.log(file)
// let thisFileType = this.thisFileType.replace(/\s+/g, "");
this.fileTypeSatus = true;
//TODO 客户要求不拦截文件
// if(file.type){
// if (thisFileType.indexOf(file.type) != -1) {
// this.fileTypeSatus = true;
// }else{
// this.fileTypeSatus = false;
// }
// }else{
// if(file.name.slice(file.name.length - 3 , file.name.length) == 'rar'){
// this.fileTypeSatus = true
// }else if(file.type == 'application/x-zip-compressed'){
// this.fileTypeSatus = true
// }else{
// this.fileTypeSatus = false;
// }
// }
this.$message.destroy()
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
this.errorMessage = file.name + "文件大小超出100MB限制, 请压缩或降低文件质量!";
},
remove(){
this.fileTypeSatus = true;
},
mydownload(item){
var fileName = item.fileName;
downFile(this.downLoadFileUrl+'/'+item.ext1,{}).then((data)=>{
if (!data) {
this.$message.destroy()
this.$message.warning("文件下载失败")
return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName)
}else{
let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
let link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', fileName)
document.body.appendChild(link)
link.click()
document.body.removeChild(link); //下载完成移除元素
window.URL.revokeObjectURL(url); //释放掉blob对象
}
})
},
mypreview(item){
console.log(item);
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + encodeURIComponent(this.downLoadFileUrl+'/'+item.ext1)
window.open(url, '_blank')
},
handleChange(info) {
let { file } = info;
const status = info.file.status;
info.fileList.forEach((val,index)=>{
if(val.response && !val.response.result){
this.$message.error(val.response.message);
info.fileList.splice(index,1)
}
})
if (this.fileTypeSatus) {
if (file.size > 100000000) {
this.$message.error(this.errorMessage)
return
}else {
if (status === 'error') {
this.$emit('uploadSuccess', this.fileList)
this.$message.destroy()
this.$message.error(`${info.file.name} 文件上传失败。`);
} else if (status === 'removed') {
this.myfileList = info.fileList;
this.fileList = []
this.myfileList.forEach((res) => {
if (res.response) {
this.fileList.push(res.response.result)
} else {
this.fileList.push(res)
}
})
this.$emit('uploadSuccess', this.fileList)
if(this.myfileList.length > 0){
this.$message.destroy()
this.$message.success(`${info.file.name} 删除成功。`);
}
} else if (status === 'done') {
this.fileList = []
this.myfileList = info.fileList;
if (info.fileList.length > 20) {
info.fileList.splice(20)
this.myfileList = info.fileList;
this.myfileList.forEach((res) => {
if (res.response) {
this.fileList.push(res.response.result)
} else {
this.fileList.push(res)
}
})
this.$emit('uploadSuccess', this.fileList)
this.$message.destroy()
this.$message.error('最多只能上传二十个');
return
}
this.myfileList.forEach((res) => {
if (res.response) {
this.fileList.push(res.response.result)
} else {
this.fileList.push(res)
}
})
this.$emit('uploadSuccess', this.fileList)
if(this.myfileList.length > 0){
this.$message.destroy()
this.$message.success(`${info.file.name} 文件上传成功。`);
}
} else if (status === 'uploading') {
this.myfileList = info.fileList;
this.$emit('uploadSuccess')
// this.$message.success(`${info.file.name} 文件上传成功。`);
}
}
}else{
this.$message.warning('不支持上传该类型的文件!')
}
},
resetFileList(){
this.myfileList = [];
this.fileList = [];
},
},
}
</script>
<style scoped>
</style>