想实现如下联动:选择城市,区域列只出现城市对应的区域
编辑界面无法联动
mysql 8 版本 数据库有两张表如下:
CREATE TABLE `target` (
`id` int NOT NULL AUTO_INCREMENT,
`city` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '城市',
`city_area` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '区域',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
CREATE TABLE `wb` (
`city` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '城市',
`city_area` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '区域'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
INSERT INTO `wb` (`city`, `city_area`) VALUES ('深圳', '南山区');
INSERT INTO `wb` (`city`, `city_area`) VALUES ('深圳', '宝安区');
INSERT INTO `wb` (`city`, `city_area`) VALUES ('武汉', '高新区');
INSERT INTO `wb` (`city`, `city_area`) VALUES ('武汉', '汉阳区');
说明:target为需要填进数据的表,wb(维表)为下拉框选项的值
报表城市列和区域列编辑界面如下
|