@@ -137,12 +134,14 @@
-
-
+
+
+
+
@@ -157,7 +156,6 @@ import {
getTreeList,
getEnterpriseStandardTableHeader,
getEnterpriseStandardSearchForm,
- allocationStandard,
shiftStandard,
initChange,
collectStandard,
@@ -167,15 +165,16 @@ import {
} from '@api/enterpriseStandardLibraryApi'
// 添加、编辑弹框
import EnterpriseStandardModal from './modules/EnterpriseStandardModal'
-// 选择标准组件
-import StandardSelectionModal from '@/components/selection/StandardSelectionModal'
// 临时权限设置
import TemporaryPermissionSet from './modules/TemporaryPermissionSet'
import TreeNodeModal from './modules/TreeNodeModal'
+import UserSelectModal from '../../../components/selection/UserSelectModal'
+// 配置标准弹框
+import AllocationStandardDrawer from './modules/AllocationStandardDrawer'
export default {
name: 'EnterpriseStandardList',
- components: { TreeNodeModal, TemporaryPermissionSet, StandardSelectionModal, EnterpriseStandardModal, JTable, Search },
+ components: { AllocationStandardDrawer, UserSelectModal, TreeNodeModal, TemporaryPermissionSet, EnterpriseStandardModal, JTable, Search },
mixins: [ConfigurableTableMixin],
data () {
return {
@@ -183,8 +182,11 @@ export default {
flag: '3',
treeInput: '', // 左侧树搜索框内容
treeData: [], // 左侧树数据
+ treeLoading: false,
+ collectionFlag: false,
defaultExpandAll: false, // 左侧树默认展开所有
- currentTreeNode: null, // 当前选中的树节点
+ currentTreeNode: null, // 当前选中的树节点key值
+ currentTreeNodeCode: null, // 当前选中的树节点的code值
mouseInNodeKey: null, // 鼠标悬浮的节点key值
operationList: [
{
@@ -216,14 +218,15 @@ export default {
// url传参严格按照当前命名
url: {
list: '/laws/standard/enterprise/getCommonPage', // 表格数据
- delete: '', // 删除
- deleteBatch: '', // 批量删除
+ delete: '/laws/standard/enterprise/singleDelete', // 删除
+ deleteBatch: '/laws/standard/enterprise/deleteByIdsAndModule', // 批量删除
importUrl: '', // 导入
exportXlsUrl: '', // 导出
exportZipUrl: '', // 带文件导出
downTemplateUrl: '' // 下载导入模板
},
- showAction: true // 是否显示操作列
+ showAction: true, // 是否显示操作列
+ currentShare: {}
}
},
mounted () {
@@ -232,6 +235,7 @@ export default {
methods: {
// 获取左侧树数据
initTreeData (params) {
+ this.treeLoading = true
getTreeList(params).then(res => {
if (res.success) {
this.treeData = this.dealTreeData(res.result)
@@ -242,14 +246,19 @@ export default {
this.$nextTick(() => {
this.defaultExpandAll = true
})
+ this.treeLoading = false
})
},
// 处理左侧树数据结构
dealTreeData (treeData) {
return treeData.map(item => {
- item.scopedSlots = { title: 'custom' }
if (item.children && item.children.length > 0) {
+ item.scopedSlots = { icon: 'folder', title: 'custom' }
item.children = this.dealTreeData(item.children)
+ } else if (item.nodeType === StandardSystemTreeNodeType.ROOT_NODE.value) {
+ item.scopedSlots = { icon: 'folder', title: 'custom' }
+ } else {
+ item.scopedSlots = { icon: 'file', title: 'custom' }
}
return item
})
@@ -260,9 +269,10 @@ export default {
this.initTreeData({ nodeName: this.treeInput })
},
// 左侧树点击选中
- treeSelect (selectedKeys) {
- this.currentTreeNode = selectedKeys
- this.searchParams.workingGroupId = selectedKeys[0]
+ treeSelect (record) {
+ this.currentTreeNode = [record.key]
+ this.currentTreeNodeCode = [record.nodeCode]
+ this.searchParams.nodeCode = record.nodeCode
this.loadData()
},
// 左侧树点击新增
@@ -316,8 +326,8 @@ export default {
this.currentTreeNode = null
this.searchParams = {}
this.selectedRowKeys = []
- this.getData()
- this.getTableList()
+ this.getTableHeader()
+ this.loadData()
},
// 配置标准
handleAllocationStandard () {
@@ -327,25 +337,7 @@ export default {
this.$message.warn(this.$t('enterpriseStandardLibrary.standard.pleaseSelectLeastOneNode'))
return
}
- this.$refs.standardSelectionModal.open()
- },
- // 配置标准确定
- allocationStandardChange (dbFieldName, standardIds) {
- this.loading = true
- const params = {
- nodeId: this.currentTreeNode[0],
- standardIds
- }
- allocationStandard(params).then(res => {
- if (res.success) {
- this.$message.success(res.message)
- this.modalFormOk()
- } else {
- this.$message.warn(res.message)
- }
- }).finally(() => {
- this.loading = false
- })
+ this.$refs.allocationStandardDrawer.open(this.currentTreeNodeCode[0])
},
// 移出标准
handleShiftOutStandard () {
@@ -361,7 +353,7 @@ export default {
}
this.loading = true
const params = {
- nodeId: this.currentTreeNode[0],
+ nodeCode: this.currentTreeNodeCode[0],
ids: this.selectedRowKeys.join(',')
}
shiftStandard(params).then(res => {
@@ -416,7 +408,11 @@ export default {
},
// 收藏
handleCollection (record) {
- if (record.collectionFlag) {
+ if (this.collectionFlag || this.loading) {
+ return
+ }
+ this.collectionFlag = true
+ if (!!record.collectionFlag) {
const params = {}
params.id = record.id
// 说明已收藏,调取消收藏接口
@@ -427,11 +423,15 @@ export default {
} else {
this.$message.warning(res.message)
}
+ }).finally(() => {
+ this.setTimeout(() => {
+ this.collectionFlag = false
+ }, 100)
})
} else {
const params = {}
params.standardId = record.id
- params.standardNumber = record.standard_no
+ params.standardNumber = record.standard_number
collectStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
@@ -439,13 +439,24 @@ export default {
} else {
this.$message.warning(res.message)
}
+ }).finally(() => {
+ this.setTimeout(() => {
+ this.collectionFlag = false
+ }, 100)
})
}
},
// 分享
handleShare (record) {
+ this.currentShare = record
+ this.$refs.userSelectModal.open()
+ },
+ // 分享选完人的回调
+ userSelectChange (value) {
const params = {}
- params.id = record.id
+ params.standardId = this.currentShare.id
+ params.standardNum = this.currentShare.standard_no
+ params.recipientId = value
shareStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
@@ -468,37 +479,11 @@ export default {
diff --git a/src/views/enterpriseStandardLibrary/standard/modules/AllocationStandardDrawer.vue b/src/views/enterpriseStandardLibrary/standard/modules/AllocationStandardDrawer.vue
new file mode 100644
index 00000000..a878d8ea
--- /dev/null
+++ b/src/views/enterpriseStandardLibrary/standard/modules/AllocationStandardDrawer.vue
@@ -0,0 +1,218 @@
+
+
+
+
+
+
{{ $t('cancel') }}
+
{{ $t('submit') }}
+
+
+
+
+
+
+