Merge remote-tracking branch 'origin/master'
This commit is contained in:
+1
-1
@@ -123,7 +123,7 @@
|
||||
<select id="getFieldList" resultType="com.jero.generater.modules.online.cgform.entity.OnlCgformField">
|
||||
select * from onl_cgform_field ocf
|
||||
left join onl_cgform_head och on ocf.cgform_head_id = och.id
|
||||
where table_name =#{tableName} and is_delete = 0
|
||||
where table_name =#{tableName} and ocf.is_delete = 0
|
||||
order by order_num asc
|
||||
</select>
|
||||
|
||||
|
||||
+13
@@ -183,6 +183,19 @@ public class SysDictController {
|
||||
return Result.OK(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部字典数据(中英文切换)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "字典控制器-获取全部字典数据", notes = "字典控制器-获取全部字典数据")
|
||||
@RequestMapping(value = "/queryAllDictItemsByCut", method = RequestMethod.GET)
|
||||
public Result<?> queryAllDictItemsByCut(HttpServletRequest request,String cut) {
|
||||
Map<String, List<DictModel>> res = new HashMap<String, List<DictModel>>();
|
||||
res = sysDictService.queryAllDictItemsByCut(cut);
|
||||
return Result.OK(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典数据
|
||||
* @param dictCode
|
||||
|
||||
+1
@@ -23,6 +23,7 @@ public interface ISysDictService extends IService<SysDict> {
|
||||
public List<DictModel> queryDictItemsByCode(String code);
|
||||
|
||||
public Map<String,List<DictModel>> queryAllDictItems();
|
||||
public Map<String,List<DictModel>> queryAllDictItemsByCut(String cut);
|
||||
|
||||
@Deprecated
|
||||
List<DictModel> queryTableDictItemsByCode(String table, String text, String code);
|
||||
|
||||
+26
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.CacheConstant;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.system.vo.DictModel;
|
||||
import com.jero.common.system.vo.DictQuery;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
@@ -88,6 +89,31 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<DictModel>> queryAllDictItemsByCut(String cut) {
|
||||
Map<String, List<DictModel>> res = new HashMap<String, List<DictModel>>();
|
||||
List<SysDict> ls = sysDictMapper.selectList(null);
|
||||
LambdaQueryWrapper<SysDictItem> queryWrapper = new LambdaQueryWrapper<SysDictItem>();
|
||||
queryWrapper.eq(SysDictItem::getStatus, 1);
|
||||
queryWrapper.orderByAsc(SysDictItem::getSortOrder);
|
||||
List<SysDictItem> sysDictItemList = sysDictItemMapper.selectList(queryWrapper);
|
||||
for (SysDict d : ls) {
|
||||
List<DictModel> dictModelList = sysDictItemList.stream().filter(s -> d.getId().equals(s.getDictId())).map(item -> {
|
||||
DictModel dictModel = new DictModel();
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
dictModel.setText(item.getItemText());
|
||||
}else{
|
||||
dictModel.setText(item.getEnName());
|
||||
}
|
||||
dictModel.setValue(item.getItemValue());
|
||||
return dictModel;
|
||||
}).collect(Collectors.toList());
|
||||
res.put(d.getDictCode(), dictModelList);
|
||||
}
|
||||
log.debug("-------登录加载系统字典-----" + res.toString());
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过查询指定code 获取字典值text
|
||||
* @param code
|
||||
|
||||
+86
-15
@@ -419,7 +419,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
dataList.get(0).entrySet().forEach(entry -> {
|
||||
if (fieldPullList.contains(entry.getKey())) {
|
||||
//下拉选处理数据字典
|
||||
dictItem(sysDictItems, entry, onlCgformFieldList);
|
||||
dictItem(sysDictItems, entry, onlCgformFieldList,cut);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -614,6 +614,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
* @param map
|
||||
*/
|
||||
public void updateInfo(Map<String, Object> map) {
|
||||
String cut = (String) map.get("cut");
|
||||
if (ObjectUtils.isNotEmpty(map.get("replace_standard_id"))) {
|
||||
map.put("replace_standard", map.get("replace_standard_id"));
|
||||
}
|
||||
@@ -642,7 +643,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
queryWrapper.eq(BussDocumentLibraryEO::getId, id);
|
||||
List<Map<String, Object>> dataList = bussDocumentLibraryEOMapper.selectMaps(queryWrapper);
|
||||
//更新log
|
||||
updateLog(map, dataList, fieldList, fieldDateList, fieldFileList, fieldPullList);
|
||||
updateLog(map, dataList, fieldList, fieldDateList, fieldFileList, fieldPullList,cut);
|
||||
//判断该条数据是否订阅
|
||||
|
||||
|
||||
@@ -742,7 +743,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
List<OnlCgformField> fieldList,
|
||||
List<OnlCgformField> fieldDateList,
|
||||
List<OnlCgformField> fieldFileList,
|
||||
List<OnlCgformField> fieldPullList) {
|
||||
List<OnlCgformField> fieldPullList,
|
||||
String cut) {
|
||||
Map<String, Object> mapTemp = new HashMap<>();
|
||||
mapCopy(map, mapTemp);
|
||||
//时间类型的字段
|
||||
@@ -760,14 +762,14 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
.filter(e -> entry.getKey().equals(e.getDictField()))
|
||||
.collect(Collectors.toList());
|
||||
//下拉选处理数据字典
|
||||
dictItem(sysDictItems, entry, collect);
|
||||
dictItem(sysDictItems, entry, collect,cut);
|
||||
}
|
||||
for (Map.Entry<String, Object> entry : mapTemp.entrySet()) {
|
||||
List<OnlCgformField> collect = fieldPullList.stream()
|
||||
.filter(e -> entry.getKey().equals(e.getDictField()))
|
||||
.collect(Collectors.toList());
|
||||
//下拉选处理数据字典
|
||||
dictItem(sysDictItems, entry, collect);
|
||||
dictItem(sysDictItems, entry, collect,cut);
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
@@ -992,7 +994,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
String fieldStr = fieldSb.substring(0, fieldSb.length() - 1);
|
||||
|
||||
String field = " bdl.id,bdl.serial_number,bdl.title,bdl.state,of.file_name,of.connect_id," + fieldStr
|
||||
String field = " of.id,bdl.serial_number,bdl.title,bdl.state,of.file_name,of.connect_id," + fieldStr
|
||||
+ " from oss_file of join buss_document_library bdl" + join.toString();
|
||||
|
||||
//查询条件
|
||||
@@ -1058,6 +1060,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
|
||||
public IPage getInfoPage(Map<String, Object> parameter) {
|
||||
String cut = (String) parameter.get("cut");//中英文切换标识
|
||||
//需要查询的字段
|
||||
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList("1");
|
||||
if (fieldList.size() != 0) {
|
||||
@@ -1100,7 +1103,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
.filter(e -> entry.getKey().equals(e.getDictField()))
|
||||
.collect(Collectors.toList());
|
||||
//下拉选处理数据字典
|
||||
dictItem(sysDictItems, entry, collect);
|
||||
dictItem(sysDictItems, entry, collect,cut);
|
||||
}
|
||||
}
|
||||
//收藏和订阅
|
||||
@@ -1218,13 +1221,14 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
* @param entry
|
||||
* @param collect
|
||||
*/
|
||||
private void dictItem(List<SysDictItem> sysDictItems, Map.Entry<String, Object> entry, List<OnlCgformField> collect) {
|
||||
private void dictItem(List<SysDictItem> sysDictItems, Map.Entry<String, Object> entry, List<OnlCgformField> collect,String cut) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
//通过dictField判断字段是否为下拉选(不为空则为下拉选)
|
||||
if (collect.size() != 0 && StringUtils.isNotBlank(collect.get(0).getDictField())) {
|
||||
String value = (String) entry.getValue();
|
||||
//数据字典中文
|
||||
List<String> dictItemsCh = new ArrayList<>();
|
||||
List<String> dictItemsEn = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
for (String itemValue : value.split(",")) {
|
||||
//字段的数据字典
|
||||
@@ -1236,13 +1240,23 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
.filter(e -> itemValue.equals(e.getItemValue()))
|
||||
.collect(Collectors.toList());
|
||||
if (dictItems.size() != 0) {
|
||||
List<String> itemText = dictItems.stream().map(SysDictItem::getItemText).collect(Collectors.toList());
|
||||
List<String> itemText = new ArrayList<>();
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
itemText = dictItems.stream().map(SysDictItem::getItemText).collect(Collectors.toList());
|
||||
}else {
|
||||
itemText = dictItems.stream().map(SysDictItem::getEnName).collect(Collectors.toList());
|
||||
}
|
||||
dictItemsCh.addAll(itemText);
|
||||
dictItemsEn.addAll(itemText);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
entry.setValue(StringUtils.join(dictItemsCh, ","));
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
entry.setValue(StringUtils.join(dictItemsCh, ","));
|
||||
}else{
|
||||
entry.setValue(StringUtils.join(dictItemsEn, ","));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1330,6 +1344,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
*/
|
||||
@Override
|
||||
public void exportExcel(Map<String, Object> map, HttpServletResponse response, HttpServletRequest request) {
|
||||
String cut = (String) map.get("cut");
|
||||
//String flag = "file"为带文件导出标识
|
||||
String flag = (String) map.get("flag");
|
||||
// String flag = "file";
|
||||
@@ -1359,8 +1374,11 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
if (!"file".equals(flag)) {
|
||||
fieldListTemp = fieldListTemp.stream().filter(e -> !FieldTypeEnum.FILE.getValue().equals(e.getFieldShowType())).collect(Collectors.toList());
|
||||
}
|
||||
headerFieldList = fieldListTemp.stream().map(OnlCgformField::getDbFieldTxt).collect(Collectors.toList());
|
||||
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
headerFieldList = fieldListTemp.stream().map(OnlCgformField::getDbFieldTxt).collect(Collectors.toList());
|
||||
}else{
|
||||
headerFieldList = fieldListTemp.stream().map(OnlCgformField::getDbFieldEnName).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
//查询字段
|
||||
List<String> conditionFieldList = fieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
@@ -1368,6 +1386,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
String condition = getConditionStr(map);
|
||||
//导出数据(全部导出的数据)
|
||||
List<Map<String, Object>> datas = bussDocumentLibraryEOMapper.getInfoList(" " + StringUtils.join(conditionFieldList, ","), condition);
|
||||
//处理对应标准,代替标准,被代替标准(由id转中文)
|
||||
getStandard(datas);
|
||||
//部分导出
|
||||
String partId = (String) map.get("id");
|
||||
if (StringUtils.isNotBlank(partId)) {
|
||||
@@ -1380,7 +1400,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
String header = StringUtils.join(headerFieldList, ",");
|
||||
createHeader(workbook, sheet, header);
|
||||
// 创建数据
|
||||
createDatas(workbook, sheet, datas, header, fieldListTemp);
|
||||
createDatas(workbook, sheet, datas, header, fieldListTemp,cut);
|
||||
|
||||
if (!"file".equals(flag)) {
|
||||
//不带文件导出
|
||||
@@ -1453,7 +1473,58 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
}
|
||||
|
||||
public void createDatas(Workbook workbook, Sheet sheet, List<Map<String, Object>> datas, String header, List<OnlCgformField> fieldList) {
|
||||
/**
|
||||
* 处理对应标准,代替标准,被代替标准(由id转中文)
|
||||
* @param datas
|
||||
*/
|
||||
private void getStandard(List<Map<String, Object>> datas) {
|
||||
List<Map<String, Object>> datasTemp = new ArrayList<>();
|
||||
for (Map<String, Object> data : datas) {
|
||||
Map<String,Object> mapTemp = new HashMap<>();
|
||||
mapCopy(data,mapTemp);
|
||||
datasTemp.add(mapTemp);
|
||||
}
|
||||
for (Map<String, Object> data : datas) {
|
||||
String idTemp = (String) data.get("id");
|
||||
String correspondingStandard = (String) data.get("corresponding_standard");
|
||||
String replaceStandard = (String) data.get("replace_standard");
|
||||
StringBuilder correspondingStandardSb = new StringBuilder();
|
||||
StringBuilder replaceStandardSb = new StringBuilder();
|
||||
StringBuilder replacedStandardSb = new StringBuilder();
|
||||
datasTemp.forEach(entry->{
|
||||
String id = (String) entry.get("id");
|
||||
String replaceStandardTemp = (String) entry.get("replace_standard");
|
||||
//对应标准
|
||||
if(StringUtils.isNotBlank(correspondingStandard) && correspondingStandard.contains(id)){
|
||||
correspondingStandardSb.append((String) entry.get("serial_number")+",");
|
||||
}
|
||||
//代替标准
|
||||
if(StringUtils.isNotBlank(replaceStandard) && replaceStandard.contains(id)){
|
||||
replaceStandardSb.append((String) entry.get("serial_number")+",");
|
||||
}
|
||||
//被代替标准
|
||||
if(StringUtils.isNotBlank(replaceStandardTemp) && replaceStandardTemp.contains(idTemp)){
|
||||
replacedStandardSb.append((String) entry.get("serial_number")+",");
|
||||
}
|
||||
});
|
||||
//对应标准
|
||||
if(StringUtils.isNotBlank(correspondingStandardSb)){
|
||||
String correspondingStandardStr = correspondingStandardSb.substring(0, correspondingStandardSb.length() - 1);
|
||||
data.put("corresponding_standard",correspondingStandardStr);
|
||||
}
|
||||
//代替标准
|
||||
if(StringUtils.isNotBlank(replaceStandardSb)){
|
||||
String replaceStandardStr = replaceStandardSb.substring(0, replaceStandardSb.length() - 1);
|
||||
data.put("replace_standard",replaceStandardStr);
|
||||
}
|
||||
if(StringUtils.isNotBlank(replacedStandardSb)){
|
||||
String replacedStandardStr = replacedStandardSb.substring(0, replacedStandardSb.length() - 1);
|
||||
data.put("replaced_standard",replacedStandardStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void createDatas(Workbook workbook, Sheet sheet, List<Map<String, Object>> datas, String header, List<OnlCgformField> fieldList,String cut) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
CellStyle cellStyle = workbook.createCellStyle();//初始化单元格格式对象
|
||||
cellStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
@@ -1485,7 +1556,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
.filter(e -> entry.getKey().equals(e.getDictField()))
|
||||
.collect(Collectors.toList());
|
||||
//下拉选处理数据字典
|
||||
dictItem(sysDictItems, entry, collect);
|
||||
dictItem(sysDictItems, entry, collect,cut);
|
||||
}
|
||||
Row row = sheet.createRow(i + 1);
|
||||
i++;
|
||||
|
||||
@@ -94,7 +94,7 @@ module.exports = {
|
||||
newUser:'new user',
|
||||
ExistingUsers:'Existing users',
|
||||
total:'total',
|
||||
strip:'',
|
||||
strip:'data',
|
||||
RoleCode:'Role code',
|
||||
createTime:'create time',
|
||||
userName:'user name',
|
||||
@@ -386,4 +386,18 @@ module.exports = {
|
||||
DocumentLibrary:'Document Library',
|
||||
DocumentComparisonLibrary:'Document comparison Library',
|
||||
weekly:'weekly',
|
||||
SyncLibrary:'Sync to document library',
|
||||
check:'check',
|
||||
enName:'English name',
|
||||
selectLeastOne:'Please select at least one piece of data',
|
||||
sureVerified:'Are you sure this file is not verified?',
|
||||
sureSynchronize:'The file has not been verified. Are you sure you want to synchronize to the document library?',
|
||||
UploadFile:'Upload file',
|
||||
TagItemManagement:'Tag item management',
|
||||
LabelContentManagement:'Label content management',
|
||||
InputBoxType:'Input box type',
|
||||
DropDownType:'Drop down type',
|
||||
ExhibitionAreaManagement:'Exhibition area management',
|
||||
NewLabelItem:'New label item',
|
||||
|
||||
}
|
||||
@@ -390,4 +390,18 @@ module.exports = {
|
||||
DocumentLibrary:'文档库',
|
||||
DocumentComparisonLibrary:'文档对比库',
|
||||
weekly:'周报',
|
||||
SyncLibrary:'同步至文档库',
|
||||
check:'校核',
|
||||
enName:'英文名称',
|
||||
selectLeastOne:'请选择至少一条数据',
|
||||
sureVerified:'确定对该文件未进行校验?',
|
||||
sureSynchronize:'该文件未进行校验,确定要同步至文档库?',
|
||||
UploadFile:'上传文件',
|
||||
TagItemManagement:'标签项管理',
|
||||
LabelContentManagement:'标签内容管理',
|
||||
InputBoxType:'输入框类型',
|
||||
DropDownType:'下拉选类型',
|
||||
ExhibitionAreaManagement:'展示区域管理',
|
||||
NewLabelItem:'新增标签项',
|
||||
|
||||
}
|
||||
@@ -0,0 +1,225 @@
|
||||
<template>
|
||||
<div style="height: 100%">
|
||||
<div class="box">
|
||||
<a-table
|
||||
class="table"
|
||||
rowKey="id"
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||
:pagination="false"
|
||||
:scroll="{x: true}"
|
||||
:data-source="dataSource"
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
@change="tableOnChange"
|
||||
>
|
||||
<span slot="operation" slot-scope="record">
|
||||
<a class="text" v-for="(ol,index) in OperationList"
|
||||
@click="OperationClick(ol,record)">
|
||||
{{ol.text}}
|
||||
</a>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
<div class="page" v-if="dataSource.length > 0">
|
||||
<a-pagination
|
||||
:show-total="total => $t('total')+` ${total} ` +$t('strip')"
|
||||
show-quick-jumper
|
||||
show-size-changer
|
||||
:page-size.sync="pageSize"
|
||||
:total="total"
|
||||
@change="onChange"
|
||||
@showSizeChange="SizeChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import eventBUs from '../../common/event'
|
||||
import { getAction, postAction } from '@/api/manage'
|
||||
|
||||
export default {
|
||||
name: 'coTable',
|
||||
props: {
|
||||
//接口
|
||||
url: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
// 操作按钮
|
||||
OperationList: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
flag: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
//是否显示操作;默认不显示
|
||||
showAction: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
jsonBody: [],
|
||||
checkboxList: [],
|
||||
tableAll: false,
|
||||
indeterminate: false,
|
||||
columns: [],
|
||||
selectedRowKeys: [],
|
||||
dataSource: [],
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
searchParmes: {},
|
||||
loading: false,
|
||||
orderBy: '1',
|
||||
orderByField: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
eventBUs.$on('searchQuery', search => {
|
||||
Object.keys(search).forEach(res => {
|
||||
if (search[res] instanceof Array) {
|
||||
search[res] = search[res].join(',')
|
||||
}
|
||||
})
|
||||
this.searchParmes = search
|
||||
this.getData()
|
||||
this.getTableList()
|
||||
})
|
||||
eventBUs.$on('searchReset', target => {
|
||||
this.searchParmes = {}
|
||||
this.getData()
|
||||
this.getTableList()
|
||||
})
|
||||
this.getData()
|
||||
this.getTableList()
|
||||
},
|
||||
methods: {
|
||||
|
||||
getTextWith(text, fontStyle) {
|
||||
var canvas = document.createElement('canvas')
|
||||
var context = canvas.getContext('2d')
|
||||
context.font = fontStyle || '14px' // 设置字体样式
|
||||
var dimension = context.measureText(text)
|
||||
return dimension.width + 70
|
||||
},
|
||||
getData() {
|
||||
let params = {
|
||||
flag: this.flag
|
||||
}
|
||||
getAction(this.url.tableHeader, params).then((res) => {
|
||||
if (res.success) {
|
||||
var jsonHead = res.result
|
||||
this.columns = []
|
||||
jsonHead.forEach((res, index) => {
|
||||
this.columns.push({
|
||||
title: res.db_field_txt,
|
||||
dataIndex: res.db_field_name,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
sorter: res.sort
|
||||
})
|
||||
if (res.click) {
|
||||
this.columns[index].scopedSlots = {
|
||||
customRender: 'detailClick'
|
||||
}
|
||||
} else {
|
||||
this.columns[index].scopedSlots = {
|
||||
customRender: 'detailText'
|
||||
}
|
||||
}
|
||||
})
|
||||
let width = 0
|
||||
if (this.OperationList.length > 0) {
|
||||
for (let i = 0; i < this.OperationList.length; i++) {
|
||||
width += this.getTextWith(this.OperationList[i].text)
|
||||
}
|
||||
}
|
||||
if (this.showAction) {
|
||||
this.columns.push({
|
||||
title: this.$t('operation'),
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
width: width,
|
||||
scopedSlots: { customRender: 'operation' }
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
tableOnChange(pagination, filters, sorter) {
|
||||
this.orderBy = sorter.order == 'ascend' ? '1' : '2'
|
||||
this.orderByField = sorter.columnKey
|
||||
this.getTableList()
|
||||
},
|
||||
getTableList() {
|
||||
let pageNo = JSON.parse(JSON.stringify(this.pageNo))
|
||||
let pageSize = JSON.parse(JSON.stringify(this.pageSize))
|
||||
let params = {
|
||||
...this.searchParmes,
|
||||
orderBy: this.orderBy,
|
||||
orderByField: this.orderByField,
|
||||
pageNo: pageNo + '',
|
||||
pageSize: pageSize + ''
|
||||
}
|
||||
this.loading = true
|
||||
postAction(this.url.tableList, params).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataSource = res.result.records
|
||||
this.total = res.result.total
|
||||
this.loading = false
|
||||
} else {
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
onChange(page, pageSize) {
|
||||
this.pageNo = page
|
||||
this.getTableList()
|
||||
},
|
||||
SizeChange(page, pageSize) {
|
||||
this.pageSize = pageSize
|
||||
this.getTableList()
|
||||
},
|
||||
onSelectChange(value) {
|
||||
this.selectedRowKeys = value
|
||||
this.$emit('onSelectChange', value)
|
||||
},
|
||||
OperationClick(ol, item) {
|
||||
this.$emit(ol.ClickEvent, item)
|
||||
},
|
||||
detailClick(item, index) {
|
||||
this.$emit('detailClick', item)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.table .ant-table-column-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.ant-table td {
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
.box {
|
||||
width: 100%;
|
||||
height: calc(100% - 100px);
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.text {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.page {
|
||||
text-align: right;
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -8,7 +8,7 @@
|
||||
</a-radio-group>
|
||||
|
||||
<a-select v-else-if="tagType=='select'" :getPopupContainer = "getPopupContainer" :placeholder="placeholder" :disabled="disabled" :value="getValueSting" @change="handleInput">
|
||||
<a-select-option :value="undefined">请选择</a-select-option>
|
||||
<a-select-option :value="undefined">{{$t('pleaseSelect')}}</a-select-option>
|
||||
<a-select-option v-for="(item, key) in dictOptions" :key="key" :value="item.value">
|
||||
<span style="display: inline-block;width: 100%" :title=" item.text || item.label ">
|
||||
{{ item.text || item.label }}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<a-col :span="24" v-if="item.field_show_type === '1'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -21,7 +21,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === '2'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -37,7 +37,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === '5'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -54,7 +54,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === '6'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -69,7 +69,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === '2'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -84,7 +84,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === '3'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -100,7 +100,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === '4'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -116,7 +116,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === 'RADIO'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -131,7 +131,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === '8'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -145,7 +145,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === 'treeSelect'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -164,7 +164,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === '7'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -172,7 +172,7 @@
|
||||
<a-button type="primary" class="button-text"
|
||||
@click="clickButtonToUpload(item.db_field_name)">
|
||||
{{ (formInline[item.db_field_name] === 'null' || formInline[item.db_field_name] === '' ||
|
||||
formInline[item.db_field_name] == null) ? '点击上传' : '查看已上传文件'
|
||||
formInline[item.db_field_name] == null) ? $t('clickUpload') : $t('viewUploadedFiles')
|
||||
}}
|
||||
</a-button>
|
||||
</a-form-model-item>
|
||||
@@ -182,7 +182,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === '9'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
@@ -196,7 +196,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === '10'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -271,7 +271,9 @@
|
||||
},
|
||||
methods: {
|
||||
sumber() {
|
||||
console.log('vilidate',this.$refs.ruleForm1)
|
||||
this.$refs.ruleForm1.validate(valid => {
|
||||
console.log('va',valid)
|
||||
if (valid) {
|
||||
let url = ''
|
||||
if (this.formInline.id) {
|
||||
@@ -321,8 +323,8 @@
|
||||
let rules = {}
|
||||
this.ruleList.forEach((res, index) => {
|
||||
const rule = []
|
||||
if (res.field_must_input == 0) {
|
||||
if (res.field_show_type === 'text') {
|
||||
if (res.field_must_input == 1) {
|
||||
if (res.field_show_type === '1') {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.db_field_txt + '不能为空',
|
||||
@@ -347,7 +349,13 @@
|
||||
message: res.db_field_txt + '不能为空',
|
||||
trigger: 'blur'
|
||||
})
|
||||
} else if (res.field_show_type === 'RADIO' || res.field_show_type === 'list') {
|
||||
} else if (res.field_show_type === 'RADIO' || res.field_show_type === '3') {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.db_field_txt + '不能为空',
|
||||
trigger: 'change'
|
||||
})
|
||||
}else if (res.field_show_type === '7') {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.db_field_txt + '不能为空',
|
||||
@@ -363,6 +371,7 @@
|
||||
this.$set(this, 'rules', rules)
|
||||
this.isFormInline = true
|
||||
this.confirmLoading = false
|
||||
console.log('rules',rules,this)
|
||||
},
|
||||
getForm() {
|
||||
this.confirmLoading = true
|
||||
|
||||
@@ -0,0 +1,245 @@
|
||||
<template>
|
||||
<div style="height: 100%">
|
||||
<div class="box">
|
||||
<a-table
|
||||
class="table"
|
||||
rowKey="id"
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||
:pagination="false"
|
||||
:scroll="{x: true}"
|
||||
:data-source="dataSource"
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
@change="tableOnChange"
|
||||
>
|
||||
<span slot="operation" slot-scope="record">
|
||||
<a class="text" v-for="(ol,index) in OperationList"
|
||||
@click="OperationClick(ol,record)">
|
||||
<span v-if="ol.text==$t('SyncLibrary')">
|
||||
{{record.resultContent=='转换成功'&&record.syncState=='未同步'?ol.text:''}}
|
||||
</span>
|
||||
<span v-if="ol.text==$t('check')">
|
||||
{{record.resultContent=='转换成功'&&record.syncState=='未同步'?ol.text:''}}
|
||||
</span>
|
||||
<span v-if="ol.text==$t('download')">
|
||||
{{record.resultContent=='转换成功'?ol.text:''}}
|
||||
</span>
|
||||
<span v-if="ol.text==$t('delete')">
|
||||
{{record.resultContent=='转换成功'?ol.text:''}}
|
||||
</span>
|
||||
</a>
|
||||
</span>
|
||||
<!-- <span slot="detailClick" slot-scope="text,record">-->
|
||||
<!-- <a class="text" :title="text" @click="detailClick(record)">{{text}}</a>-->
|
||||
<!-- </span>-->
|
||||
<!-- <span slot="detailText" slot-scope="text,record">-->
|
||||
<!-- <span class="text" :title="text">-->
|
||||
<!-- {{text.length > 18?text.slice(0,17)+'...':text}}-->
|
||||
<!-- </span>-->
|
||||
<!-- </span>-->
|
||||
|
||||
</a-table>
|
||||
</div>
|
||||
<div class="page" v-if="dataSource.length > 0">
|
||||
<a-pagination
|
||||
:show-total="total => $t('total')+` ${total} ` +$t('strip')"
|
||||
show-quick-jumper
|
||||
show-size-changer
|
||||
:page-size.sync="pageSize"
|
||||
:total="total"
|
||||
@change="onChange"
|
||||
@showSizeChange="SizeChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import eventBUs from '../../common/event'
|
||||
import { getAction, postAction } from '@/api/manage'
|
||||
|
||||
export default {
|
||||
name: 'docTable',
|
||||
props: {
|
||||
//接口
|
||||
url: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
// 操作按钮
|
||||
OperationList: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
flag: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
//是否显示操作;默认不显示
|
||||
showAction: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
jsonBody: [],
|
||||
checkboxList: [],
|
||||
tableAll: false,
|
||||
indeterminate: false,
|
||||
columns: [],
|
||||
selectedRowKeys: [],
|
||||
dataSource: [],
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
searchParmes: {},
|
||||
loading: false,
|
||||
orderBy: '1',
|
||||
orderByField: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
eventBUs.$on('searchQuery', search => {
|
||||
Object.keys(search).forEach(res => {
|
||||
if (search[res] instanceof Array) {
|
||||
search[res] = search[res].join(',')
|
||||
}
|
||||
})
|
||||
this.searchParmes = search
|
||||
this.getData()
|
||||
this.getTableList()
|
||||
})
|
||||
eventBUs.$on('searchReset', target => {
|
||||
this.searchParmes = {}
|
||||
this.getData()
|
||||
this.getTableList()
|
||||
})
|
||||
this.getData()
|
||||
this.getTableList()
|
||||
},
|
||||
methods: {
|
||||
|
||||
getTextWith(text, fontStyle) {
|
||||
var canvas = document.createElement('canvas')
|
||||
var context = canvas.getContext('2d')
|
||||
context.font = fontStyle || '14px' // 设置字体样式
|
||||
var dimension = context.measureText(text)
|
||||
return dimension.width + 40
|
||||
},
|
||||
getData() {
|
||||
let params = {
|
||||
flag: this.flag
|
||||
}
|
||||
getAction(this.url.tableHeader, params).then((res) => {
|
||||
if (res.success) {
|
||||
var jsonHead = res.result
|
||||
this.columns = []
|
||||
jsonHead.forEach((res, index) => {
|
||||
this.columns.push({
|
||||
title: res.db_field_txt,
|
||||
dataIndex: res.db_field_name,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
sorter: res.sort
|
||||
})
|
||||
if (res.click) {
|
||||
this.columns[index].scopedSlots = {
|
||||
customRender: 'detailClick'
|
||||
}
|
||||
} else {
|
||||
this.columns[index].scopedSlots = {
|
||||
customRender: 'detailText'
|
||||
}
|
||||
}
|
||||
})
|
||||
let width = 0
|
||||
if (this.OperationList.length > 0) {
|
||||
for (let i = 0; i < this.OperationList.length; i++) {
|
||||
width += this.getTextWith(this.OperationList[i].text)
|
||||
}
|
||||
}
|
||||
if (this.showAction) {
|
||||
this.columns.push({
|
||||
title: this.$t('operation'),
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
width: width,
|
||||
scopedSlots: { customRender: 'operation' }
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
tableOnChange(pagination, filters, sorter) {
|
||||
this.orderBy = sorter.order == 'ascend' ? '1' : '2'
|
||||
this.orderByField = sorter.columnKey
|
||||
this.getTableList()
|
||||
},
|
||||
getTableList() {
|
||||
let pageNo = JSON.parse(JSON.stringify(this.pageNo))
|
||||
let pageSize = JSON.parse(JSON.stringify(this.pageSize))
|
||||
let params = {
|
||||
...this.searchParmes,
|
||||
orderBy: this.orderBy,
|
||||
orderByField: this.orderByField,
|
||||
pageNo: pageNo + '',
|
||||
pageSize: pageSize + ''
|
||||
}
|
||||
this.loading = true
|
||||
postAction(this.url.tableList, params).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataSource = res.result.records
|
||||
this.total = res.result.total
|
||||
this.loading = false
|
||||
} else {
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
onChange(page, pageSize) {
|
||||
this.pageNo = page
|
||||
this.getTableList()
|
||||
},
|
||||
SizeChange(page, pageSize) {
|
||||
this.pageSize = pageSize
|
||||
this.getTableList()
|
||||
},
|
||||
onSelectChange(value,rows) {
|
||||
this.selectedRowKeys = value
|
||||
this.$emit('onSelectChange', value, rows)
|
||||
},
|
||||
OperationClick(ol, item) {
|
||||
this.$emit(ol.ClickEvent, item)
|
||||
},
|
||||
detailClick(item, index) {
|
||||
this.$emit('detailClick', item)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.table .ant-table-column-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.ant-table td {
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
.box {
|
||||
width: 100%;
|
||||
height: calc(100% - 100px);
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.text {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.page {
|
||||
text-align: right;
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,245 @@
|
||||
<template>
|
||||
<div style="height: 100%">
|
||||
<div class="box">
|
||||
<a-table
|
||||
class="table"
|
||||
rowKey="id"
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||
:pagination="false"
|
||||
:scroll="{x: true}"
|
||||
:data-source="dataSource"
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
@change="tableOnChange"
|
||||
>
|
||||
<span slot="operation" slot-scope="record">
|
||||
<a class="text" v-for="(ol,index) in OperationList"
|
||||
@click="OperationClick(ol,record)">
|
||||
<span v-if="ol.text==$t('SyncLibrary')">
|
||||
{{record.resultContent=='转换成功'&&record.syncState=='未同步'?ol.text:''}}
|
||||
</span>
|
||||
<span v-if="ol.text==$t('check')">
|
||||
{{record.resultContent=='转换成功'&&record.syncState=='未同步'?ol.text:''}}
|
||||
</span>
|
||||
<span v-if="ol.text==$t('download')">
|
||||
{{record.resultContent=='转换成功'?ol.text:''}}
|
||||
</span>
|
||||
<span v-if="ol.text==$t('delete')">
|
||||
{{record.resultContent=='转换成功'?ol.text:''}}
|
||||
</span>
|
||||
</a>
|
||||
</span>
|
||||
<span slot="detailClick" slot-scope="text,record">
|
||||
<a class="text" :title="text" @click="detailClick(record)">{{text}}</a>
|
||||
</span>
|
||||
<!-- <span slot="detailText" slot-scope="text,record">-->
|
||||
<!-- <span class="text" :title="text">-->
|
||||
<!-- {{text.length > 18?text.slice(0,17)+'...':text}}-->
|
||||
<!-- </span>-->
|
||||
<!-- </span>-->
|
||||
|
||||
</a-table>
|
||||
</div>
|
||||
<div class="page" v-if="dataSource.length > 0">
|
||||
<a-pagination
|
||||
:show-total="total => $t('total')+` ${total} ` +$t('strip')"
|
||||
show-quick-jumper
|
||||
show-size-changer
|
||||
:page-size.sync="pageSize"
|
||||
:total="total"
|
||||
@change="onChange"
|
||||
@showSizeChange="SizeChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import eventBUs from '../../common/event'
|
||||
import { getAction, postAction } from '@/api/manage'
|
||||
|
||||
export default {
|
||||
name: 'ocrTable',
|
||||
props: {
|
||||
//接口
|
||||
url: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
// 操作按钮
|
||||
OperationList: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
flag: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
//是否显示操作;默认不显示
|
||||
showAction: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
jsonBody: [],
|
||||
checkboxList: [],
|
||||
tableAll: false,
|
||||
indeterminate: false,
|
||||
columns: [],
|
||||
selectedRowKeys: [],
|
||||
dataSource: [],
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
searchParmes: {},
|
||||
loading: false,
|
||||
orderBy: '1',
|
||||
orderByField: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
eventBUs.$on('searchQuery', search => {
|
||||
Object.keys(search).forEach(res => {
|
||||
if (search[res] instanceof Array) {
|
||||
search[res] = search[res].join(',')
|
||||
}
|
||||
})
|
||||
this.searchParmes = search
|
||||
this.getData()
|
||||
this.getTableList()
|
||||
})
|
||||
eventBUs.$on('searchReset', target => {
|
||||
this.searchParmes = {}
|
||||
this.getData()
|
||||
this.getTableList()
|
||||
})
|
||||
this.getData()
|
||||
this.getTableList()
|
||||
},
|
||||
methods: {
|
||||
|
||||
getTextWith(text, fontStyle) {
|
||||
var canvas = document.createElement('canvas')
|
||||
var context = canvas.getContext('2d')
|
||||
context.font = fontStyle || '14px' // 设置字体样式
|
||||
var dimension = context.measureText(text)
|
||||
return dimension.width + 40
|
||||
},
|
||||
getData() {
|
||||
let params = {
|
||||
flag: this.flag
|
||||
}
|
||||
getAction(this.url.tableHeader, params).then((res) => {
|
||||
if (res.success) {
|
||||
var jsonHead = res.result
|
||||
this.columns = []
|
||||
jsonHead.forEach((res, index) => {
|
||||
this.columns.push({
|
||||
title: res.db_field_txt,
|
||||
dataIndex: res.db_field_name,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
sorter: res.sort
|
||||
})
|
||||
if (res.click) {
|
||||
this.columns[index].scopedSlots = {
|
||||
customRender: 'detailClick'
|
||||
}
|
||||
} else {
|
||||
this.columns[index].scopedSlots = {
|
||||
customRender: 'detailText'
|
||||
}
|
||||
}
|
||||
})
|
||||
let width = 0
|
||||
if (this.OperationList.length > 0) {
|
||||
for (let i = 0; i < this.OperationList.length; i++) {
|
||||
width += this.getTextWith(this.OperationList[i].text)
|
||||
}
|
||||
}
|
||||
if (this.showAction) {
|
||||
this.columns.push({
|
||||
title: this.$t('operation'),
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
width: width,
|
||||
scopedSlots: { customRender: 'operation' }
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
tableOnChange(pagination, filters, sorter) {
|
||||
this.orderBy = sorter.order == 'ascend' ? '1' : '2'
|
||||
this.orderByField = sorter.columnKey
|
||||
this.getTableList()
|
||||
},
|
||||
getTableList() {
|
||||
let pageNo = JSON.parse(JSON.stringify(this.pageNo))
|
||||
let pageSize = JSON.parse(JSON.stringify(this.pageSize))
|
||||
let params = {
|
||||
...this.searchParmes,
|
||||
orderBy: this.orderBy,
|
||||
orderByField: this.orderByField,
|
||||
pageNo: pageNo + '',
|
||||
pageSize: pageSize + ''
|
||||
}
|
||||
this.loading = true
|
||||
postAction(this.url.tableList, params).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataSource = res.result.records
|
||||
this.total = res.result.total
|
||||
this.loading = false
|
||||
} else {
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
onChange(page, pageSize) {
|
||||
this.pageNo = page
|
||||
this.getTableList()
|
||||
},
|
||||
SizeChange(page, pageSize) {
|
||||
this.pageSize = pageSize
|
||||
this.getTableList()
|
||||
},
|
||||
onSelectChange(value,rows) {
|
||||
this.selectedRowKeys = value
|
||||
this.$emit('onSelectChange', value, rows)
|
||||
},
|
||||
OperationClick(ol, item) {
|
||||
this.$emit(ol.ClickEvent, item)
|
||||
},
|
||||
detailClick(item, index) {
|
||||
this.$emit('detailClick', item)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.table .ant-table-column-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.ant-table td {
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
.box {
|
||||
width: 100%;
|
||||
height: calc(100% - 100px);
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.text {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.page {
|
||||
text-align: right;
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -14,7 +14,7 @@
|
||||
: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>
|
||||
<p class="ant-upload-text" style="font-size: 14px;line-height: 30px">{{$t('clickUpload')}}</p>
|
||||
</a-upload-dragger>
|
||||
</a-modal>
|
||||
</div>
|
||||
@@ -35,7 +35,7 @@
|
||||
fileList:[],
|
||||
fileTypeSatus:false,
|
||||
headers:{},
|
||||
title:'上传文件'
|
||||
title:this.$t('UploadFile')
|
||||
}
|
||||
},
|
||||
created(){
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
</span>
|
||||
<span slot="detailText" slot-scope="text,record">
|
||||
<span class="text" :title="text">
|
||||
{{text.length > 18?text.slice(0,17)+'...':text}}
|
||||
{{text && text.length > 18?text.slice(0,17)+'...':text}}
|
||||
</span>
|
||||
</span>
|
||||
|
||||
@@ -132,6 +132,7 @@
|
||||
if (res.success) {
|
||||
var jsonHead = res.result
|
||||
this.columns = []
|
||||
// res.db_field_txt
|
||||
jsonHead.forEach((res, index) => {
|
||||
this.columns.push({
|
||||
title: res.db_field_txt,
|
||||
|
||||
@@ -2,44 +2,44 @@
|
||||
<div class="user-wrapper" :class="theme">
|
||||
<!-- update_begin author:zhaoxin date:20191129 for: 做头部菜单栏导航 -->
|
||||
<!-- update-begin author:sunjianlei date:20191@20 for: 解决全局样式冲突的问题 -->
|
||||
<!-- <span class="action" @click="showClick">-->
|
||||
<!-- <a-icon type="search"></a-icon>-->
|
||||
<!-- </span>-->
|
||||
<!-- <span class="action" @click="showClick">-->
|
||||
<!-- <a-icon type="search"></a-icon>-->
|
||||
<!-- </span>-->
|
||||
<!-- update-begin author:sunjianlei date:20200219 for: 菜单搜索改为动态组件,在手机端呈现出弹出框 -->
|
||||
<!-- <component :is="searchMenuComp" v-show="searchMenuVisible || isMobile()" class="borders" :visible="searchMenuVisible" title="搜索菜单" :footer="null" @cancel="searchMenuVisible=false">-->
|
||||
<!-- <a-select-->
|
||||
<!-- class="search-input"-->
|
||||
<!-- showSearch-->
|
||||
<!-- :showArrow="false"-->
|
||||
<!-- placeholder="搜索菜单"-->
|
||||
<!-- optionFilterProp="children"-->
|
||||
<!-- :filterOption="filterOption"-->
|
||||
<!-- :open="isMobile()?true:null"-->
|
||||
<!-- :getPopupContainer="(node) => node.parentNode"-->
|
||||
<!-- :style="isMobile()?{width: '100%',marginBottom:'50px'}:{}"-->
|
||||
<!-- @change="searchMethods"-->
|
||||
<!-- @blur="hiddenClick"-->
|
||||
<!-- >-->
|
||||
<!-- <a-select-option v-for="(site,index) in searchMenuOptions" :key="index" :value="site.id">{{site.meta.title}}</a-select-option>-->
|
||||
<!-- </a-select>-->
|
||||
<!-- </component>-->
|
||||
<!-- <component :is="searchMenuComp" v-show="searchMenuVisible || isMobile()" class="borders" :visible="searchMenuVisible" title="搜索菜单" :footer="null" @cancel="searchMenuVisible=false">-->
|
||||
<!-- <a-select-->
|
||||
<!-- class="search-input"-->
|
||||
<!-- showSearch-->
|
||||
<!-- :showArrow="false"-->
|
||||
<!-- placeholder="搜索菜单"-->
|
||||
<!-- optionFilterProp="children"-->
|
||||
<!-- :filterOption="filterOption"-->
|
||||
<!-- :open="isMobile()?true:null"-->
|
||||
<!-- :getPopupContainer="(node) => node.parentNode"-->
|
||||
<!-- :style="isMobile()?{width: '100%',marginBottom:'50px'}:{}"-->
|
||||
<!-- @change="searchMethods"-->
|
||||
<!-- @blur="hiddenClick"-->
|
||||
<!-- >-->
|
||||
<!-- <a-select-option v-for="(site,index) in searchMenuOptions" :key="index" :value="site.id">{{site.meta.title}}</a-select-option>-->
|
||||
<!-- </a-select>-->
|
||||
<!-- </component>-->
|
||||
<!-- update-end author:sunjianlei date:20200219 for: 菜单搜索改为动态组件,在手机端呈现出弹出框 -->
|
||||
<!-- update-end author:sunjianlei date:20191220 for: 解决全局样式冲突的问题 -->
|
||||
<!-- update_end author:zhaoxin date:20191129 for: 做头部菜单栏导航 -->
|
||||
<!-- <span class="action">-->
|
||||
<!-- <a class="logout_title" target="_blank" href="http://doc.jeecg.com">-->
|
||||
<!-- <a-icon type="question-circle-o"></a-icon>-->
|
||||
<!-- </a>-->
|
||||
<!-- </span>-->
|
||||
<!-- <span class="action">-->
|
||||
<!-- <a class="logout_title" target="_blank" href="http://doc.jeecg.com">-->
|
||||
<!-- <a-icon type="question-circle-o"></a-icon>-->
|
||||
<!-- </a>-->
|
||||
<!-- </span>-->
|
||||
<header-notice class="action"/>
|
||||
<div class="action">
|
||||
<span @click="changeLocale('en-us')" v-show="localeval=='zh-cn'">English</span >
|
||||
<span @click="changeLocale('zh-cn')" v-show="localeval=='en-us'">中文</span >
|
||||
<span @click="changeLocale('en-us')" v-show="localeval=='zh-cn'">English</span>
|
||||
<span @click="changeLocale('zh-cn')" v-show="localeval=='en-us'">中文</span>
|
||||
</div>
|
||||
<a-dropdown>
|
||||
<span class="action action-full ant-dropdown-link user-dropdown-menu">
|
||||
<a-avatar class="avatar" size="small" :src="getAvatar()"/>
|
||||
<!-- <span v-if="isDesktop()">欢迎您,{{ nickname() }}</span>-->
|
||||
<!-- <span v-if="isDesktop()">欢迎您,{{ nickname() }}</span>-->
|
||||
</span>
|
||||
<a-menu slot="overlay" class="user-dropdown-menu-wrapper">
|
||||
<a-menu-item key="0">
|
||||
@@ -54,9 +54,9 @@
|
||||
<span>账户设置</span>
|
||||
</router-link>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="3" @click="systemSetting">
|
||||
<a-icon type="tool"/>
|
||||
<span>系统设置</span>
|
||||
<a-menu-item key="3" @click="systemSetting">
|
||||
<a-icon type="tool"/>
|
||||
<span>系统设置</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="4" @click="updatePassword">
|
||||
<a-icon type="setting"/>
|
||||
@@ -74,25 +74,25 @@
|
||||
<a-icon type="logout"/>
|
||||
<span>退出登录</span>
|
||||
</a-menu-item>
|
||||
<!-- <a-menu-item key="2" disabled>
|
||||
<a-icon type="setting"/>
|
||||
<span>测试</span>
|
||||
</a-menu-item>
|
||||
<a-menu-divider/>
|
||||
<a-menu-item key="3">
|
||||
<a href="javascript:;" @click="handleLogout">
|
||||
<a-icon type="logout"/>
|
||||
<span>退出登录</span>
|
||||
</a>
|
||||
</a-menu-item>-->
|
||||
<!-- <a-menu-item key="2" disabled>
|
||||
<a-icon type="setting"/>
|
||||
<span>测试</span>
|
||||
</a-menu-item>
|
||||
<a-menu-divider/>
|
||||
<a-menu-item key="3">
|
||||
<a href="javascript:;" @click="handleLogout">
|
||||
<a-icon type="logout"/>
|
||||
<span>退出登录</span>
|
||||
</a>
|
||||
</a-menu-item>-->
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
<!-- <span class="action">-->
|
||||
<!-- <a class="logout_title" href="javascript:;" @click="handleLogout">-->
|
||||
<!-- <a-icon type="logout"/>-->
|
||||
<!-- <span v-if="isDesktop()"> 退出登录</span>-->
|
||||
<!-- </a>-->
|
||||
<!-- </span>-->
|
||||
<!-- <span class="action">-->
|
||||
<!-- <a class="logout_title" href="javascript:;" @click="handleLogout">-->
|
||||
<!-- <a-icon type="logout"/>-->
|
||||
<!-- <span v-if="isDesktop()"> 退出登录</span>-->
|
||||
<!-- </a>-->
|
||||
<!-- </span>-->
|
||||
<user-password ref="userPassword"></user-password>
|
||||
<depart-select ref="departSelect" :closable="true" title="部门切换"></depart-select>
|
||||
<setting-drawer ref="settingDrawer" :closable="true" title="系统设置"></setting-drawer>
|
||||
@@ -102,28 +102,29 @@
|
||||
<script>
|
||||
import HeaderNotice from './HeaderNotice'
|
||||
import UserPassword from './UserPassword'
|
||||
import SettingDrawer from "@/components/setting/SettingDrawer";
|
||||
import SettingDrawer from '@/components/setting/SettingDrawer'
|
||||
import DepartSelect from './DepartSelect'
|
||||
import { mapActions, mapGetters,mapState } from 'vuex'
|
||||
import { mapActions, mapGetters, mapState } from 'vuex'
|
||||
import { mixinDevice } from '@/utils/mixin.js'
|
||||
import { getFileAccessHttpUrl,getAction } from "@/api/manage"
|
||||
import { getFileAccessHttpUrl, getAction } from '@/api/manage'
|
||||
import Vue from 'vue'
|
||||
import { UI_CACHE_DB_DICT_DATA } from "@/store/mutation-types"
|
||||
import { UI_CACHE_DB_DICT_DATA } from '@/store/mutation-types'
|
||||
import moment from 'moment'
|
||||
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
|
||||
import enUS from 'ant-design-vue/es/locale/en_US';
|
||||
import enUS from 'ant-design-vue/es/locale/en_US'
|
||||
import 'moment/locale/zh-cn'
|
||||
|
||||
moment.locale('zh-cn')
|
||||
const EN = 'en-us'
|
||||
const ZH = 'zh-cn'
|
||||
|
||||
export default {
|
||||
name: "UserMenu",
|
||||
name: 'UserMenu',
|
||||
mixins: [mixinDevice],
|
||||
data(){
|
||||
return{
|
||||
data() {
|
||||
return {
|
||||
// update-begin author:sunjianlei date:20200219 for: 头部菜单搜索规范命名 --------------
|
||||
searchMenuOptions:[],
|
||||
searchMenuOptions: [],
|
||||
searchMenuComp: 'span',
|
||||
searchMenuVisible: false,
|
||||
locale: zhCN,
|
||||
@@ -147,8 +148,8 @@
|
||||
/* update_begin author:zhaoxin date:20191129 for: 做头部菜单栏导航*/
|
||||
created() {
|
||||
let lists = []
|
||||
this.searchMenus(lists,this.permissionMenuList)
|
||||
this.searchMenuOptions=[...lists]
|
||||
this.searchMenus(lists, this.permissionMenuList)
|
||||
this.searchMenuOptions = [...lists]
|
||||
},
|
||||
mounted() {
|
||||
//如果是单点登录模式
|
||||
@@ -158,7 +159,7 @@
|
||||
this.updateCurrentDepart()
|
||||
}
|
||||
}
|
||||
this.localeval=localStorage.getItem('language')
|
||||
this.localeval = localStorage.getItem('language')
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
@@ -175,8 +176,8 @@
|
||||
handler() {
|
||||
this.searchMenuVisible = false
|
||||
this.searchMenuComp = this.isMobile() ? 'a-modal' : 'span'
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
// update-end author:sunjianlei date:20200219 for: 菜单搜索改为动态组件,在手机端呈现出弹出框
|
||||
},
|
||||
methods: {
|
||||
@@ -184,13 +185,13 @@
|
||||
showClick() {
|
||||
this.searchMenuVisible = true
|
||||
},
|
||||
hiddenClick(){
|
||||
hiddenClick() {
|
||||
this.shows = false
|
||||
},
|
||||
/* update_end author:zhaoxin date:20191129 for: 做头部菜单栏导航*/
|
||||
...mapActions(["Logout"]),
|
||||
...mapGetters(["nickname", "avatar","userInfo"]),
|
||||
getAvatar(){
|
||||
...mapActions(['Logout']),
|
||||
...mapGetters(['nickname', 'avatar', 'userInfo']),
|
||||
getAvatar() {
|
||||
return getFileAccessHttpUrl(this.avatar())
|
||||
},
|
||||
handleLogout() {
|
||||
@@ -202,7 +203,7 @@
|
||||
onOk() {
|
||||
return that.Logout({}).then(() => {
|
||||
// update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面
|
||||
that.$router.push({ path: '/user/login' });
|
||||
that.$router.push({ path: '/user/login' })
|
||||
localStorage.removeItem('language')
|
||||
// update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面
|
||||
//window.location.reload()
|
||||
@@ -214,27 +215,27 @@
|
||||
})
|
||||
},
|
||||
onCancel() {
|
||||
},
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
updatePassword(){
|
||||
updatePassword() {
|
||||
let username = this.userInfo().username
|
||||
this.$refs.userPassword.show(username)
|
||||
},
|
||||
updateCurrentDepart(){
|
||||
updateCurrentDepart() {
|
||||
this.$refs.departSelect.show()
|
||||
},
|
||||
systemSetting(){
|
||||
systemSetting() {
|
||||
this.$refs.settingDrawer.showDrawer()
|
||||
},
|
||||
/* update_begin author:zhaoxin date:20191129 for: 做头部菜单栏导航*/
|
||||
searchMenus(arr,menus){
|
||||
for(let i of menus){
|
||||
if(!i.hidden && "layouts/RouteView"!==i.component){
|
||||
arr.push(i)
|
||||
searchMenus(arr, menus) {
|
||||
for (let i of menus) {
|
||||
if (!i.hidden && 'layouts/RouteView' !== i.component) {
|
||||
arr.push(i)
|
||||
}
|
||||
if(i.children&& i.children.length>0){
|
||||
this.searchMenus(arr,i.children)
|
||||
if (i.children && i.children.length > 0) {
|
||||
this.searchMenus(arr, i.children)
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -254,43 +255,50 @@
|
||||
// update_end author:sunjianlei date:20191230 for: 解决外部链接打开失败的问题
|
||||
/*update_end author:zhaoxin date:20191129 for: 做头部菜单栏导航*/
|
||||
/*update_begin author:liushaoqian date:20200507 for: 刷新缓存*/
|
||||
clearCache(){
|
||||
getAction("sys/dict/refleshCache").then((res) => {
|
||||
clearCache() {
|
||||
getAction('sys/dict/refleshCache').then((res) => {
|
||||
if (res.success) {
|
||||
//重新加载缓存
|
||||
getAction("sys/dict/queryAllDictItems").then((res) => {
|
||||
getAction('sys/dict/queryAllDictItems').then((res) => {
|
||||
if (res.success) {
|
||||
Vue.ls.remove(UI_CACHE_DB_DICT_DATA)
|
||||
Vue.ls.set(UI_CACHE_DB_DICT_DATA, res.result, 7 * 24 * 60 * 60 * 1000)
|
||||
}
|
||||
})
|
||||
this.$message.success("刷新缓存完成!");
|
||||
this.$message.success('刷新缓存完成!')
|
||||
}
|
||||
}).catch(e => {
|
||||
this.$message.warn('刷新缓存失败!')
|
||||
console.log('刷新失败', e)
|
||||
})
|
||||
},
|
||||
queryAllDictItemsByCut() {
|
||||
getAction('/sys/dict/queryAllDictItemsByCut', {}).then((res) => {
|
||||
if (res.success) {
|
||||
Vue.ls.set(UI_CACHE_DB_DICT_DATA, res.result, 7 * 24 * 60 * 60 * 1000)
|
||||
}
|
||||
}).catch(e=>{
|
||||
this.$message.warn("刷新缓存失败!");
|
||||
console.log("刷新失败",e)
|
||||
})
|
||||
},
|
||||
/*update_end author:liushaoqian date:20200507 for: 刷新缓存*/
|
||||
moment,
|
||||
changeLocale (localeval) {
|
||||
console.log('loacal',localeval)
|
||||
this.$root.Bus.$emit('switchLanguage',localeval)
|
||||
changeLocale(localeval) {
|
||||
this.$root.Bus.$emit('switchLanguage', localeval)
|
||||
this.localeval = localeval
|
||||
if (localeval === EN) {
|
||||
moment.locale(EN)
|
||||
this.$i18n.locale = EN
|
||||
this.locale = enUS
|
||||
this.queryAllDictItemsByCut()
|
||||
// localStorage.setItem('language', EN)
|
||||
// location.reload();
|
||||
} else {
|
||||
moment.locale(ZH)
|
||||
this.$i18n.locale = ZH
|
||||
this.locale = zhCN
|
||||
this.queryAllDictItemsByCut()
|
||||
// localStorage.setItem('language', ZH)
|
||||
// location.reload();
|
||||
}
|
||||
console.log('this.locale',this.locale)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -307,11 +315,13 @@
|
||||
background-color: inherit;
|
||||
border: 0;
|
||||
border-bottom: 1px solid white;
|
||||
|
||||
&__placeholder, &__field__placeholder {
|
||||
color: inherit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* update-end author:sunjianlei date:20191220 for: 解决全局样式冲突问题 */
|
||||
/* update_end author:zhaoxin date:20191129 for: 让搜索框颜色能随主题颜色变换*/
|
||||
</style>
|
||||
@@ -321,10 +331,12 @@
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.action {
|
||||
color: rgba(0, 0, 0, 0.65) !important;
|
||||
}
|
||||
.action .avatar{
|
||||
background: #ccc !important;
|
||||
|
||||
.action .avatar {
|
||||
background: #ccc !important;
|
||||
}
|
||||
</style>
|
||||
@@ -80,7 +80,7 @@
|
||||
import { getAction, postAction, deleteAction, putAction } from '@/api/manage'
|
||||
import eventBUs from '../../../common/event'
|
||||
import search from '@/components/search/index'
|
||||
import tableData from '@/components/tableDate/index'
|
||||
import tableData from '@/components/coTable/index'
|
||||
export default {
|
||||
name:'collection',
|
||||
components:{
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<!-- 上传弹框-->
|
||||
<a-modal
|
||||
class="show-content"
|
||||
title="上传文件"
|
||||
:title="$t('UploadFile')"
|
||||
:visible="fileVisible"
|
||||
:confirm-loading="confirmLoading"
|
||||
@ok="modalOk"
|
||||
@@ -41,26 +41,26 @@
|
||||
<!-- 同步弹框-->
|
||||
<a-modal
|
||||
class="show-content"
|
||||
title="同步至文档库"
|
||||
:title="$t('SyncLibrary')"
|
||||
v-if="toVisible"
|
||||
:visible="toVisible"
|
||||
:confirm-loading="confirmLoading"
|
||||
@ok="handleOkTo"
|
||||
@cancel="handleCancelTo"
|
||||
>
|
||||
<p style="text-align: center">该文件未进行校验,确定要同步至文档库?</p>
|
||||
<p style="text-align: center">{{$t('sureSynchronize')}}</p>
|
||||
</a-modal>
|
||||
<!-- 校核弹框-->
|
||||
<a-modal
|
||||
class="show-content"
|
||||
title="校核"
|
||||
:title="$t('check')"
|
||||
v-if="checkVisible"
|
||||
:visible="checkVisible"
|
||||
:confirm-loading="confirmLoading"
|
||||
@ok="handleOkCheck"
|
||||
@cancel="handleCancelCheck"
|
||||
>
|
||||
<p style="text-align: center">确定对该文件未进行校验?</p>
|
||||
<p style="text-align: center">{{$t('sureVerified')}}</p>
|
||||
</a-modal>
|
||||
<div class="table-detail">
|
||||
<tableData
|
||||
@@ -86,9 +86,9 @@
|
||||
|
||||
<script>
|
||||
import { axios } from '@/utils/request'
|
||||
import { getAction, postAction, deleteAction } from '@/api/manage'
|
||||
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
|
||||
import search from '@/components/search/index'
|
||||
import tableData from '@/components/tableDate/index'
|
||||
import tableData from '@/components/ocrTable/index'
|
||||
import addForm from '@/components/ocrAddForm/index'
|
||||
import docTable from './modules/docTable'
|
||||
import ocrUpload from '@/components/ocrUpload/index'
|
||||
@@ -108,21 +108,21 @@
|
||||
return{
|
||||
OperationList: [
|
||||
{
|
||||
text: '同步至文档库',
|
||||
text: this.$t('SyncLibrary'),
|
||||
ClickEvent: 'actionSynchron'
|
||||
},
|
||||
}, //同步至文档库
|
||||
{
|
||||
text: '校核',
|
||||
text: this.$t('check'),
|
||||
ClickEvent: 'actionCheck'
|
||||
},
|
||||
}, //校核
|
||||
{
|
||||
text: '下载',
|
||||
text: this.$t('download'),
|
||||
ClickEvent: 'actionDown'
|
||||
},
|
||||
}, //下载
|
||||
{
|
||||
text: '删除',
|
||||
text: this.$t('delete'),
|
||||
ClickEvent: 'actionDelete'
|
||||
}
|
||||
} //删除
|
||||
],
|
||||
pageSize:10,
|
||||
labelCol: { span:4 },
|
||||
@@ -189,7 +189,7 @@
|
||||
}
|
||||
if(this.selectedIds){
|
||||
this.$confirm({
|
||||
title: '确认要批量删除?',
|
||||
title: this.$t('ConfirmBatchDeletion'),
|
||||
content: '',
|
||||
onOk:
|
||||
async () => {
|
||||
@@ -205,7 +205,7 @@
|
||||
onCancel() {},
|
||||
});
|
||||
}else{
|
||||
this.$message.warning('请选择至少一条数据!');
|
||||
this.$message.warning(this.$t('selectLeastOne'));
|
||||
}
|
||||
},
|
||||
//同步
|
||||
@@ -228,11 +228,8 @@
|
||||
},
|
||||
//下载
|
||||
actionDown(val){
|
||||
if(val.resultContent=='转换成功'){
|
||||
|
||||
}else{
|
||||
this.$message.warning('未转换成功或已同步至文档库')
|
||||
}
|
||||
// console.log()
|
||||
downloadFile('/sys/common/download', val.fileName, { id: val.id })
|
||||
},
|
||||
//删除
|
||||
actionDelete(record){
|
||||
@@ -240,7 +237,7 @@
|
||||
id:record.id
|
||||
}
|
||||
this.$confirm({
|
||||
title: '确认删除?',
|
||||
title: this.$t('ConfirmDelete'),
|
||||
content: '',
|
||||
onOk:
|
||||
async () => {
|
||||
@@ -262,7 +259,6 @@
|
||||
},
|
||||
onSelectChange(selectedRowKeys,selectedRows){
|
||||
this.selectedIds=selectedRowKeys.join(',')
|
||||
// console.log('seIds',this.selectedIds)
|
||||
|
||||
},
|
||||
//上传确定按钮
|
||||
|
||||
@@ -12,26 +12,6 @@
|
||||
<div class="doc-table-content">
|
||||
<div class="doc-header">
|
||||
<search :url="url" :flag="'condition'"></search>
|
||||
<!-- <a-form layout="inline" v-model="queryParams" @keyup.enter.native="searchQuery(queryParams)">-->
|
||||
<!-- <a-row :gutter="24">-->
|
||||
<!-- <a-col :md="6" :sm="12">-->
|
||||
<!-- <a-form-item :label="'编号'">-->
|
||||
<!-- <j-input :placeholder="'请输入编号'" v-model="queryParams.serialNumber"></j-input>-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- </a-col>-->
|
||||
<!-- <a-col :md="6" :sm="12">-->
|
||||
<!-- <a-form-item :label="'标题'">-->
|
||||
<!-- <j-input :placeholder="'请输入标题'" v-model="queryParams.title"></j-input>-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- </a-col>-->
|
||||
<!-- <a-col :md="6" :sm="8">-->
|
||||
<!-- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">-->
|
||||
<!-- <a-button type="primary" @click="searchQuery" icon="search">{{$t('query')}}</a-button>-->
|
||||
<!-- <a-button @click="searchReset" icon="reload" style="margin-left: 8px">清空</a-button>-->
|
||||
<!-- </span>-->
|
||||
<!-- </a-col>-->
|
||||
<!-- </a-row>-->
|
||||
<!-- </a-form>-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="doc-table-detail">
|
||||
@@ -39,26 +19,10 @@
|
||||
:flag="'header'"
|
||||
:url="url"
|
||||
:showAction="false"
|
||||
:OperationList="OperationList"
|
||||
@onSelectChange="onSelectChange"
|
||||
/>
|
||||
</div>
|
||||
<!-- <a-table bordered :data-source="tableSource" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" class="tag-con-table" :pagination="false" >-->
|
||||
<!-- <span slot="num" slot-scope="text,records,index">-->
|
||||
<!-- {{ (queryParams.pageNo-1)*queryParams.pageSize+Number(index)+1 }}-->
|
||||
<!-- </span>-->
|
||||
<!-- </a-table>-->
|
||||
<!-- <div class="page" v-if="tableSource.length > 0">-->
|
||||
<!-- <a-pagination-->
|
||||
<!-- :show-total="total => `共 ${total} 条`"-->
|
||||
<!-- show-quick-jumper-->
|
||||
<!-- show-size-changer-->
|
||||
<!-- :page-size.sync="queryParams.pageSize"-->
|
||||
<!-- :total="total"-->
|
||||
<!-- @change="onChangePage"-->
|
||||
<!-- @showSizeChange="SizeChange"-->
|
||||
<!-- />-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<div class="doc-table-footer">
|
||||
<a-button type="primary" class="btn-export" @click="tableExport">导入</a-button>
|
||||
<a-button type="primary" @click="onClose">取消</a-button>
|
||||
@@ -70,7 +34,8 @@
|
||||
<script>
|
||||
import { getAction, postAction, deleteAction } from '@/api/manage'
|
||||
import search from '@/components/search/index'
|
||||
import tableData from '@/components/tableDate/index'
|
||||
import tableData from '@/components/ocrTable/docTable'
|
||||
import eventBUs from '../../../../common/event'
|
||||
export default {
|
||||
name: 'docTable',
|
||||
components:{
|
||||
@@ -158,7 +123,8 @@
|
||||
tableList: 'document/bussDocumentLibraryEO/ocrPageInfo', //表格数据
|
||||
// getAddForm: 'ocr/ocrRecord/getForm', // 表单的字段
|
||||
// addInfo: 'ocr/OcrRestful/addOcrRecord', //新增
|
||||
}
|
||||
},
|
||||
rowId:''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -193,9 +159,13 @@
|
||||
searchReset(){
|
||||
|
||||
},
|
||||
onSelectChange(rowKeys){
|
||||
|
||||
console.log('key',rowKeys)
|
||||
onSelectChange(rowKeys,rows){
|
||||
if(rowKeys.length>1){
|
||||
this.$message.warning('只能选择一条数据')
|
||||
}else{
|
||||
this.rowId=rowKeys[0]
|
||||
this.rows=rows[0]
|
||||
}
|
||||
},
|
||||
//点击页数
|
||||
onChangePage(page,pageSize){
|
||||
@@ -209,7 +179,46 @@
|
||||
},
|
||||
//导入按钮
|
||||
tableExport(){
|
||||
// this.$emit('exportVisible',true)
|
||||
if(this.rows.length>1){
|
||||
this.$message.warning('只能选择一条数据')
|
||||
}else {
|
||||
if(this.rows.file_name){
|
||||
let name = this.rows.file_name.split('.')
|
||||
let nameSuffix=name[name.length-1]
|
||||
if(nameSuffix.toLowerCase()=='pdf'){
|
||||
let params = {
|
||||
attId: this.rows.id,
|
||||
standName: this.rows.title,
|
||||
standNumber: this.rows.serial_number
|
||||
}
|
||||
if(this.rows.text_info=='发布稿(必读)'){
|
||||
params.fileType='1'
|
||||
}else if(this.rows.text_info=='增补件(必读)'){
|
||||
params.fileType='2'
|
||||
}else if(this.rows.text_info=='报批稿'){
|
||||
params.fileType='3'
|
||||
}else if(this.rows.text_info=='征求意见稿'){
|
||||
params.fileType='4'
|
||||
}else if(this.rows.text_info=='测试程序'){
|
||||
params.fileType='5'
|
||||
}else if(this.rows.text_info=='相关资料'){
|
||||
params.fileType='6'
|
||||
}
|
||||
postAction(`ocr/OcrRestful/addOcrRecord`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
eventBUs.$emit('searchReset')
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
// this.$emit('exportVisible',true)
|
||||
}else{
|
||||
this.$message.warning('只能导入pdf文件')
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<script>
|
||||
import { getAction, postAction, deleteAction, putAction } from '@/api/manage'
|
||||
import search from '@/components/search/index'
|
||||
import tableData from '@/components/tableDate/index'
|
||||
import tableData from '@/components/coTable/index'
|
||||
import subArea from './module/subArea'
|
||||
import eventBUs from '../../../common/event'
|
||||
export default {
|
||||
@@ -152,7 +152,7 @@
|
||||
},
|
||||
OperationList: [
|
||||
{
|
||||
text: '取消订阅',
|
||||
text: this.$t('CancelSubscribe'),
|
||||
ClickEvent: 'onCancel'
|
||||
}
|
||||
],
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<onl-cgform-tag-form ref="realForm" @ok="submitCallback" :isTagContent="isTagContent" :editData="editData" :editId=editId :submitEdit="submitEdit" :disabled="disableSubmit" normal> </onl-cgform-tag-form>
|
||||
|
||||
<div class="drawer-footer">
|
||||
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">保存</a-button>
|
||||
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
|
||||
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">{{$t('preservation')}}</a-button>
|
||||
<a-button @click="handleCancel" style="margin-bottom: 0;">{{$t('close')}}</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -20,7 +20,6 @@
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
width:800,
|
||||
visible: false,
|
||||
disableSubmit: false
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<template>
|
||||
<div class="tags">
|
||||
<a-card :bordered="false">
|
||||
<div class="tag-tab">
|
||||
<a-tabs type="card" @change="callback">
|
||||
<a-tab-pane key="1" tab="标签项管理">
|
||||
<tag-item></tag-item>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="2" tab="标签内容管理">
|
||||
<tag-content></tag-content>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</div>
|
||||
<div class="tag-tab">
|
||||
<a-tabs type="card" @change="callback">
|
||||
<a-tab-pane key="1" :tab="$t('TagItemManagement')">
|
||||
<tag-item></tag-item>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="2" :tab="$t('LabelContentManagement')">
|
||||
<tag-content></tag-content>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</div>
|
||||
</a-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<div class="tab-table">
|
||||
<a-table
|
||||
ref="table"
|
||||
bordered
|
||||
size="middle"
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
{{$t('add')}}
|
||||
</div>
|
||||
</div>
|
||||
<a-modal class="show-content" v-model="contentVisible" :visible="contentVisible" title="新增" ok-text="保存" cancel-text="取消" @ok="hideModal" @cancel="cancelModel" v-if="contentVisible">
|
||||
<a-modal class="show-content" v-model="contentVisible" :visible="contentVisible" :title="$t('add')" :ok-text="$t('preservation')" :cancel-text="$t('cancel')" @ok="hideModal" @cancel="cancelModel" v-if="contentVisible">
|
||||
<a-form-model
|
||||
class="tag-content"
|
||||
ref="ruleForm"
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
<a-popover placement="right" v-model="typeVisible" trigger="click">
|
||||
<template slot="content" class="type-popover-content">
|
||||
<div class="type-popover">
|
||||
<p class="type type-input" @click="handleAddPop('input')">输入框类型</p>
|
||||
<p class="type type-select" @click="handleAddPop('select')">下拉选类型</p>
|
||||
<p class="type type-input" @click="handleAddPop('input')">{{$t('InputBoxType')}}</p>
|
||||
<p class="type type-select" @click="handleAddPop('select')">{{$t('DropDownType')}}</p>
|
||||
</div>
|
||||
</template>
|
||||
<a-icon type="plus" />
|
||||
@@ -40,22 +40,22 @@
|
||||
</div>
|
||||
<div class="operator-text" @click="handleShow">
|
||||
<a-icon type="rocket" :rotate="45" />
|
||||
展示区域管理
|
||||
{{$t('ExhibitionAreaManagement')}}
|
||||
</div>
|
||||
</div>
|
||||
<a-drawer class="show-drawer" :title="titleTag" placement="right" width="1000px" @close="close" :visible="drawerVisible" :after-visible-change="afterVisibleChange" >
|
||||
<new-drawer v-if="drawerVisible&&editFlag" :drawerVisible="drawerVisible" :isTagContent="isTagContent" :editData="editData" :editId="editId" :submitEdit="submitEdit" @closeTag="closeTag" ></new-drawer>
|
||||
</a-drawer>
|
||||
<a-modal class="show-area" v-model="areaVisible" title="展示区域管理" :footer="null" @cancel="hideModal">
|
||||
<a-modal class="show-area" v-model="areaVisible" :title="$t('ExhibitionAreaManagement')" :footer="null" @cancel="hideModal">
|
||||
<area-manage v-if="areaVisible" @diaHide="diaHide" :areaTable="areaTable" @submitOk="submitOk" @deleteOk="deleteOk" @updateOk="updateOk"></area-manage>
|
||||
</a-modal>
|
||||
<div class="tag-doc-tab">
|
||||
<a-spin :spinning="spinning" tip="Loading...">
|
||||
<a-tabs default-active-key="1" @change="callbackTab">
|
||||
<a-tab-pane key="1" tab="文档库">
|
||||
<a-tab-pane key="1" :tab="$t('DocumentLibrary')">
|
||||
<tabTable :tableData="tableData" :columns="taglabColumns" @visibleEd="visibleEd" @visibleDelete="visibleDelete" @queryParams="queryParams" :total="total"></tabTable>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="2" tab="文档拆分" force-render>
|
||||
<a-tab-pane key="2" :tab="$t('DocumentSplitting')" force-render>
|
||||
<tabTable :tableData="tableData" :columns="taglabColumns" @visibleEd="visibleEd" @visibleDelete="visibleDelete" @queryParams="queryParams" :total="total"></tabTable>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
@@ -85,7 +85,7 @@
|
||||
page:1,
|
||||
pageSize:10,
|
||||
},
|
||||
titleTag:'新增标签项',
|
||||
titleTag:this.$t('NewLabelItem'),
|
||||
typeVisible:false,
|
||||
isTagContent:false,
|
||||
editData:{}, //编辑的数据
|
||||
@@ -349,7 +349,7 @@
|
||||
},
|
||||
handleAddPop(val){
|
||||
this.drawerVisible=true
|
||||
this.titleTag='新增标签项'
|
||||
this.titleTag=this.$t('NewLabelItem')
|
||||
this.submitEdit='add'
|
||||
if(val=='input'){
|
||||
this.typeVisible=false
|
||||
|
||||
@@ -96,9 +96,9 @@
|
||||
dataIndex: 'itemText',
|
||||
},
|
||||
{
|
||||
title: this.$t('DictionaryEnName'),
|
||||
title: this.$t('enName'),
|
||||
align: "center",
|
||||
dataIndex: 'itemValue',
|
||||
dataIndex: 'enName',
|
||||
},
|
||||
{
|
||||
title: this.$t('DataValue'),
|
||||
|
||||
Reference in New Issue
Block a user