<h2>数据关联  <span ng-show="categoryId>0"> - {{category.categoryName}}</span></h2>


分类：
<ul style="width: 980px"><li ng-repeat="c in cates" style="float:left;width:110px"><a style="color:blue" href="#/admin/join/{{c.ID}}"> {{c.categoryName}}</a></li></ul>


<div style="width:100%;float:right;" ng-show="categoryId>0">
    <input id="rowcount" type="hidden" value="0" />
    <input id="rowdel" type="hidden" value="" />
    <input type="button" value="添加" ng-click="addChild();" />

    <div id="sublist">

        <table id="sub" class="childTable" style="width:100%" tag="table_admin">
            <tr>
                <th>编号</th>
                <th>关联分类</th>
                <th>关联数据列</th>
                <th>关联类型</th>               
                <th>操作</th>
            </tr>

            <tr class="hide">
                <td>
                    <div>
                        <input tag='edit' class="admin_text index" type='text' name='ID' disabled="disabled" />
                    </div>
                </td>


                <td>
                    <div>
                        <select name='joinCategoryId' tag="edit">
                            <option ng-repeat="obj in cates" value="{{obj.ID}}"> {{obj.categoryName}} </option>
                        </select>
                    </div>
                </td>

                <td>
                    <div>
                        <select name='joinPatternId' tag="edit">
                            <option value="0">请选择</option>
                            <optgroup ng-repeat="c in patterns" label="{{c.c.categoryName}}">
                                <option ng-repeat="s in c.p" value="{{s.ID}}" >{{s.pName}}</option>
                            </optgroup>     
                        </select>
                    </div>
                </td>


                <td>
                    <div>
                        <select name='nRelation' tag="edit">
                            <option  value="1"> 1:1 </option>
                            <option value="2"> 1:N </option>
                            <option value="3"> N:1 </option>
                            <option value="4"> M:N </option>
                        </select>
                    </div>
                </td>

        


                <td> <a style="color:blue;" href="javascript:void(0);" class="remove">删除</a></td>

            </tr>
            <tr ng-repeat="row in result" ng-show="result.length">
                <td>
                    <div>
                        <input tag='edit' class="admin_text index" type='text' name='ID' disabled="disabled" ng-model="row.ID" />
                    </div>
                </td>


                <td>
                    <div>
                        <select name='joinCategoryId' tag="edit">
                            <option ng-repeat="obj in cates" value="{{obj.ID}}" ng-selected="obj.ID==row.joinCategoryId"> {{obj.categoryName}} </option>
                        </select>
                    </div>
                </td>

                <td>
                    <div>
                        <select name='joinPatternId' tag="edit">
                            <option value="0">请选择</option>
                            <optgroup ng-repeat="c in patterns" label="{{c.c.categoryName}}">
                                <option ng-repeat="s in c.p" value="{{s.ID}}" ng-selected="row.joinPatternId==s.ID">{{s.pName}}</option>
                            </optgroup>
                        </select>
                    </div>
                </td>


                <td>
                    <div>
                        <select name='nRelation' tag="edit" ng-model="row.nRelation">
                            <option value="1"> 1:1 </option>
                            <option value="2"> 1:N </option>
                            <option value="3"> N:1 </option>
                            <option value="4"> M:N </option>
                        </select>
                    </div>
                </td>






                <td> <a style="color:blue;" href="javascript:void(0);" class="remove">删除</a></td>


            </tr>



        </table>

    </div>
</div>







<input type="button" value="更新" ng-click="adapter();" ng-show="categoryId>0" />