<commit_before>/**
 * 
 */
var EasyAssess = require('../../easyassess.application');

EasyAssess.directives["esFormGroup"] 
	= EasyAssess.app.directive("esFormGroup", function(ngDialog) {
	
	return {
		restrict: 'E',
		replace: true,
		transclude: false,
		template:  '<div class="es-form-group">' 
				  +	 '<table class="table table-striped">'
		          + 	'<thead><tr><th style="width:15%;">检测分类</th><th style="width:45%;">样本</th><!--th style="width:40%;">编码组</th>--></tr></thead>'
		          +     '<tbody>'
		          +			'<tr>'
		          +				'<td>'
		          +					'<table>'
		          +						'<tr>'
		          +							'<td class="es-form-group-cell" valign="middle"><es-text-box es-content="{{esGroup.name}}" es-change-callback="nameChanged(val)" class="es-form-group-text" es-placeholder="请输入分组名"></es-text-box></td>'
		          +						'</tr>'
		          +						'<tr ng-repeat="row in esGroup.rows">'
		          +							'<td class="es-form-group-cell" valign="middle"><div>{{row.item.subject}} - {{row.item.unit}} <span class="glyphicon glyphicon-remove es-delete-button" ng-click="removeRow(row.guid)"></span></div></td>'
		          +						'</tr>'
		          +					'</table>'
		          +				'</td>'
		          +				'<td>'
		          +					'<table>'
		          +						'<tr>'
		          +							'<td class="es-form-group-cell" ng-repeat="s_col in esGroup.specimens"><table><tr><td><span class="es-form-group-title">{{s_col.number}}</span></td><td><span class="glyphicon glyphicon-remove es-delete-button" ng-click="removeColumn(s_col.guid,\'specimens\')"></span></td></tr></table></td><td><es-add-button style="min-width:50px;" es-ids="addSpecimen" es-text="样本" title="添加样本"></es-add-button></td>'
		          +						'</tr>'
		          +						'<tr ng-repeat="row in esGroup.rows">'
		          +							'<td class="es-form-group-cell" ng-repeat="s_col in esGroup.specimens"><es-form-expect-option ng-if="esType == \'assess\'" es-group-row="row" es-specimen-column="s_col"></es-form-expect-option><es-iqc-form-expect-option ng-if="esType.iqc" es-group-row="row" es-specimen-column="s_col"></es-iqc-form-expect-option></td>'
		          +						'</tr>'
		          +					'</table>'
		          +				'</td>'
					+  			'<td>'
					+					'<table>'
					+						'<tr>'
					+							'<td class="es-form-group-cell" ng-repeat="s_col in esGroup.codeGroups"><table><tr><td><span class="es-form-group-title">{{s_col.name}}</span></td><td><span class="glyphicon glyphicon-remove es-delete-button" ng-click="removeColumn(s_col.guid,\'codeGroups\')"></span></td></tr></table></td><td><es-add-button style="min-width:80px;" es-ids="addCode" es-text="编码组" title="添加编码组"></es-add-button></td>'
					+						'</tr>'
					+						'<tr ng-repeat="row in esGroup.rows">'
					+							'<td class="es-form-group-cell" ng-repeat="s_col in esGroup.codeGroups"><div class="input-group span6"><span class="form-control" style="width:20px;"></span><span class="input-group-addon" style="width:20px;"><span class="glyphicon glyphicon-search"></span></span></div></td>'
					+						'</tr>'
					+					'</table>'
					+				'</td>'
		          +			'</tr>'
		          +			'<tr>'
		          +				'<td colspan="3" style="padding:5px 0px 5px 0px;">'
		          +					'<es-add-button es-ids="addItem" es-text="添加新项目" title="添加新项目"></es-add-button>'
		          +				'</td>'
		          +			'</tr>'
		          +	 	'</tbody></table>'
		          + '</div>',
		scope: {
			esGroup:"=",
			esType:"@?"
		},
		
		controller: ["$scope", function($scope, $element, $attrs){
			if (!$scope.esGroup.guid) {
				$scope.esGroup.guid = EasyAssess.utils.generateGUID();
			}
			
			$scope.removeColumn = function(guid, set) {
				// remove columns
				var columns = $scope.esGroup[set];
				for (var i=0;i<columns.length;i++) {
					if (columns[i].guid == guid) {
						columns.splice(i, 1);
						break;
					}
				}<commit_msg>Allow to edit specimen number<commit_after>/**
 * 
 */
var EasyAssess = require('../../easyassess.application');

EasyAssess.directives["esFormGroup"] 
	= EasyAssess.app.directive("esFormGroup", function(ngDialog) {
	
	return {
		restrict: 'E',
		replace: true,
		transclude: false,
		template:  '<div class="es-form-group">' 
				  +	 '<table class="table table-striped">'
		          + 	'<thead><tr><th style="width:15%;">检测分类</th><th style="width:45%;">样本</th><!--th style="width:40%;">编码组</th>--></tr></thead>'
		          +     '<tbody>'
		          +			'<tr>'
		          +				'<td>'
		          +					'<table>'
		          +						'<tr>'
		          +							'<td class="es-form-group-cell" valign="middle"><es-text-box es-content="{{esGroup.name}}" es-change-callback="nameChanged(val)" class="es-form-group-text" es-placeholder="请输入分组名"></es-text-box></td>'
		          +						'</tr>'
		          +						'<tr ng-repeat="row in esGroup.rows">'
		          +							'<td class="es-form-group-cell" valign="middle"><div>{{row.item.subject}} - {{row.item.unit}} <span class="glyphicon glyphicon-remove es-delete-button" ng-click="removeRow(row.guid)"></span></div></td>'
		          +						'</tr>'
		          +					'</table>'
		          +				'</td>'
		          +				'<td>'
		          +					'<table>'
		          +						'<tr>'
		          +							'<td class="es-form-group-cell" ng-repeat="s_col in esGroup.specimens"><table><tr><td><es-text-box es-content="{{s_col.number}}" es-change-callback="specimenNumberChange(val, s_col)" class="es-form-group-title" es-placeholder=""></es-text-box></td><td><span class="glyphicon glyphicon-remove es-delete-button" ng-click="removeColumn(s_col.guid,\'specimens\')"></span></td></tr></table></td><td><es-add-button style="min-width:50px;" es-ids="addSpecimen" es-text="样本" title="添加样本"></es-add-button></td>'
		          +						'</tr>'
		          +						'<tr ng-repeat="row in esGroup.rows">'
		          +							'<td class="es-form-group-cell" ng-repeat="s_col in esGroup.specimens"><es-form-expect-option ng-if="esType == \'assess\'" es-group-row="row" es-specimen-column="s_col"></es-form-expect-option><es-iqc-form-expect-option ng-if="esType.iqc" es-group-row="row" es-specimen-column="s_col"></es-iqc-form-expect-option></td>'
		          +						'</tr>'
		          +					'</table>'
		          +				'</td>'
					+  			'<td>'
					+					'<table>'
					+						'<tr>'
					+							'<td class="es-form-group-cell" ng-repeat="s_col in esGroup.codeGroups"><table><tr><td><span class="es-form-group-title">{{s_col.name}}</span></td><td><span class="glyphicon glyphicon-remove es-delete-button" ng-click="removeColumn(s_col.guid,\'codeGroups\')"></span></td></tr></table></td><td><es-add-button style="min-width:80px;" es-ids="addCode" es-text="编码组" title="添加编码组"></es-add-button></td>'
					+						'</tr>'
					+						'<tr ng-repeat="row in esGroup.rows">'
					+							'<td class="es-form-group-cell" ng-repeat="s_col in esGroup.codeGroups"><div class="input-group span6"><span class="form-control" style="width:20px;"></span><span class="input-group-addon" style="width:20px;"><span class="glyphicon glyphicon-search"></span></span></div></td>'
					+						'</tr>'
					+					'</table>'
					+				'</td>'
		          +			'</tr>'
		          +			'<tr>'
		          +				'<td colspan="3" style="padding:5px 0px 5px 0px;">'
		          +					'<es-add-button es-ids="addItem" es-text="添加新项目" title="添加新项目"></es-add-button>'
		          +				'</td>'
		          +			'</tr>'
		          +	 	'</tbody></table>'
		          + '</div>',
		scope: {
			esGroup:"=",
			esType:"@?"
		},
		
		controller: ["$scope", function($scope, $element, $attrs){
			if (!$scope.esGroup.guid) {
				$scope.esGroup.guid = EasyAssess.utils.generateGUID();
			}

			$scope.specimenNumberChange = function(val, specimen) {
				specimen.number = val;
			}

			$scope.removeColumn = function(guid, set) {
				// remove columns
				var columns = $scope.esGroup[set];
				for (var i=0;i<columns.length;i++) {
					if (columns[i].guid == guid) {
						columns.splice(i, 1);
						break;
					}
				}
{'fraction_non_alphanumeric': 0.22871743736756825, 'fraction_numerical': 0.00548423283061199, 'mean_word_length': 2.4856646394439617, 'pattern_counts': {'":': 0, '<': 225, '<?xml version=': 0, '>': 225, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2392217', 'n_tokens_mistral': 3524, 'n_tokens_neox': 2917, 'n_words': 359}