绘制技术监督页面 联调承载能力评估
This commit is contained in:
@@ -9,11 +9,11 @@
|
||||
<!-- switch -->
|
||||
<el-switch
|
||||
v-if="field.render == 'switch'"
|
||||
@change="onChangeField"
|
||||
@change="onChangeField(field, $event)"
|
||||
:model-value="fieldValue.toString()"
|
||||
:loading="row.loading"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
:active-value="field.activeValue"
|
||||
:inactive-value="field.inactiveValue"
|
||||
/>
|
||||
|
||||
<!-- image -->
|
||||
@@ -172,8 +172,10 @@ if (props.field.renderFormatter && typeof props.field.renderFormatter == 'functi
|
||||
fieldValue.value = props.field.renderFormatter(props.row, props.field, fieldValue.value, props.column, props.index)
|
||||
}
|
||||
|
||||
const onChangeField = (value: any) => {
|
||||
TableStore.onTableAction('field-change', { value: value, ...props })
|
||||
const onChangeField = (row: any, value: any) => {
|
||||
row.onChangeField && row.onChangeField(props.row, value)
|
||||
|
||||
// TableStore.onTableAction('field-change', { value: value, ...props })
|
||||
}
|
||||
|
||||
const onButtonClick = (btn: OptButton) => {
|
||||
|
||||
322
src/components/tree/pqs/policyTree.vue
Normal file
322
src/components/tree/pqs/policyTree.vue
Normal file
@@ -0,0 +1,322 @@
|
||||
<template>
|
||||
<div class="point-tree">
|
||||
<div style="flex: 1; overflow: hidden">
|
||||
<vxe-table
|
||||
ref="tableRef"
|
||||
:data="tree"
|
||||
height="auto"
|
||||
v-bind="defaultAttribute"
|
||||
:tree-config="{ children: 'children', expandAll: true }"
|
||||
>
|
||||
<vxe-column field="name" align="left" title="部门" tree-node></vxe-column>
|
||||
<vxe-column width="200" title="操作">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" size="small" link @click="tactics(row.id, 0)">自动</el-button>
|
||||
<el-button type="primary" size="small" link @click="tactics(row.id, 1)">手动</el-button>
|
||||
<el-button type="primary" size="small" link @click="tactics(row.id, 2)">排除</el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { nextTick, onMounted, ref, useAttrs } from 'vue'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { ElTree } from 'element-plus'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { existMonitorDeptTree } from '@/api/user-boot/user.ts'
|
||||
|
||||
import { useConfig } from '@/stores/config'
|
||||
|
||||
defineOptions({
|
||||
name: 'pms/pointTree'
|
||||
})
|
||||
const emit = defineEmits(['tactics'])
|
||||
const attrs = useAttrs()
|
||||
const defaultProps = {
|
||||
label: 'name',
|
||||
value: 'id'
|
||||
}
|
||||
const dictData = useDictData()
|
||||
const config = useConfig()
|
||||
const tree = ref()
|
||||
const treeRef = ref()
|
||||
|
||||
const loadData = () => {
|
||||
let nodeKey = ''
|
||||
tree.value = [
|
||||
{
|
||||
id: '5699e5916a18a6381e1ac92da5bd2628',
|
||||
name: '国家电网公司',
|
||||
pid: '0',
|
||||
sort: 201,
|
||||
code: '123456789',
|
||||
specialType: null,
|
||||
area: '0',
|
||||
areaName: '中国',
|
||||
state: 1,
|
||||
type: 0,
|
||||
remark: '国家电网公司',
|
||||
children: [
|
||||
{
|
||||
id: '0d52f9f6e43ec0ee83013cd32da93f66',
|
||||
name: '国网河北电力有限公司',
|
||||
pid: '5699e5916a18a6381e1ac92da5bd2628',
|
||||
sort: 200,
|
||||
code: '13B9B47F1E483324E05338297A0A0595',
|
||||
specialType: null,
|
||||
area: '130000000000',
|
||||
areaName: '河北',
|
||||
state: 1,
|
||||
type: 1,
|
||||
remark: '国网河北省电力公司',
|
||||
children: [
|
||||
{
|
||||
id: '3c9e6eea884a3ab5c891122f13715e4b',
|
||||
name: '国网石家庄供电公司',
|
||||
pid: '0d52f9f6e43ec0ee83013cd32da93f66',
|
||||
sort: 0,
|
||||
code: '13B9B47F1F223324E05338297A0A0595',
|
||||
specialType: null,
|
||||
area: '130100000000',
|
||||
areaName: '石家庄',
|
||||
state: 1,
|
||||
type: 1,
|
||||
remark: '国网石家庄供电公司',
|
||||
children: [
|
||||
{
|
||||
id: '8590eba00eb6ab38ef2d06805602e0ce',
|
||||
name: '国网石家庄供电公司本部',
|
||||
pid: '3c9e6eea884a3ab5c891122f13715e4b',
|
||||
sort: 80,
|
||||
code: '13B9B47F1F773324E05338297A0A0595',
|
||||
specialType: 1,
|
||||
area: '0',
|
||||
areaName: '中国',
|
||||
state: 1,
|
||||
type: 1,
|
||||
remark: '',
|
||||
children: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: '17439407bfee299b7e38f2e54a8f6d28',
|
||||
name: '国网沧州供电公司',
|
||||
pid: '0d52f9f6e43ec0ee83013cd32da93f66',
|
||||
sort: 1,
|
||||
code: '13B9B47F2C183324E05338297A0A0595',
|
||||
specialType: null,
|
||||
area: '130900000000',
|
||||
areaName: '沧州',
|
||||
state: 1,
|
||||
type: 1,
|
||||
remark: '国网沧州供电公司',
|
||||
children: [
|
||||
{
|
||||
id: 'c8efb47ecb20fbf342eba4665f45f2f6',
|
||||
name: '国网沧州供电公司本部',
|
||||
pid: '17439407bfee299b7e38f2e54a8f6d28',
|
||||
sort: 34,
|
||||
code: '13B9B47F2C803324E05338297A0A0595',
|
||||
specialType: 1,
|
||||
area: '0',
|
||||
areaName: '中国',
|
||||
state: 1,
|
||||
type: 1,
|
||||
remark: '',
|
||||
children: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: '15737b8ed8cb70602163c41918bde12d',
|
||||
name: '国网邢台供电公司',
|
||||
pid: '0d52f9f6e43ec0ee83013cd32da93f66',
|
||||
sort: 2,
|
||||
code: '13B9B47F25A73324E05338297A0A0595',
|
||||
specialType: null,
|
||||
area: '130500000000',
|
||||
areaName: '邢台',
|
||||
state: 1,
|
||||
type: 1,
|
||||
remark: '国网邢台供电公司',
|
||||
children: [
|
||||
{
|
||||
id: '694288d464a23da82e42727f3d8fd432',
|
||||
name: '国网邢台供电公司本部',
|
||||
pid: '15737b8ed8cb70602163c41918bde12d',
|
||||
sort: 7,
|
||||
code: '13B9B47F27F63324E05338297A0A0595',
|
||||
specialType: 1,
|
||||
area: '0',
|
||||
areaName: '中国',
|
||||
state: 1,
|
||||
type: 1,
|
||||
remark: '',
|
||||
children: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: '193980db73494188de052479c4e37d46',
|
||||
name: '国网保定供电公司',
|
||||
pid: '0d52f9f6e43ec0ee83013cd32da93f66',
|
||||
sort: 3,
|
||||
code: '13B9B47F2EEB3324E05338297A0A0595',
|
||||
specialType: null,
|
||||
area: '130600000000',
|
||||
areaName: '保定',
|
||||
state: 1,
|
||||
type: 1,
|
||||
remark: '国网保定供电公司',
|
||||
children: [
|
||||
{
|
||||
id: '2d1904c1187f751e4387e3351839dc6d',
|
||||
name: '国网保定供电公司本部',
|
||||
pid: '193980db73494188de052479c4e37d46',
|
||||
sort: 42,
|
||||
code: '13B9B47F2F173324E05338297A0A0595',
|
||||
specialType: 1,
|
||||
area: '0',
|
||||
areaName: '中国',
|
||||
state: 1,
|
||||
type: 1,
|
||||
remark: '',
|
||||
children: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: '2adc64baf2308725c4e91105b3186b21',
|
||||
name: '国网衡水供电公司',
|
||||
pid: '0d52f9f6e43ec0ee83013cd32da93f66',
|
||||
sort: 4,
|
||||
code: '13B9B47F23B83324E05338297A0A0595',
|
||||
specialType: null,
|
||||
area: '131100000000',
|
||||
areaName: '衡水',
|
||||
state: 1,
|
||||
type: 1,
|
||||
remark: '国网衡水供电公司',
|
||||
children: [
|
||||
{
|
||||
id: 'd3d4b1c41c6115ec9aff0362f5c41930',
|
||||
name: '国网衡水供电公司本部',
|
||||
pid: '2adc64baf2308725c4e91105b3186b21',
|
||||
sort: 65,
|
||||
code: '13B9B47F251C3324E05338297A0A0595',
|
||||
specialType: 1,
|
||||
area: '0',
|
||||
areaName: '中国',
|
||||
state: 1,
|
||||
type: 1,
|
||||
remark: '',
|
||||
children: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'dda5d903c9ad44979d3d50e9c83cf564',
|
||||
name: '国网邯郸供电公司',
|
||||
pid: '0d52f9f6e43ec0ee83013cd32da93f66',
|
||||
sort: 5,
|
||||
code: '13B9B47F28CA3324E05338297A0A0595',
|
||||
specialType: null,
|
||||
area: '130400000000',
|
||||
areaName: '邯郸',
|
||||
state: 1,
|
||||
type: 1,
|
||||
remark: '国网邯郸供电公司',
|
||||
children: [
|
||||
{
|
||||
id: '33e1b89c5963a73f355713f85ad3b3c4',
|
||||
name: '国网邯郸供电公司本部',
|
||||
pid: 'dda5d903c9ad44979d3d50e9c83cf564',
|
||||
sort: 97,
|
||||
code: '13B9B47F2BAE3324E05338297A0A0595',
|
||||
specialType: 1,
|
||||
area: '0',
|
||||
areaName: '中国',
|
||||
state: 1,
|
||||
type: 1,
|
||||
remark: '',
|
||||
children: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'a3069759b0b6072c99cf9a7af6c162e9',
|
||||
name: '国网河北超高压公司',
|
||||
pid: '0d52f9f6e43ec0ee83013cd32da93f66',
|
||||
sort: 9,
|
||||
code: '13B9B47F1E4F3324E05338297A0A0595',
|
||||
specialType: 1,
|
||||
area: '130000000000',
|
||||
areaName: '河北',
|
||||
state: 1,
|
||||
type: 1,
|
||||
remark: '河北超高压公司',
|
||||
children: [
|
||||
{
|
||||
id: 'd3de780cba5813b0c089a6fe1ecdae25',
|
||||
name: '国网河北超高压公司本部',
|
||||
pid: 'a3069759b0b6072c99cf9a7af6c162e9',
|
||||
sort: 0,
|
||||
code: '13B9B47F1E813324E05338297A0A0595',
|
||||
specialType: 1,
|
||||
area: '130000000000',
|
||||
areaName: '河北',
|
||||
state: 1,
|
||||
type: 1,
|
||||
remark: '',
|
||||
children: []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
// existMonitorDeptTree().then(res => {
|
||||
// console.log(res)
|
||||
// // nodeKey = res.data[0].children[0].children[0].children[0].children[0].children[0].id
|
||||
// // emit('init', res.data[0].children[0].children[0].children[0].children[0].children[0])
|
||||
// tree.value = res.data
|
||||
|
||||
// if (nodeKey) {
|
||||
// nextTick(() => {
|
||||
// treeRef.value.treeRef.setCurrentKey(nodeKey)
|
||||
// // treeRef.value.treeRef.setExpandedKeys(nodeKey)
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
}
|
||||
const tactics = (deptId, grade) => {
|
||||
emit('tactics', deptId, grade)
|
||||
}
|
||||
loadData()
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.point-tree {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
border: 1px solid var(--el-border-color);
|
||||
}
|
||||
.custom {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
padding-right: 20px;
|
||||
// font-size: 14px;
|
||||
// padding-right: 8px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user