+ @search="handleTreeSearch" />
-
-
-

-
-
- {{ title }}
-
- {{ title }}
-
-
-
+
-
-
+
+
- {{ title }}
+ {{ record.nodeName }}
- {{ title }}
+ {{ record.nodeName }}
-
+
-
+
-
-
+
+
-
-
-
+
+
+
+
{{ $t('newlyAdded') }}
-
+
{{ $t('import') }}
-
+
{{ $t('export') }}
- {{ $t('exportWithFile') }}
+
+ {{ $t('exportWithFile') }}
+
-
+
{{ $t('templateDownload') }}
@@ -87,22 +92,26 @@
@change="tableOnChange">
- {{ $t('standardRegulationLibrary.domesticStandard.collection') }}
+
+
+
+
+
-
-
+
+
-
- {{ !record.collectFlag || record.collectFlag === '0' ? $t('docLibrary.collection') : $t('docLibrary.cancelCollection') }}
-
-
- {{ !record.subscribeFlag || record.subscribeFlag === '0' ? $t('docLibrary.subscribe') : $t('docLibrary.cancelSubscribe') }}
-
-
- {{ operation.text }}
-
+
+
+
+
+
+
+
+ {{ operation.text }}
+
@@ -114,6 +123,10 @@
+
+
+
+
@@ -123,26 +136,29 @@ import { ConfigurableTableMixin } from '../../../mixins/ConfigurableTableMixin'
import Search from '../../../components/customField/Search.vue'
import JTable from '../../../components/jero/JTable.vue'
import DomesticStandardModal from './modules/DomesticStandardModal.vue'
-import { getDomesticStandardTableHeader, getDomesticStandardSearchForm } from '../../../api/standardRegulationLibraryApi'
+import { getDomesticStandardTableHeader, getDomesticStandardSearchForm, shareDomesticStandard } from '../../../api/standardRegulationLibraryApi'
+import { YesOrNoEnum, StandardSystemTreeNodeType } from '../../../enums/commonEnums'
+import UserSelectModal from '../../../components/selection/UserSelectModal.vue'
+import DomesticSystemTreeModal from './modules/DomesticSystemTreeModal.vue'
const apiTreeData = [
{
- title: 'parent 1',
+ nodeName: 'parent 1',
key: '0-0',
+ nodeType: '1',
child: [
{
- title: '张晨成',
+ nodeName: '张晨成',
key: '0-0-0',
- disabled: true,
child: [
- { title: 'leaf', key: '0-0-0-0' },
- { title: 'leaf', key: '0-0-0-1' }
+ { nodeName: 'leaf', key: '0-0-0-0' },
+ { nodeName: 'leaf', key: '0-0-0-1' }
]
},
{
- title: 'parent 1-1',
+ nodeName: 'parent 1-1',
key: '0-0-1',
- child: [{ key: '0-0-1-0', title: 'zcvc' }]
+ child: [{ key: '0-0-1-0', nodeName: 'zcvc' }]
}
]
}
@@ -150,10 +166,11 @@ const apiTreeData = [
export default {
name: 'DomesticStandardList',
- components: { Search, JTable, DomesticStandardModal },
+ components: { Search, JTable, DomesticStandardModal, UserSelectModal, DomesticSystemTreeModal },
mixins: [ConfigurableTableMixin],
data () {
return {
+ StandardSystemTreeNodeType,
treeInput: null, // 树查询绑定值
treeData: [],
mouseInNodeKey: null, // 鼠标悬浮的节点key值
@@ -162,7 +179,7 @@ export default {
// 收藏
{
text: this.$t('standardRegulationLibrary.domesticStandard.cancelCollection'),
- clickEvent: 'collection',
+ clickEvent: 'handleCollection',
has: ''
},
{
@@ -185,21 +202,42 @@ export default {
getQueryConditionFunc: getDomesticStandardSearchForm,
url: {
list: '/laws/standard/domestic/getCommonPage',
- delete: '/laws/standard/domestic/deleteByIdsAndModule'
- }
+ delete: '/laws/standard/domestic/deleteByIdsAndModule',
+ downTemplateUrl: '', // 下载模板
+ exportXlsUrl: '', // 导出
+ exportZipUrl: '', // 带文件导出
+ importExcelUrl: '' // 导入
+ },
+ dataSource: [{ id: 1, collectionFlag: '1' }],
+ yesValue: YesOrNoEnum.YES.value,
+ noValue: YesOrNoEnum.NO.value,
+ nowShareId: null // 当前正在分享的数据的id
+ }
+ },
+ computed: {
+ importExcelUrl () {
+ return `${window._CONFIG.domianURL}/${this.url.importExcelUrl}`
}
},
created () {
this.initTreeData()
},
methods: {
+ /**
+ * 获取树数据
+ */
initTreeData () {
this.treeData = this.dealTreeData(apiTreeData)
},
+ /**
+ * 处理树数据,加入自定义的节点插槽
+ * @param treeData
+ * @returns {*}
+ */
dealTreeData (treeData) {
return treeData.map(item => {
if (item.child && item.child.length > 0) {
- item.scopedSlots = { title: 'iconCustom' }
+ item.scopedSlots = { icon: 'folder', title: 'custom' }
item.children = this.dealTreeData(item.child)
} else {
item.scopedSlots = { title: 'custom' }
@@ -207,23 +245,90 @@ export default {
return item
})
},
- handleTableSearch () {
+ /**
+ * 树节点查询
+ */
+ handleTreeSearch () {
},
+ /**
+ * 树节点鼠标移入
+ * @param key
+ */
handleTreeMouseover (key) {
this.mouseInNodeKey = key
},
+ /**
+ * 树节点鼠标移出
+ * @param key
+ */
handleTreeMouseout (key) {
if (this.mouseInNodeKey === key) {
this.mouseInNodeKey = null
}
},
+ /**
+ * 表格操作点击
+ * @param operation
+ * @param record
+ */
operationClick (operation, record) {
if (operation.clickEvent === 'handleDelete') {
this.handleDelete(record.id)
} else {
this[operation.clickEvent](record)
}
+ },
+ /**
+ * 收藏/取消收藏
+ * @param record
+ */
+ handleCollection ({ collectionFlag }) {
+ if (collectionFlag === this.yesValue) {
+ this.dataSource[0].collectionFlag = this.noValue
+ } else {
+ this.dataSource[0].collectionFlag = this.yesValue
+ }
+ },
+ /**
+ * 分享
+ */
+ handleShare ({ id }) {
+ this.nowShareId = id
+ this.$refs.userSelectModal.open()
+ },
+ /**
+ * 选择分享的人之后继续分享
+ * @param ids
+ */
+ continueShare (ids) {
+ const params = {
+ id: this.nowShareId, // 要分享的标准的id
+ userIds: ids // 分享给的用户的id
+ }
+ this.loading = true
+ shareDomesticStandard(params).then(res => {
+ if (res.success) {
+ this.$message.success(res.message)
+ } else {
+ this.$message.warn(res.message)
+ }
+ }).finally(() => {
+ this.loading = false
+ })
+ },
+ modalFormOk () {
+ this.initTreeData()
+ // 新增/修改 成功时,重载列表
+ this.loadData()
+ // 清空列表选中
+ this.onClearSelected()
+ },
+ handleAddTreeNode ({ dataRef }) {
+ this.$refs.treeModal.add({ parentId: dataRef.key })
+ },
+ handleEditTreeNode ({ dataRef }) {
+ this.$refs.treeModal.edit(dataRef)
}
}
}
@@ -237,7 +342,7 @@ export default {
}
.tree-icon {
- line-height: 24px;
+ color: #1D2129;
}
.tree-operate-node {
@@ -262,9 +367,9 @@ export default {
color: #D52C26;
}
- img {
- width: 13px;
- height: 13px;
+ i {
+ color: @primary-color;
+ height: 20px;
}
}
}
diff --git a/src/views/standardRegulationLibrary/domesticStandard/modules/DomesticSystemTreeModal.vue b/src/views/standardRegulationLibrary/domesticStandard/modules/DomesticSystemTreeModal.vue
new file mode 100644
index 00000000..1b61c6d9
--- /dev/null
+++ b/src/views/standardRegulationLibrary/domesticStandard/modules/DomesticSystemTreeModal.vue
@@ -0,0 +1,101 @@
+
+
+
+
+
+ event.target.value = event.target.value.trim()"
+ :maxLength="50"
+ v-decorator="[ 'nodeName', validatorRules.nodeName]" />
+
+
+
+
+
+
+
+
+
diff --git a/src/views/standardRegulationLibrary/overseasStandard/OverseasStandardList.vue b/src/views/standardRegulationLibrary/overseasStandard/OverseasStandardList.vue
index cf7123d1..a0518c73 100644
--- a/src/views/standardRegulationLibrary/overseasStandard/OverseasStandardList.vue
+++ b/src/views/standardRegulationLibrary/overseasStandard/OverseasStandardList.vue
@@ -5,17 +5,7 @@
-
-
-

-
-
- {{ title }}
-
- {{ title }}
-
-
-
+
@@ -30,11 +20,11 @@
-
+
-
+