AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
## 弹窗效果 ![](https://img.kancloud.cn/90/1e/901eaf0272f0b2c53b538f8bb3463749_805x579.png) ## 作用 列表数据选择,并回调选中数据 ## js 端代码 1、routes.js 路由中 添加js引用 ``` "/App/common/views/common/selectModal.js?v=" + $.CPS.vtime, ``` ![](https://img.kancloud.cn/77/64/77648d1eaa11a4003f24c2c9192adafb_755x371.png) 2、头部添加 selectModal 对象 ~~~ angular.module('app').controller('xxxx', [     '$scope', '$uibModal', 'selectModal', function ($scope, $uibModal, selectModal) { ~~~ 3、添加函数 ``` vm.select = function () { // 打开选择框 selectModal.open({                 title: "选择区域",                 readMethod: locationService.getRegionPage, //数据源                 showFilter: true,                 checkbox: true,                 singleCheck: true,                 parameter: { isDistinct: true }, //传的参数                 height: 300,                 columns: [                     { title: "区域编码", field: 'regionCode', filterable: true, headerAttributes: { style: "text-align: center;" }, attributes: { style: 'text-align: center;' } },                     { title: "区域名字", field: 'regionName', filterable: true, headerAttributes: { style: "text-align: center;" }, attributes: { style: 'text-align: center;' } },                 ],                 filterColumns: 'regionCode|regionName', //展示信息的列表字段                 retProperty: "id,regionCode,regionName", //从选中的回调数据里,选择需要的字段                 callback: function (selectedValues) {                     var result = selectedValues[0];                     console.log(result);                     console.log(selectIds);                 }             }); } ```