diff --git a/src/assets/less/common.less b/src/assets/less/common.less
index 3ef5121c..6e18961b 100644
--- a/src/assets/less/common.less
+++ b/src/assets/less/common.less
@@ -1,3 +1,5 @@
+@primary-color: #D52C26;
+
/*列表上方操作按钮区域*/
/*.ant-card-body .table-operator {
margin-bottom: 8px;
@@ -31,16 +33,21 @@
.ant-card-body .table-operator,
.table-operator {
margin-bottom: 29px;
- text-align: right;
+ font-size: 14px;
+ font-weight: 400;
+ color: #040B29;
}
.operator-text {
cursor: pointer;
margin-right: 53px;
- font-size: 14px;
- font-weight: 400;
- color: #040B29;
display: inline-block;
+
+ .ant-upload {
+ font-size: 14px;
+ font-weight: 400;
+ color: #040B29;
+ }
}
.operator-text:last-child {
@@ -75,6 +82,10 @@
margin-left: 0;
}
+.operate-icon-btn {
+ color: @primary-color;
+}
+
/*列表页面弹出modal*/
.ant-modal-cust-warp {
height: 100%
@@ -503,10 +514,28 @@
// 鼠标移入树节点样式修改
.ant-tree li .ant-tree-node-content-wrapper:hover {
background: #FFFFFF;
- box-shadow: 0 0 4px 0 rgba(0,0,0,0.1);
+ box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.1);
border-radius: 4px 4px 4px 4px;
opacity: 1;
margin-left: -24px;
padding-left: 29px;
width: 100%;
+}
+
+/*抽屉样式修改*/
+.ant-drawer-body {
+ height: calc(100vh - 55px);
+
+ .ant-spin-container {
+ height: 100%;
+ }
+
+ .drawer-container {
+ height: calc(100% - 52px);
+ overflow: auto;
+ }
+
+ .drawer-footer {
+ margin-top: 20px;
+ }
}
\ No newline at end of file
diff --git a/src/common/lang/en-us.js b/src/common/lang/en-us.js
index 6e95cde9..45cb38c9 100644
--- a/src/common/lang/en-us.js
+++ b/src/common/lang/en-us.js
@@ -121,6 +121,9 @@ module.exports = {
uploadedBy: 'Uploaded By',
uploadTime: 'Upload Time',
uploadFileBtn: 'Upload File',
+ tips: 'Tips',
+ exportTip: 'Exporting, please wait',
+ fileDownloadFail: 'File download failure',
// 树右键
treeRight: {
addFolder: 'Create New Folder',
@@ -373,7 +376,7 @@ module.exports = {
confirmCollection: 'Confirm Collection?',
cancelConfirmCollection: 'Are you sure you want to cancel the collection?',
confirmSubscribe: 'Confirm Subscribe ?',
- cancelConfirmSubscribe: 'Are you sure you want to cancel the subscribe',
+ cancelConfirmSubscribe: 'Are you sure you want to cancel the subscribe'
},
// 文档工具
docTool: {
diff --git a/src/common/lang/standardRegulationLibrary/en-us.js b/src/common/lang/standardRegulationLibrary/en-us.js
index aaf2a591..f19f2340 100644
--- a/src/common/lang/standardRegulationLibrary/en-us.js
+++ b/src/common/lang/standardRegulationLibrary/en-us.js
@@ -1,6 +1,12 @@
module.exports = {
+ configStandard: 'Configuration standard', // 配置标准
+ removeStandard: 'Removal criteria', // 移出标准
// 国内标准
domesticStandard: {
- treeSearchPlaceholder: 'Please enter the tree system' // 请输入树状图体系
+ treeSearchPlaceholder: 'Please enter the tree system', // 请输入树状图体系
+ collection: 'Invoice Collection', // 收藏
+ cancelCollection: 'Delete Collection', // 取消收藏
+ exportFileName: 'Domestic standard regulations', // 国内标准法规
+ templateName: 'Import templates for domestic standards and regulations' // 国内标准法规导入模板
}
}
diff --git a/src/common/lang/standardRegulationLibrary/zh-cn.js b/src/common/lang/standardRegulationLibrary/zh-cn.js
index a384e793..32f3710f 100644
--- a/src/common/lang/standardRegulationLibrary/zh-cn.js
+++ b/src/common/lang/standardRegulationLibrary/zh-cn.js
@@ -1,6 +1,12 @@
module.exports = {
+ configStandard: '配置标准',
+ removeStandard: '移出标准',
// 国内标准
domesticStandard: {
- treeSearchPlaceholder: '请输入树状图体系'
+ treeSearchPlaceholder: '请输入树状图体系',
+ collection: '收藏',
+ cancelCollection: '取消收藏',
+ exportFileName: '国内标准法规',
+ templateName: '国内标准法规导入模板'
}
}
diff --git a/src/common/lang/zh-cn.js b/src/common/lang/zh-cn.js
index a533a62d..0c21a0a1 100644
--- a/src/common/lang/zh-cn.js
+++ b/src/common/lang/zh-cn.js
@@ -121,6 +121,9 @@ module.exports = {
uploadedBy: '上传人',
uploadTime: '上传时间',
uploadFileBtn: '上传文件',
+ tips: '提示',
+ exportTip: '正在导出,请稍候',
+ fileDownloadFail: '文件下载失败',
// 树右键
treeRight: {
addFolder: '新增文件夹',
diff --git a/src/mixins/ConfigurableTableMixin.js b/src/mixins/ConfigurableTableMixin.js
index 66f2ec80..46a91a1c 100644
--- a/src/mixins/ConfigurableTableMixin.js
+++ b/src/mixins/ConfigurableTableMixin.js
@@ -1,31 +1,12 @@
/**
* 表头通过标签管理配置的模块的表格数据的混入
*/
-import { getAction, postAction } from '@api/manage'
-import { isHasPermission } from '../utils/hasPermission'
-import { getTableHeader } from '@api/api'
+import { downFile, downloadFile, getAction, postAction } from '@api/manage'
+import Vue from 'vue'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
+import store from '@/store'
-// 模拟接口返回的表头数据
-const TempApiReturnColumns = [
- {
- db_field_txt: '编号',
- sort: 'true',
- db_field_name: 'serial_number',
- click: 'true'
- },
- { db_field_txt: '标题', db_field_name: 'title', click: 'true' },
- {
- db_field_txt: '状态',
- sort: 'true',
- db_field_name: 'state'
- },
- { db_field_txt: '适用地区', db_field_name: 'region' },
- {
- db_field_txt: '技术领域',
- db_field_name: 'technology_territory'
- },
- { db_field_txt: '发布日期', sort: 'true', db_field_name: 'issue_time' }
-]
+let importModalLoading
export const ConfigurableTableMixin = {
data () {
@@ -60,12 +41,19 @@ export const ConfigurableTableMixin = {
},
// type: '', // 这个字段不知道什么含义
filters: {}, // 固定的搜索条件
- needFilterTableBtn: true // 是否需要过滤没有权限的按钮
+ needFilterTableBtn: true, // 是否需要过滤没有权限的按钮
+ tokenHeader: { 'X-Access-Token': Vue.ls.get(ACCESS_TOKEN) }
+
+ }
+ },
+ computed: {
+ importExcelUrl () {
+ return `${window._CONFIG.domianURL}${this.url.importUrl}`
}
},
mounted () {
this.getTableHeader()
- this.loadData()
+ // this.loadData()
// 过滤没有权限的按钮
// if (this.needFilterTableBtn) {
// this.operationList = this.operationList.filter(item => isHasPermission(item.has))
@@ -86,6 +74,9 @@ export const ConfigurableTableMixin = {
this.getTableHeader()
this.loadData()
},
+ /**
+ * 重置查询
+ */
searchReset () {
this.searchParams = {}
this.selectedRowKeys = []
@@ -97,7 +88,6 @@ export const ConfigurableTableMixin = {
*/
getTableHeader () {
if (!this.url.tableHeader) {
- this.columns = this.dealColumns(TempApiReturnColumns)
return
}
const params = { module: this.flag }
@@ -130,7 +120,7 @@ export const ConfigurableTableMixin = {
}
}
// 是否可排序
- item.sorter = item.sort === 'true'
+ item.sorter = item.sortFlag === 1
item.width = 215
item.title = item.dbFieldTxt
item.dataIndex = item.dbFieldName
@@ -138,13 +128,11 @@ export const ConfigurableTableMixin = {
})
if (this.showAction && this.operateColumn) {
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.operationList && this.operationList.length > 0) {
+ width += this.getTextWith(this.operationList[0].text) + this.getTextWith(this.$t('more'))
}
const operateColumn = JSON.parse(JSON.stringify(this.operateColumn))
- operateColumn.width = width
+ operateColumn.width = width || 100
tempColumns.push(operateColumn)
}
return tempColumns
@@ -165,7 +153,7 @@ export const ConfigurableTableMixin = {
getQueryParams () {
const pageNo = this.ipagination.current
const pageSize = this.ipagination.pageSize
- const params = {
+ return {
...this.filters,
...this.searchParams,
orderBy: this.orderBy,
@@ -174,13 +162,16 @@ export const ConfigurableTableMixin = {
pageNo: pageNo,
pageSize: pageSize
}
- return params
},
- loadData () {
+ loadData (arg) {
if (!this.url.list) {
this.$message.error('请设置url.list属性!')
return
}
+ // 加载数据 若传入参数1则加载第一页的内容
+ if (arg === 1) {
+ this.ipagination.current = 1
+ }
const params = this.getQueryParams()
this.loading = true
postAction(this.url.list, params).then((res) => {
@@ -203,10 +194,210 @@ export const ConfigurableTableMixin = {
this.orderBy = sorter.order === 'ascend' ? '1' : '2'
this.orderByField = sorter.columnKey
this.ipagination = pagination
- this.loadData()
+ this.loadData(1)
},
onSelectChange (selectedRowKeys) {
this.selectedRowKeys = selectedRowKeys
+ },
+ /* 导入 */
+ handleImportExcel (info) {
+ // 加一个大的提示
+ if (!this.loading) {
+ importModalLoading = this.$info({
+ title: '提示',
+ content: 正在导入,请稍候