修改树节点区县key
This commit is contained in:
parent
04305171ce
commit
4001c4942f
@ -114,7 +114,7 @@ const getTreeData = async () => {
|
|||||||
type: "root",
|
type: "root",
|
||||||
children: res.data.areaList.map((qx, index) => (
|
children: res.data.areaList.map((qx, index) => (
|
||||||
{
|
{
|
||||||
id: index,
|
id: qx.qxmc,
|
||||||
name: `${qx.qxmc}(${qx.sbsl})`,
|
name: `${qx.qxmc}(${qx.sbsl})`,
|
||||||
type: 'area',
|
type: 'area',
|
||||||
children: qx.yhzList.map(site => ({
|
children: qx.yhzList.map(site => ({
|
||||||
|
|||||||
@ -130,7 +130,7 @@ const getTreeData = async () => {
|
|||||||
type: "root",
|
type: "root",
|
||||||
children: res.data.areaList.map((qx, index) => (
|
children: res.data.areaList.map((qx, index) => (
|
||||||
{
|
{
|
||||||
id: index,
|
id: qx.qxmc,
|
||||||
name: `${qx.qxmc}(${qx.wzsl})`,
|
name: `${qx.qxmc}(${qx.wzsl})`,
|
||||||
type: 'area',
|
type: 'area',
|
||||||
children: qx.yhzList.map(site => ({
|
children: qx.yhzList.map(site => ({
|
||||||
|
|||||||
@ -113,7 +113,7 @@ const getTreeData = async () => {
|
|||||||
type: 'root',
|
type: 'root',
|
||||||
children: res.data.areaList.map((qx, index) => (
|
children: res.data.areaList.map((qx, index) => (
|
||||||
{
|
{
|
||||||
id: index,
|
id: qx.qxmc,
|
||||||
name: `${qx.qxmc}(${qx.bxsjsl})`,
|
name: `${qx.qxmc}(${qx.bxsjsl})`,
|
||||||
type: 'area',
|
type: 'area',
|
||||||
children: qx.yhzList.map(site => ({
|
children: qx.yhzList.map(site => ({
|
||||||
@ -137,7 +137,7 @@ const getTreeData = async () => {
|
|||||||
// 处理节点点击事件
|
// 处理节点点击事件
|
||||||
const handleNodeClick = (data, node) => {
|
const handleNodeClick = (data, node) => {
|
||||||
if (!data || !data.type) return;
|
if (!data || !data.type) return;
|
||||||
if (data.type === 'root'){
|
if (data.type === 'root') {
|
||||||
console.log('你点击的是全部')
|
console.log('你点击的是全部')
|
||||||
yhzid.value = ''; // 重置养护站id
|
yhzid.value = ''; // 重置养护站id
|
||||||
qxmc.value = ''; // 重置区县名称
|
qxmc.value = ''; // 重置区县名称
|
||||||
@ -166,7 +166,7 @@ const formatDate = (date) => {
|
|||||||
if (!date) return '';
|
if (!date) return '';
|
||||||
const pad = n => n.toString().padStart(2, '0');
|
const pad = n => n.toString().padStart(2, '0');
|
||||||
const d = new Date(date);
|
const d = new Date(date);
|
||||||
return `${d.getFullYear()}-${pad(d.getMonth()+1)}-${pad(d.getDate())} ` +
|
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ` +
|
||||||
`${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;
|
`${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user