Commit fff8ef89 by li_hongchao

组织结构解析

parent b4969968
import PrintLog from './LogcatUtil'
const _DEFAULT_KEYS = [
'公安厅',
'公安局',
'分局',
'派出所',
'支队',
'大队',
'中队',
]
const _TAG = '\\src\\utils\\LogcatUtil.js'
export default {
last(content, defult = '...') {
if (content && content.length <= 10) {
return content
}
let result = this.lastZzjg(content, defult)
// PrintLog('last(content, defult)', result, _TAG)
return result
},
lastZzjg(content, defult = '...') {
let arrs = parseStr(_DEFAULT_KEYS, content)
let result
if (arrs && arrs.length > 0) {
result = defult + arrs[arrs.length - 1]
}
// PrintLog('lastZzjg(content, defult)', result, _TAG)
return result
},
parseAll(keyArr, content) {
let result = parseStr(keyArr, content)
// PrintLog('parseAll(keyArr, content)', result, _TAG)
return result
},
parseZzjg(content) {
let result = parseStr(_DEFAULT_KEYS, content)
// PrintLog('parseZzjg(content)', result, _TAG)
return result
},
}
let parseStr = function (keyArrs, content) {
if (!keyArrs) {
PrintLog('解析关键字', '解析关键字为空', _TAG)
return []
}
if (!content || content === '' || content === 'null') {
PrintLog('解析内容', '解析内容为空', _TAG)
return []
}
PrintLog('解析关键字', keyArrs, _TAG)
PrintLog('解析内容', content, _TAG)
let arrs = []
let temp = content
let tempArr
let index
keyArrs.forEach(item => {
if (!temp || temp === '') {
if (arrs.length === 0) {
arrs.push(content)
}
PrintLog('解析结果', arrs, _TAG)
return arrs
}
index = temp.indexOf(item)
if (index > 0) {
tempArr = temp.split(item)
if (tempArr && tempArr.length === 2) {
if (tempArr[0]) {
arrs.push(tempArr[0] + item)
}
temp = tempArr[1]
index = -1
}
}
})
if (arrs.length === 0) {
arrs.push(content)
}
PrintLog('解析结果', arrs, _TAG)
return arrs
}
...@@ -258,6 +258,19 @@ ...@@ -258,6 +258,19 @@
</el-table-column> </el-table-column>
</div> </div>
<div v-else-if="item.prop === 'sbdwGajgjgdmStr'">
<el-table-column v-if="item.isShow" :prop="item.prop"
:label="item.label" width="auto" :min-width="item.width"
show-overflow-tooltip>
<template slot-scope="scope">
<el-tooltip effect="dark" :content="scope.row.sbdwGajgjgdmStr"
placement="top-start">
<div> {{ getLable(scope.row.sbdwGajgjgdmStr)}}</div>
</el-tooltip>
</template>
</el-table-column>
</div>
<div v-else> <div v-else>
<el-table-column v-if="item.isShow" :prop="item.prop" <el-table-column v-if="item.isShow" :prop="item.prop"
:label="item.label" width="auto" :min-width="item.width" :label="item.label" width="auto" :min-width="item.width"
...@@ -321,6 +334,7 @@ import bzxxsfOpt from '../bzxxgl/BzxxsfOpt.vue' ...@@ -321,6 +334,7 @@ import bzxxsfOpt from '../bzxxgl/BzxxsfOpt.vue'
import PrintLog from '../../utils/LogcatUtil' import PrintLog from '../../utils/LogcatUtil'
import {queryShList, bzxxPlSb} from '../../netmgr/bzxxgl/bzxxsh' import {queryShList, bzxxPlSb} from '../../netmgr/bzxxgl/bzxxsh'
import stRole from '../../utils/UserUtil' import stRole from '../../utils/UserUtil'
import ZzjgUtil from '../../utils/ZzjgUtil.js'
export default { export default {
name: 'bzxxsh', name: 'bzxxsh',
...@@ -333,7 +347,7 @@ export default { ...@@ -333,7 +347,7 @@ export default {
MBTMH: {width: '220', prop: 'mbtmh', label: '目标条码号', isShow: true}, MBTMH: {width: '220', prop: 'mbtmh', label: '目标条码号', isShow: true},
YZW: {width: '125', prop: 'yzw', label: '源指位/序号', isShow: true}, YZW: {width: '125', prop: 'yzw', label: '源指位/序号', isShow: true},
MBZW: {width: '125', prop: 'mbzw', label: '目标指位/序号', isShow: true}, MBZW: {width: '125', prop: 'mbzw', label: '目标指位/序号', isShow: true},
SBDW: {width: '220', prop: 'sbdwGajgjgdmStr', label: '上报单位', isShow: true}, SBDW: {width: '160', prop: 'sbdwGajgjgdmStr', label: '上报单位', isShow: true},
SBSJ: {width: '160', prop: 'sbsj', label: '上报时间', isShow: true}, SBSJ: {width: '160', prop: 'sbsj', label: '上报时间', isShow: true},
SHR: {width: '120', prop: 'shrXm', label: '审核人', isShow: true}, SHR: {width: '120', prop: 'shrXm', label: '审核人', isShow: true},
SHSJ: {width: '120', prop: 'shsj', label: '审核时间', isShow: true}, SHSJ: {width: '120', prop: 'shsj', label: '审核时间', isShow: true},
...@@ -418,6 +432,7 @@ export default { ...@@ -418,6 +432,7 @@ export default {
_that.initTableColumns() _that.initTableColumns()
// _that.initTestData() // _that.initTestData()
_that.getData() _that.getData()
_that.getLable("你好。。。")
}, },
computed: { computed: {
roleArr() { roleArr() {
...@@ -425,6 +440,9 @@ export default { ...@@ -425,6 +440,9 @@ export default {
}, },
}, },
methods: { methods: {
getLable(label) {
return ZzjgUtil.last(label)
},
initTableColumns() { initTableColumns() {
let _that = this let _that = this
let w1 = 1920 let w1 = 1920
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment