Index: ssts-web/src/main/webapp/disinfectsystem/onlineExams/questionSet/questionSetForm.js =================================================================== diff -u -r38381 -r38424 --- ssts-web/src/main/webapp/disinfectsystem/onlineExams/questionSet/questionSetForm.js (.../questionSetForm.js) (revision 38381) +++ ssts-web/src/main/webapp/disinfectsystem/onlineExams/questionSet/questionSetForm.js (.../questionSetForm.js) (revision 38424) @@ -54,7 +54,9 @@ fields: [ { name: 'id' }, { name: 'type' }, + { name: 'typeId' }, { name: 'examlevel' }, + { name: 'examlevelId' }, { name: 'amount' }, { name: 'score' } ] @@ -78,11 +80,12 @@ menuDisabled: true, sortable: false, width: 120, + class: 'typeForDisplay', editor: new top.Ext4.form.TriggerField({ allowBlank: false, editable: false, - id: 'typeForDisplay', onTriggerClick: function () { + var that = this; var win = openModalWindowForExt(WWWROOT + '/disinfectsystem/onlineExams/httpTreeOptionView.jsp?optionType=stlb&popType=pop', '', '选择题目类别信息', '800', '500'); if (win == undefined) { @@ -97,8 +100,15 @@ if (returnValue == '') { return; } + + var id = returnValue.split(',')[0]; var name = returnValue.split(',')[1]; - top.Ext4.getCmp('typeForDisplay').setValue(name); + var configGrid = top.Ext4.getCmp('configGrid'); + var rows = configGrid.getSelectionModel().getSelection(); + rows[0].data.type = name; + rows[0].data.typeId = id; + that.setValue(name); + documentGetElementsByClassName('x4-grid-row-selected', top.document)[0].getElementsByTagName('td')[1].getElementsByTagName('div')[0].innerText = name; } }, 500); } @@ -123,7 +133,15 @@ typeAhead: false, allowBlank: false, editable: false, - name: 'examlevel' + name: 'examlevel', + listeners: { + select: function (combo, record) { + var id = record[0].data.id; + var configGrid = top.Ext4.getCmp('configGrid'); + var rows = configGrid.getSelectionModel().getSelection(); + rows[0].data.examlevelId = id; + } + } }) }, { header: "题目数量", @@ -159,17 +177,18 @@ focus: function (thiz) { thiz.selectText(); }, - focus: function (thiz, e, eOpts) { - scores = thiz.getValue(); - }, blur: function (thiz, e, eOpts) { - var oldScores = top.Ext4.getCmp('scores').getValue(); - var newScores = thiz.getValue(); - if(oldScores > scores){ - top.Ext4.getCmp('scores').setValue(oldScores+(newScores-scores)); - }else if(oldScores < scores){ - top.Ext4.getCmp('scores').setValue(oldScores-(scores-oldScores)); + var newScores = thiz.getValue() == '' ? 0 : thiz.getValue(); + var configGrid = top.Ext4.getCmp('configGrid'); + var rows = configGrid.getSelectionModel().getSelection(); + rows[0].data.score = newScores; + var sumCount = 0; + for (var i = 0; i < store.getCount(); i++) { + var item = store.getAt(i); + sumCount += item.data.score } + top.Ext4.getCmp('scores').setValue(sumCount); + documentGetElementsByClassName('x4-grid-row-selected', top.document)[0].getElementsByTagName('td')[4].getElementsByTagName('div')[0].innerText = newScores; } } }) @@ -181,7 +200,9 @@ var p = { id: '', type: '', + typeId: '', examlevel: '', + examlevelId: '', amount: '', score: '' }; Index: ssts-web/src/main/webapp/disinfectsystem/onlineExams/question/questionForm.js =================================================================== diff -u -r38380 -r38424 --- ssts-web/src/main/webapp/disinfectsystem/onlineExams/question/questionForm.js (.../questionForm.js) (revision 38380) +++ ssts-web/src/main/webapp/disinfectsystem/onlineExams/question/questionForm.js (.../questionForm.js) (revision 38424) @@ -13,7 +13,8 @@ var expDt = top.Ext4.getCmp('expDt').getRawValue(); var typeId = top.Ext4.getCmp('typeId').getValue(); var typeForDisplay = top.Ext4.getCmp('typeForDisplay').getValue(); - var difficultyValue = top.Ext4.getCmp('difficultyValue').getValue(); + var difficultyValue = top.Ext4.getCmp('difficultyValue').getRawValue(); + var difficultyId = top.Ext4.getCmp('difficultyId').getValue(); var title = top.Ext4.getCmp('title').getValue(); var optionA = top.Ext4.getCmp('optionA').getValue(); var optionB = top.Ext4.getCmp('optionB').getValue(); @@ -51,6 +52,7 @@ typeId: typeId, typeForDisplay: typeForDisplay, difficultyValue: difficultyValue, + difficultyId: difficultyId, title: title, optionA: optionA, optionB: optionB, @@ -226,6 +228,10 @@ border: 0, style: 'margin-bottom:10px', items: [{ + xtype: 'hidden', + id: 'difficultyId', + name: 'difficultyId' + }, { xtype: 'combo', fieldLabel: '难度', minChars: 0, @@ -241,7 +247,13 @@ editable: false, id: 'difficultyValue', name: 'difficultyValue', - anchor: '99%' + anchor: '99%', + listeners: { + select: function (combo, record) { + var id = record[0].data.id + top.Ext4.getCmp('difficultyId').setValue(id); + } + } }] }, { columnWidth: 0.48, @@ -474,6 +486,7 @@ top.Ext4.getCmp('typeId').setValue(result.data.typeId); top.Ext4.getCmp('typeForDisplay').setValue(result.data.typeForDisplay); top.Ext4.getCmp('difficultyValue').setValue(result.data.difficultyValue); + top.Ext4.getCmp('difficultyId').setValue(result.data.difficultyId); top.Ext4.getCmp('title').setValue(result.data.title); top.Ext4.getCmp('optionA').setValue(result.data.optionA); top.Ext4.getCmp('optionB').setValue(result.data.optionB); Index: ssts-web/src/main/webapp/disinfectsystem/onlineExams/httpTreeOptionView.js =================================================================== diff -u -r38385 -r38424 --- ssts-web/src/main/webapp/disinfectsystem/onlineExams/httpTreeOptionView.js (.../httpTreeOptionView.js) (revision 38385) +++ ssts-web/src/main/webapp/disinfectsystem/onlineExams/httpTreeOptionView.js (.../httpTreeOptionView.js) (revision 38424) @@ -34,9 +34,15 @@ optionType: optionType }, success: function (response, options) { - showResult('保存成功'); - grid.dwrReload(); - configWin.close(); + var result = Ext.util.JSON.decode(response.responseText); + var success = result.success; + if (success) { + showResult('保存成功'); + reloadTreeAndTable(); + configWin.close(); + } else { + showResult(result.message); + } } }); } Index: ssts-web/src/main/webapp/disinfectsystem/onlineExams/question/questionView.js =================================================================== diff -u -r38385 -r38424 --- ssts-web/src/main/webapp/disinfectsystem/onlineExams/question/questionView.js (.../questionView.js) (revision 38385) +++ ssts-web/src/main/webapp/disinfectsystem/onlineExams/question/questionView.js (.../questionView.js) (revision 38424) @@ -25,8 +25,8 @@ var columns = [ { header: "题目", width: 250, dataIndex: 'title', renderer: gotoPage }, - { header: "类别", width: 150, dataIndex: 'typeForDisplay' }, - { header: "难度", width: 100, dataIndex: 'difficultyValue' }, + { header: "类别", width: 150, dataIndex: 'type.name' }, + { header: "难度", width: 100, dataIndex: 'difficulty.optionText' }, { header: "发布人", width: 100, dataIndex: 'publisher' }, { header: "发布时间", width: 100, dataIndex: 'publishTime', renderer: myDateFormat }, { header: "题型", width: 70, dataIndex: 'questionType' }, @@ -38,8 +38,8 @@ var readerDetail = [ { name: 'id' }, { name: 'title' }, - { name: 'typeForDisplay' }, - { name: 'difficultyValue' }, + { name: 'type.name' }, + { name: 'difficulty.optionText' }, { name: 'publisher' }, { name: 'publishTime' }, { name: 'questionType' }, Index: ssts-web/src/main/webapp/disinfectsystem/onlineExams/examsDefinition/examsDefinitionForm.js =================================================================== diff -u -r38380 -r38424 --- ssts-web/src/main/webapp/disinfectsystem/onlineExams/examsDefinition/examsDefinitionForm.js (.../examsDefinitionForm.js) (revision 38380) +++ ssts-web/src/main/webapp/disinfectsystem/onlineExams/examsDefinition/examsDefinitionForm.js (.../examsDefinitionForm.js) (revision 38424) @@ -256,7 +256,7 @@ }, { layout: 'form', columnWidth: .5, - id:'examDurationBox', + id: 'examDurationBox', height: 35, items: [{ xtype: 'numberfield', @@ -274,9 +274,9 @@ }, { layout: 'form', columnWidth: .5, - id:'examDurationBox2', + id: 'examDurationBox2', height: 35, - hidden:true, + hidden: true, items: [{ xtype: 'displayfield' }] @@ -340,37 +340,12 @@ anchor: '99%', editable: false, onTriggerClick: function () { - var win = openModalWindowForExt(WWWROOT + '/common/selPersonByOrgUnitByExt.jsp', - '', '选择用户', '700', '420'); - if (win == undefined) { - return; - } else { - var loop = setInterval(function () { - if (win.hidden) { - clearInterval(loop); - - var returnValue = win.returnValue; - - var userIds = []; - var userNames = []; - - if (returnValue && returnValue.length > 0) { - for (var i = 0; i < returnValue.length; i++) { - var userStr = returnValue[i]; - var id = userStr.split(';')[0]; - var name = userStr.split(';')[1]; - userIds.push(id); - userNames.push(name); - } - top.Ext4.getCmp('readerOrgUnitCode').setValue(userIds.join(',')); - top.Ext4.getCmp('readers').setValue(userNames.join(',')); - } else if (returnValue && returnValue.length == 0) { - top.Ext4.getCmp('readerOrgUnitCode').setValue(''); - top.Ext4.getCmp('readers').setValue(''); - } - } - }, 500); + var params = { + userIdsElement: top.Ext4.getCmp('readerOrgUnitCode'), + userNamesElement: top.Ext4.getCmp('readers'), + action: 'includeUsers' } + openSelectUser(params); }, triggerCls: 'x4-form-search-trigger' }] @@ -440,11 +415,11 @@ top.Ext4.getCmp('isRandom').setValue({ isRandomValue: result.data.isRandom }); top.Ext4.getCmp('isAssuredAnswer').setValue({ isAssuredAnswerValue: result.data.isAssuredAnswer }); top.Ext4.getCmp('isReckon').setValue({ isReckonValue: result.data.isReckon }); - if(result.data.isReckon == '是'){ + if (result.data.isReckon == '是') { top.Ext4.getCmp('examDurationBox').show(); top.Ext4.getCmp('examDurationBox2').hide(); top.Ext4.getCmp('examDuration').setValue(result.data.examDuration); - }else { + } else { top.Ext4.getCmp('examDurationBox').hide(); top.Ext4.getCmp('examDurationBox2').show(); } @@ -453,11 +428,11 @@ top.Ext4.getCmp('readers').setValue(result.data.readersForDisplay == ';' ? '' : result.data.readersForDisplay); top.Ext4.getCmp('examCount').setValue(result.data.examCount); top.Ext4.getCmp('remark').setValue(result.data.remark); - + } } }); - }else { + } else { top.Ext4.getCmp('examDurationBox').hide(); top.Ext4.getCmp('examDurationBox2').show(); }