Index: ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/formdefinitionForm.js
===================================================================
diff -u -r38083 -r40949
--- ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/formdefinitionForm.js (.../formdefinitionForm.js) (revision 38083)
+++ ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/formdefinitionForm.js (.../formdefinitionForm.js) (revision 40949)
@@ -7,6 +7,12 @@
{ name: 'optionsJson' }
]);
+function cancelFormDefinition() {
+ if (top.Ext.getCmp('formDefinitionWin')) {
+ top.Ext.getCmp('formDefinitionWin').close();
+ }
+}
+
function addFormDefinition(id) {
var deviceInfoRecord = Ext.data.Record.create([
{ name: 'departCode', type: 'string' },
@@ -34,7 +40,7 @@
if (deviceInfoStore.getCount() > 1) {
deviceInfoStore.insert(0, new deviceInfoRecord({ 'id': '全部', 'name': '全部' }));
if (!id) {
- top.Ext.getCmp('applicableEquipmentName').selectAll();
+ Ext.getCmp('applicableEquipmentName').selectAll();
var item = [];
deviceInfoStore.each(function (record) {
if (record.get('name') !== '全部' && record.get('checked')) {
@@ -44,7 +50,7 @@
})
}
});
- top.Ext.getCmp('applicableEquipmentArray').setValue(JSON.stringify(item));
+ Ext.getCmp('applicableEquipmentArray').setValue(JSON.stringify(item));
}
}
}
@@ -76,315 +82,6 @@
}
});
- var formPanel = new top.Ext.FormPanel({
- id: 'formDefinitionForm',
- frame: true,
- labelSeparator: ':',
- labelAlign: 'right',
- fileUpload: true,
- bodyStyle: 'padding:5px 5px 0px 5px;',
- autoWidth: true,
- height: 170,
- layout: 'column',
- items: [{
- xtype: 'hidden',
- name: 'id',
- id: 'id',
- value: id
- }, {
- xtype: 'hidden',
- name: 'isDisabled',
- id: 'isDisabled',
- value: '否'
- }, {
- xtype: 'hidden',
- name: 'formType',
- id: 'formType',
- value: formType
- }, {
- layout: 'form',
- columnWidth: .5,
- labelWidth: 80,
- items: [{
- xtype: 'textfield',
- fieldLabel: "定义名称",
- name: "formName",
- id: "formName",
- allowBlank: false,
- anchor: '95%'
- }]
- }, {
- layout: 'form',
- columnWidth: .5,
- labelWidth: 80,
- items: [{
- xtype: 'hidden',
- id: 'applicableEquipmentArray',
- name: 'applicableEquipmentArray'
- }, {
- xtype: 'multiSelect',
- id: 'applicableEquipmentName',
- name: 'applicableEquipmentName',
- fieldLabel: '适用设备',
- queryParam: 'spell',
- minChars: 0,
- valueField: 'name',
- displayField: 'name',
- store: deviceInfoStore,
- forceSelection: false,
- lazyInit: true,
- triggerAction: 'all',
- typeAhead: false,
- allowBlank: true,
- anchor: '95%',
- editable: false,
- listeners: {
- select: function (combo, record, index) {
- //1、如果选中“全部”的项,则把所有的项选中,反之全部取消选择
- if (record.get('name') == '全部') {
- if (record.get('checked')) {
- combo.selectAll();
- } else {
- combo.deselectAll();
- }
- }
-
- //2、如果已经选中所有的项,则把“全部”项选中,反之把“全部”项取消选择
- var selectAll = true;
- combo.store.each(function (record) {
- if (record.get('name') != '全部' && !record.get(this.checkField)) {
- selectAll = false;
- return;
- }
- }, combo);
-
- var all = combo.store.getAt(0);
- if (selectAll) {
- all.set(combo.checkField, true);
- } else {
- all.set(combo.checkField, false);
- }
- combo.setValue(combo.getCheckedValue());
- var item = [];
- var isHasBioreaderInterface = false;
- combo.store.each(function (record) {
- if (record.get('name') !== '全部' && record.get('checked')) {
- item.push({
- equipmentId: record.get('id'),
- type: record.get('type')
- });
- if (record.get('type') == '生物阅读器') {
- isHasBioreaderInterface = true;
- }
- }
- }, combo);
- if (isHasBioreaderInterface) {
- top.Ext.getCmp('remindMode').setValue('每天固定时间提醒');
- top.Ext.getCmp('remindMode').disable()
- } else {
- top.Ext.getCmp('remindMode').enable();
- }
- top.Ext.getCmp('applicableEquipmentArray').setValue(JSON.stringify(item));
- }
- }
- }]
- }, {
- layout: 'form',
- columnWidth: .5,
- labelWidth: 80,
- items: [{
- xtype: 'combo',
- fieldLabel: "是否提醒",
- name: "equipmentInspectionRemind",
- id: "equipmentInspectionRemind",
- valueField: 'value',
- displayField: 'value',
- allowBlank: true,
- editable: false,
- store: new top.Ext.data.SimpleStore({
- fields: ['value'],
- data: [['是'], ['否']]
- }),
- value: '否',
- forceSelection: true,
- mode: 'local',
- anchor: '95%',
- triggerAction: 'all',
- listeners: {
- select: function (combo, record, index) {
- if (record.data.value == '是') {
- top.Ext.getCmp('remindUserBox').show();
- top.Ext.getCmp('remindModeBox').show();
- top.Ext.getCmp('remindDurationBox').show();
- top.Ext.getCmp('remindStartTimeBox').show();
- top.Ext.getCmp('remindEndTimeBox').show();
- } else {
- // top.Ext.getCmp('remindUserNames').setRawValue('');
- // top.Ext.getCmp('remindUserIds').setValue('');
- // top.Ext.getCmp('remindDuration').setValue('');
- // top.Ext.getCmp('remindMode').setValue('每天固定时间提醒');
- // top.Ext.getCmp('remindStartTime').setValue('00:00');
- // top.Ext.getCmp('remindEndTime').setValue('23:59');
- top.Ext.getCmp('remindUserBox').hide();
- top.Ext.getCmp('remindModeBox').hide();
- top.Ext.getCmp('remindDurationBox').hide();
- top.Ext.getCmp('remindStartTimeBox').hide();
- top.Ext.getCmp('remindEndTimeBox').hide();
- }
- }
- }
- }]
- }, {
- layout: 'form',
- columnWidth: .5,
- labelWidth: 80,
- id: 'remindUserBox',
- items: [{
- xtype: 'hidden',
- id: 'remindUserIds',
- name: 'remindUserIds'
- }, {
- xtype: 'multiSelect',
- id: 'remindUserNames',
- name: 'remindUserNames',
- fieldLabel: '提醒用户',
- queryParam: 'spell',
- minChars: 0,
- valueField: 'id',
- displayField: 'name',
- store: remindUserStore,
- forceSelection: false,
- lazyInit: true,
- triggerAction: 'all',
- typeAhead: false,
- allowBlank: true,
- anchor: '95%',
- separator: ';',
- editable: false,
- listeners: {
- select: function (combo, record, index) {
- //1、如果选中“全部”的项,则把所有的项选中,反之全部取消选择
- if (record.get('name') == '全部') {
- if (record.get('checked')) {
- combo.selectAll();
- } else {
- combo.deselectAll();
- }
- }
-
- //2、如果已经选中所有的项,则把“全部”项选中,反之把“全部”项取消选择
- var selectAll = true;
- combo.store.each(function (record) {
- if (record.get('name') != '全部' && !record.get(this.checkField)) {
- selectAll = false;
- return;
- }
- }, combo);
-
- var all = combo.store.getAt(0);
- if (selectAll) {
- all.set(combo.checkField, true);
- } else {
- all.set(combo.checkField, false);
- }
- combo.setValue(combo.getCheckedValue());
- top.Ext.getCmp('remindUserIds').setValue(combo.getCheckedValue());
- }
- }
- }]
- }, {
- layout: 'form',
- columnWidth: .5,
- labelWidth: 80,
- id: 'remindModeBox',
- items: [{
- xtype: 'combo',
- fieldLabel: "提醒模式",
- name: "remindMode",
- id: "remindMode",
- valueField: 'value',
- displayField: 'value',
- allowBlank: true,
- editable: false,
- store: new top.Ext.data.SimpleStore({
- fields: ['value'],
- data: [['每天固定时间提醒'], ['设备运行时提醒']]
- }),
- value: '每天固定时间提醒',
- forceSelection: true,
- mode: 'local',
- anchor: '95%',
- triggerAction: 'all',
- listeners: {
- select: function (combo, record, index) {
- if (record.data.value == '每天固定时间提醒') {
- top.Ext.getCmp('remindStartTimeBox').show();
- top.Ext.getCmp('remindEndTimeBox').show();
- } else {
- // top.Ext.getCmp('remindStartTime').setValue('00:00');
- // top.Ext.getCmp('remindEndTime').setValue('23:59');
- top.Ext.getCmp('remindStartTimeBox').hide();
- top.Ext.getCmp('remindEndTimeBox').hide();
- }
- }
- }
- }]
- }, {
- layout: 'form',
- columnWidth: .5,
- labelWidth: 80,
- id: 'remindDurationBox',
- items: [{
- xtype: 'textfield',
- fieldLabel: "间隔时长(分)",
- name: "remindDuration",
- id: "remindDuration",
- allowBlank: true,
- anchor: '95%'
- }]
- }, {
- layout: 'form',
- columnWidth: .5,
- labelWidth: 80,
- id: 'remindStartTimeBox',
- items: [new top.Ext.form.TimeField({
- id: 'remindStartTime',
- name: 'remindStartTime',
- fieldLabel: '提醒开始时间',
- readOnly: false,
- format: 'H:i',
- value: '00:00',
- anchor: '95%'
- })]
- }, {
- layout: 'form',
- columnWidth: .5,
- labelWidth: 80,
- id: 'remindEndTimeBox',
- items: [new top.Ext.form.TimeField({
- id: 'remindEndTime',
- name: 'remindEndTime',
- fieldLabel: '提醒结束时间',
- readOnly: false,
- format: 'H:i',
- value: '23:59',
- anchor: '95%'
- })]
- }, {
- layout: 'form',
- columnWidth: 1,
- labelWidth: 80,
- items: [{
- xtype: 'textarea',
- fieldLabel: "备注",
- name: "remark",
- id: "remark",
- height: 40,
- anchor: '97%'
- }]
- }]
- });
-
var tbar = [{
text: '元素类型:'
}, {
@@ -397,7 +94,7 @@
displayField: 'value',
allowBlank: false,
editable: false,
- store: new top.Ext.data.SimpleStore({
+ store: new Ext.data.SimpleStore({
fields: ['value'],
data: [[itemTypes[0]], [itemTypes[1]], [itemTypes[2]], [itemTypes[3]], [itemTypes[4]], [itemTypes[5]], [itemTypes[6]], [itemTypes[7]]]
}
@@ -406,15 +103,19 @@
forceSelection: true,
mode: 'local',
triggerAction: 'all'
- }, {
+ }];
+
+ var tbar1 = [{
text: '元素名称:'
}, {
xtype: 'textfield',
maxLength: '20',
id: 'name',
name: 'name',
width: 200
- }, {
+ }]
+
+ var tbar2 = [{
text: '必要性:'
}, {
xtype: 'combo',
@@ -425,7 +126,7 @@
allowBlank: false,
width: 80,
editable: false,
- store: new top.Ext.data.SimpleStore({
+ store: new Ext.data.SimpleStore({
fields: ['value'],
data: [['可选'], ['必填']]
}
@@ -434,13 +135,15 @@
forceSelection: true,
mode: 'local',
triggerAction: 'all'
- }, {
+ }]
+
+ var tbar3 = [{
text: '添加',
iconCls: 'btn_ext_add',
handler: function () {
- var type = top.Ext.getCmp("type").getValue();
- var name = top.Ext.getCmp("name").getValue();
- var requirement = top.Ext.getCmp("requirement").getValue();
+ var type = Ext.getCmp("type").getValue();
+ var name = Ext.getCmp("name").getValue();
+ var requirement = Ext.getCmp("requirement").getValue();
if (type == "") {
showResult("元素类型不能为空!");
return false;
@@ -455,8 +158,8 @@
}
var options = '';
- var formConfigStore = top.Ext.getCmp('formDefinitionItemConfigPanel').getStore();
- var index = formConfigStore.find('name', top.Ext.getCmp('name').getValue());
+ var formConfigStore = Ext.getCmp('formDefinitionItemConfigPanel').getStore();
+ var index = formConfigStore.find('name', Ext.getCmp('name').getValue());
var isNameExist = false;
if (index != -1) {
var recordName = formConfigStore.getAt(index).get('name');
@@ -477,104 +180,423 @@
});
formConfigStore.add(itemRecord);
}
- top.Ext.getCmp('name').setValue('');
- top.Ext.getCmp('requirement').setValue('可选');
+ Ext.getCmp('name').setValue('');
+ Ext.getCmp('requirement').setValue('可选');
}
- }];
- var formDefinitionWin = new top.Ext.Window({
- id: 'formDefinitionWin',
- title: '表单定义信息',
- width: 700,
- border: false,
- modal: true,
- heigth: 800,
- plain: true,
- buttonAlign: 'center',
+ }]
+
+ var actualWidth = document.body.clientWidth;
+ var actualHeight = document.body.clientHeight;
+ var columnWidth = actualWidth > 500 ? 0.5 : 1;
+ var tbarMaxWidth = actualWidth;
+ var newTab2 = null;
+ if (tbarMaxWidth < 650) {
+ var newTab = [];
+ tbar = tbar.concat(tbar2);
+ newTab = newTab.concat(tbar1).concat(tbar3)
+ newTab2 = new Ext.Toolbar({
+ items: newTab
+ });
+ } else {
+ tbar = tbar.concat(tbar1).concat(tbar2).concat(tbar3)
+ }
+ var formPanel = new Ext.FormPanel({
+ id: 'formDefinitionForm',
+ frame: true,
+ labelSeparator: ':',
+ labelAlign: 'right',
+ fileUpload: true,
+ bodyStyle: 'padding:5px 5px 0px 5px;',
+ width: actualWidth,
+ height: actualHeight,
+ layout: 'column',
+ autoScroll: true,
+ renderTo: 'gridDiv',
items: [{
- layout: 'column',
- labelWidth: 90,
+ columnWidth: 1,
+ layout: 'form',
items: [{
- columnWidth: 1,
- items: [formPanel]
+ xtype: 'hidden',
+ name: 'id',
+ id: 'id',
+ value: id
}, {
- columnWidth: 1,
- items: [
- new top.Ext.grid.EditorGridPanel({
- id: 'formDefinitionItemConfigPanel',
- title: '表单元素列表',
- width: 685,
- height: 400,
- border: true,
- frame: false,
- selModel: new top.Ext.grid.RowSelectionModel({
- singleSelect: false
- }),
- bodyStyle: 'border:1px solid #afd7af',
- tbar: tbar,
- autoExpandColumn: 'aotuColumnId',
- store: new top.Ext.data.Store({
- reader: new top.Ext.data.JsonReader({
- fields: [
- { name: 'id' },
- { name: 'name' },
- { name: 'type' },
- { name: 'requirement' },
- { name: 'optionsJson' },
- { name: 'options' }
- ]
- })
- }),
- cm: new top.Ext.grid.ColumnModel([new top.Ext.grid.RowNumberer({ header: "序号", width: 40 }),
- {
- header: "元素名称", dataIndex: 'name', width: 170,
- editor: new top.Ext.form.TextField({
- allowBlank: false
- })
- },
- { header: "元素类型", width: 80, dataIndex: 'type' },
- {
- header: "必要性", width: 80, dataIndex: 'requirement',
- editor: new top.Ext.form.ComboBox({
- valueField: 'value',
- displayField: 'value',
- allowBlank: false,
- width: 80,
- editable: false,
- store: new top.Ext.data.SimpleStore({
- fields: ['value'],
- data: [['必填'], ['可选']]
+ xtype: 'hidden',
+ name: 'isDisabled',
+ id: 'isDisabled',
+ value: '否'
+ }, {
+ xtype: 'hidden',
+ name: 'formType',
+ id: 'formType',
+ value: formType
+ }, {
+ layout: 'form',
+ columnWidth: columnWidth,
+ labelWidth: 80,
+ items: [{
+ xtype: 'textfield',
+ fieldLabel: "定义名称",
+ name: "formName",
+ id: "formName",
+ allowBlank: false,
+ anchor: '95%'
+ }]
+ }, {
+ layout: 'form',
+ columnWidth: columnWidth,
+ labelWidth: 80,
+ items: [{
+ xtype: 'hidden',
+ id: 'applicableEquipmentArray',
+ name: 'applicableEquipmentArray'
+ }, {
+ xtype: 'multiSelect',
+ id: 'applicableEquipmentName',
+ name: 'applicableEquipmentName',
+ fieldLabel: '适用设备',
+ queryParam: 'spell',
+ minChars: 0,
+ valueField: 'name',
+ displayField: 'name',
+ store: deviceInfoStore,
+ forceSelection: false,
+ lazyInit: true,
+ triggerAction: 'all',
+ typeAhead: false,
+ allowBlank: true,
+ anchor: '95%',
+ editable: false,
+ listeners: {
+ select: function (combo, record, index) {
+ //1、如果选中“全部”的项,则把所有的项选中,反之全部取消选择
+ if (record.get('name') == '全部') {
+ if (record.get('checked')) {
+ combo.selectAll();
+ } else {
+ combo.deselectAll();
}
- ),
- forceSelection: true,
- mode: 'local',
- triggerAction: 'all'
- })
- },
- { header: "参数值", width: 150, dataIndex: 'options' },
- { header: "排序", width: 80, dataIndex: 'id', renderer: moveUpDown, sortable: false, menuDisabled: true },
- {
- id: 'aotuColumnId', header: "删除", dataIndex: 'name', width: 100,
- renderer: function (v, p, record, index) {
- var str = "
";
- return str;
}
- }]),
- listeners: {
- cellclick: function (thiz, rowIndex, columnIndex, e) {
- var record = thiz.getStore().getAt(rowIndex);
- var type = record.get("type");
- var params = record.get("optionsJson");
- if (columnIndex == 4 && (itemTypes[3] == type || itemTypes[4] == type)) {
- setFormDefinitionOptionsWin(params, rowIndex, type);
+
+ //2、如果已经选中所有的项,则把“全部”项选中,反之把“全部”项取消选择
+ var selectAll = true;
+ combo.store.each(function (record) {
+ if (record.get('name') != '全部' && !record.get(this.checkField)) {
+ selectAll = false;
+ return;
}
+ }, combo);
+
+ var all = combo.store.getAt(0);
+ if (selectAll) {
+ all.set(combo.checkField, true);
+ } else {
+ all.set(combo.checkField, false);
}
+ combo.setValue(combo.getCheckedValue());
+ var item = [];
+ var isHasBioreaderInterface = false;
+ combo.store.each(function (record) {
+ if (record.get('name') !== '全部' && record.get('checked')) {
+ item.push({
+ equipmentId: record.get('id'),
+ type: record.get('type')
+ });
+ if (record.get('type') == '生物阅读器') {
+ isHasBioreaderInterface = true;
+ }
+ }
+ }, combo);
+ if (isHasBioreaderInterface) {
+ Ext.getCmp('remindMode').setValue('每天固定时间提醒');
+ Ext.getCmp('remindMode').disable()
+ } else {
+ Ext.getCmp('remindMode').enable();
+ }
+ Ext.getCmp('applicableEquipmentArray').setValue(JSON.stringify(item));
}
- })
- ]
+ }
+ }]
+ }, {
+ layout: 'form',
+ columnWidth: columnWidth,
+ labelWidth: 80,
+ items: [{
+ xtype: 'combo',
+ fieldLabel: "是否提醒",
+ name: "equipmentInspectionRemind",
+ id: "equipmentInspectionRemind",
+ valueField: 'value',
+ displayField: 'value',
+ allowBlank: true,
+ editable: false,
+ store: new Ext.data.SimpleStore({
+ fields: ['value'],
+ data: [['是'], ['否']]
+ }),
+ value: '否',
+ forceSelection: true,
+ mode: 'local',
+ anchor: '95%',
+ triggerAction: 'all',
+ listeners: {
+ select: function (combo, record, index) {
+ if (record.data.value == '是') {
+ Ext.getCmp('remindUserBox').show();
+ Ext.getCmp('remindModeBox').show();
+ Ext.getCmp('remindDurationBox').show();
+ Ext.getCmp('remindStartTimeBox').show();
+ Ext.getCmp('remindEndTimeBox').show();
+ } else {
+ // Ext.getCmp('remindUserNames').setRawValue('');
+ // Ext.getCmp('remindUserIds').setValue('');
+ // Ext.getCmp('remindDuration').setValue('');
+ // Ext.getCmp('remindMode').setValue('每天固定时间提醒');
+ // Ext.getCmp('remindStartTime').setValue('00:00');
+ // Ext.getCmp('remindEndTime').setValue('23:59');
+ Ext.getCmp('remindUserBox').hide();
+ Ext.getCmp('remindModeBox').hide();
+ Ext.getCmp('remindDurationBox').hide();
+ Ext.getCmp('remindStartTimeBox').hide();
+ Ext.getCmp('remindEndTimeBox').hide();
+ }
+ }
+ }
+ }]
+ }, {
+ layout: 'form',
+ columnWidth: columnWidth,
+ labelWidth: 80,
+ id: 'remindUserBox',
+ items: [{
+ xtype: 'hidden',
+ id: 'remindUserIds',
+ name: 'remindUserIds'
+ }, {
+ xtype: 'multiSelect',
+ id: 'remindUserNames',
+ name: 'remindUserNames',
+ fieldLabel: '提醒用户',
+ queryParam: 'spell',
+ minChars: 0,
+ valueField: 'id',
+ displayField: 'name',
+ store: remindUserStore,
+ forceSelection: false,
+ lazyInit: true,
+ triggerAction: 'all',
+ typeAhead: false,
+ allowBlank: true,
+ anchor: '95%',
+ separator: ';',
+ editable: false,
+ listeners: {
+ select: function (combo, record, index) {
+ //1、如果选中“全部”的项,则把所有的项选中,反之全部取消选择
+ if (record.get('name') == '全部') {
+ if (record.get('checked')) {
+ combo.selectAll();
+ } else {
+ combo.deselectAll();
+ }
+ }
+
+ //2、如果已经选中所有的项,则把“全部”项选中,反之把“全部”项取消选择
+ var selectAll = true;
+ combo.store.each(function (record) {
+ if (record.get('name') != '全部' && !record.get(this.checkField)) {
+ selectAll = false;
+ return;
+ }
+ }, combo);
+
+ var all = combo.store.getAt(0);
+ if (selectAll) {
+ all.set(combo.checkField, true);
+ } else {
+ all.set(combo.checkField, false);
+ }
+ combo.setValue(combo.getCheckedValue());
+ Ext.getCmp('remindUserIds').setValue(combo.getCheckedValue());
+ }
+ }
+ }]
+ }, {
+ layout: 'form',
+ columnWidth: columnWidth,
+ labelWidth: 80,
+ id: 'remindModeBox',
+ items: [{
+ xtype: 'combo',
+ fieldLabel: "提醒模式",
+ name: "remindMode",
+ id: "remindMode",
+ valueField: 'value',
+ displayField: 'value',
+ allowBlank: true,
+ editable: false,
+ store: new Ext.data.SimpleStore({
+ fields: ['value'],
+ data: [['每天固定时间提醒'], ['设备运行时提醒']]
+ }),
+ value: '每天固定时间提醒',
+ forceSelection: true,
+ mode: 'local',
+ anchor: '95%',
+ triggerAction: 'all',
+ listeners: {
+ select: function (combo, record, index) {
+ if (record.data.value == '每天固定时间提醒') {
+ Ext.getCmp('remindStartTimeBox').show();
+ Ext.getCmp('remindEndTimeBox').show();
+ } else {
+ // Ext.getCmp('remindStartTime').setValue('00:00');
+ // Ext.getCmp('remindEndTime').setValue('23:59');
+ Ext.getCmp('remindStartTimeBox').hide();
+ Ext.getCmp('remindEndTimeBox').hide();
+ }
+ }
+ }
+ }]
+ }, {
+ layout: 'form',
+ columnWidth: columnWidth,
+ labelWidth: 80,
+ id: 'remindDurationBox',
+ items: [{
+ xtype: 'textfield',
+ fieldLabel: "间隔时长(分)",
+ name: "remindDuration",
+ id: "remindDuration",
+ allowBlank: true,
+ anchor: '95%'
+ }]
+ }, {
+ layout: 'form',
+ columnWidth: columnWidth,
+ labelWidth: 80,
+ id: 'remindStartTimeBox',
+ items: [new Ext.form.TimeField({
+ id: 'remindStartTime',
+ name: 'remindStartTime',
+ fieldLabel: '提醒开始时间',
+ readOnly: false,
+ format: 'H:i',
+ value: '00:00',
+ anchor: '95%'
+ })]
+ }, {
+ layout: 'form',
+ columnWidth: columnWidth,
+ labelWidth: 80,
+ id: 'remindEndTimeBox',
+ items: [new Ext.form.TimeField({
+ id: 'remindEndTime',
+ name: 'remindEndTime',
+ fieldLabel: '提醒结束时间',
+ readOnly: false,
+ format: 'H:i',
+ value: '23:59',
+ anchor: '95%'
+ })]
+ }, {
+ layout: 'form',
+ columnWidth: 1,
+ labelWidth: 80,
+ items: [{
+ xtype: 'textarea',
+ fieldLabel: "备注",
+ name: "remark",
+ id: "remark",
+ height: 40,
+ anchor: '95%'
+ }]
}]
+ }, {
+ columnWidth: 1,
+ layout: 'form',
+ items: [
+ new Ext.grid.EditorGridPanel({
+ id: 'formDefinitionItemConfigPanel',
+ title: '表单元素列表',
+ width: actualWidth - 10,
+ minHeight: 100,
+ autoHeight: true,
+ border: true,
+ frame: false,
+ selModel: new Ext.grid.RowSelectionModel({
+ singleSelect: false
+ }),
+ bodyStyle: 'border:1px solid #afd7af',
+ tbar: tbar,
+ autoExpandColumn: 'aotuColumnId',
+ store: new Ext.data.Store({
+ reader: new Ext.data.JsonReader({
+ fields: [
+ { name: 'id' },
+ { name: 'name' },
+ { name: 'type' },
+ { name: 'requirement' },
+ { name: 'optionsJson' },
+ { name: 'options' }
+ ]
+ })
+ }),
+ cm: new Ext.grid.ColumnModel([new Ext.grid.RowNumberer({ header: "序号", width: 40 }),
+ {
+ header: "元素名称", dataIndex: 'name', width: 170,
+ editor: new Ext.form.TextField({
+ allowBlank: false
+ })
+ },
+ { header: "元素类型", width: 80, dataIndex: 'type' },
+ {
+ header: "必要性", width: 80, dataIndex: 'requirement',
+ editor: new Ext.form.ComboBox({
+ valueField: 'value',
+ displayField: 'value',
+ allowBlank: false,
+ width: 80,
+ editable: false,
+ store: new Ext.data.SimpleStore({
+ fields: ['value'],
+ data: [['必填'], ['可选']]
+ }
+ ),
+ forceSelection: true,
+ mode: 'local',
+ triggerAction: 'all'
+ })
+ },
+ { header: "参数值", width: 150, dataIndex: 'options' },
+ { header: "排序", width: 80, dataIndex: 'id', renderer: moveUpDown, sortable: false, menuDisabled: true },
+ {
+ id: 'aotuColumnId', header: "删除", dataIndex: 'name', width: 100,
+ renderer: function (v, p, record, index) {
+ var str = "
";
+ return str;
+ }
+ }]),
+ listeners: {
+ render: function () {
+ if (newTab2) {
+ newTab2.render(this.tbar);
+ }
+ },
+ cellclick: function (thiz, rowIndex, columnIndex, e) {
+ var record = thiz.getStore().getAt(rowIndex);
+ var type = record.get("type");
+ var params = record.get("optionsJson");
+ if (columnIndex == 4 && (itemTypes[3] == type || itemTypes[4] == type)) {
+ setFormDefinitionOptionsWin(params, rowIndex, type);
+ }
+ }
+ }
+ })
+ ]
}],
buttons: [{
id: 'saveBtn',
@@ -588,12 +610,11 @@
text: '取消',
id: 'cancelBtn',
handler: function () {
- top.Ext.getCmp("formDefinitionWin").close();
+ cancelFormDefinition();
}
}]
});
- formDefinitionWin.show();
if (id != null && id != "") {
formPanel.form.load({
url: WWWROOT + '/disinfectSystem/equipmentInspectionDefAction!loadEquipmentInspectionDef.do',
@@ -603,10 +624,10 @@
success: function (form, action) {
var formConfig = action.result.data;
if (action_deploy == formConfig.isDeploy) {
- top.Ext.getCmp("saveBtn").disable();
+ Ext.getCmp("saveBtn").disable();
}
var items = formConfig.items;
- var store = top.Ext.getCmp('formDefinitionItemConfigPanel').getStore();
+ var store = Ext.getCmp('formDefinitionItemConfigPanel').getStore();
for (var i = 0; i < items.length; i++) {
var itemRecord = new formDefinitionItemRecord({
id: items[i].id,
@@ -635,46 +656,46 @@
isHasBioreaderInterface = true;
}
}
- top.Ext.getCmp('applicableEquipmentArray').setValue(JSON.stringify(item));
- top.Ext.getCmp('applicableEquipmentName').setRawValue(nameArr.join(','));
+ Ext.getCmp('applicableEquipmentArray').setValue(JSON.stringify(item));
+ Ext.getCmp('applicableEquipmentName').setRawValue(nameArr.join(','));
if (isHasBioreaderInterface) {
- top.Ext.getCmp('remindMode').disable()
+ Ext.getCmp('remindMode').disable()
} else {
- top.Ext.getCmp('remindMode').enable();
+ Ext.getCmp('remindMode').enable();
}
}
var equipmentInspectionRemind = formConfig.equipmentInspectionRemind;
if (equipmentInspectionRemind == '是') {
- top.Ext.getCmp('remindUserNames').setRawValue(formConfig.remindUserNames);
- top.Ext.getCmp('remindUserIds').setValue(formConfig.remindUserIds);
- top.Ext.getCmp('remindDuration').setValue(formConfig.remindDuration);
- top.Ext.getCmp('remindMode').setValue(formConfig.remindMode);
+ Ext.getCmp('remindUserNames').setRawValue(formConfig.remindUserNames);
+ Ext.getCmp('remindUserIds').setValue(formConfig.remindUserIds);
+ Ext.getCmp('remindDuration').setValue(formConfig.remindDuration);
+ Ext.getCmp('remindMode').setValue(formConfig.remindMode);
if (formConfig.remindMode == '每天固定时间提醒') {
- top.Ext.getCmp('remindStartTime').setValue(formConfig.remindStartTime);
- top.Ext.getCmp('remindEndTime').setValue(formConfig.remindEndTime);
+ Ext.getCmp('remindStartTime').setValue(formConfig.remindStartTime);
+ Ext.getCmp('remindEndTime').setValue(formConfig.remindEndTime);
} else {
- top.Ext.getCmp('remindStartTimeBox').hide();
- top.Ext.getCmp('remindEndTimeBox').hide();
+ Ext.getCmp('remindStartTimeBox').hide();
+ Ext.getCmp('remindEndTimeBox').hide();
}
} else {
- top.Ext.getCmp('remindUserBox').hide();
- top.Ext.getCmp('remindModeBox').hide();
- top.Ext.getCmp('remindDurationBox').hide();
- top.Ext.getCmp('remindStartTimeBox').hide();
- top.Ext.getCmp('remindEndTimeBox').hide();
+ Ext.getCmp('remindUserBox').hide();
+ Ext.getCmp('remindModeBox').hide();
+ Ext.getCmp('remindDurationBox').hide();
+ Ext.getCmp('remindStartTimeBox').hide();
+ Ext.getCmp('remindEndTimeBox').hide();
}
},
failure: function (form, action) {
showResult("加载出错,请联系管理员!");
}
});
} else {
- top.Ext.getCmp('remindUserBox').hide();
- top.Ext.getCmp('remindModeBox').hide();
- top.Ext.getCmp('remindDurationBox').hide();
- top.Ext.getCmp('remindStartTimeBox').hide();
- top.Ext.getCmp('remindEndTimeBox').hide();
+ Ext.getCmp('remindUserBox').hide();
+ Ext.getCmp('remindModeBox').hide();
+ Ext.getCmp('remindDurationBox').hide();
+ Ext.getCmp('remindStartTimeBox').hide();
+ Ext.getCmp('remindEndTimeBox').hide();
}
}
@@ -687,34 +708,34 @@
}
function submitFormDefinitionForm(actionType) {
- var formPanel = top.Ext.getCmp('formDefinitionForm');
+ var formPanel = Ext.getCmp('formDefinitionForm');
if (!formPanel.form.isValid()) {
showResult('请正确填写表单各值');
return false;
}
- var applicableEquipmentArray = top.Ext.getCmp('applicableEquipmentArray').getValue();
+ var applicableEquipmentArray = Ext.getCmp('applicableEquipmentArray').getValue();
if (JSON.parse(applicableEquipmentArray).length == 0) {
showResult('适用设备不能为空!');
return false;
}
- var equipmentInspectionRemind = top.Ext.getCmp('equipmentInspectionRemind').getValue();
+ var equipmentInspectionRemind = Ext.getCmp('equipmentInspectionRemind').getValue();
if (equipmentInspectionRemind == '是') {
- var remindMode = top.Ext.getCmp('remindMode').getValue();
- var remindUserNames = top.Ext.getCmp('remindUserNames').getRawValue();
+ var remindMode = Ext.getCmp('remindMode').getValue();
+ var remindUserNames = Ext.getCmp('remindUserNames').getRawValue();
if (remindUserNames == '') {
showResult('提醒用户不能为空!');
return false;
}
- var remindDuration = top.Ext.getCmp('remindDuration').getValue();
+ var remindDuration = Ext.getCmp('remindDuration').getValue();
if (remindDuration == '') {
showResult('提醒时长不能为空!');
return false;
}
if (remindMode == '每天固定时间提醒') {
- var remindStartTime = top.Ext.getCmp('remindStartTime').getRawValue();
- var remindEndTime = top.Ext.getCmp('remindEndTime').getRawValue();
+ var remindStartTime = Ext.getCmp('remindStartTime').getRawValue();
+ var remindEndTime = Ext.getCmp('remindEndTime').getRawValue();
if (remindStartTime == '' || remindEndTime == '') {
showResult('提醒时间不能为空!');
return false;
@@ -733,7 +754,7 @@
}
}
}
- var store = top.Ext.getCmp('formDefinitionItemConfigPanel').getStore();
+ var store = Ext.getCmp('formDefinitionItemConfigPanel').getStore();
if (store.getCount() == 0) {
showResult("表单元素列表不能为空!");
return false;
@@ -764,7 +785,6 @@
showResult(submitFaildMsg);
return false;
}
-
formPanel.form.submit({
url: WWWROOT + '/disinfectSystem/equipmentInspectionDefAction!saveEquipmentInspectionDef.do',
method: 'POST',
@@ -774,8 +794,7 @@
success: function (form, action) {
showResult(action.result.message);
if (action.result.success) {
- grid.dwrReload();
- top.Ext.getCmp("formDefinitionWin").close();
+ cancelFormDefinition();
}
},
failure: function (form, action) {
@@ -823,7 +842,7 @@
}
}
- var cm = new top.Ext.grid.ColumnModel([{
+ var cm = new Ext.grid.ColumnModel([{
id: 'id',
name: 'id',
hidden: true,
@@ -838,12 +857,12 @@
header: "是否默认值",
width: 100,
dataIndex: 'isDefaultValue',
- editor: new top.Ext.form.ComboBox({
+ editor: new Ext.form.ComboBox({
valueField: 'value',
displayField: 'value',
allowBlank: false,
editable: false,
- store: new top.Ext.data.SimpleStore({
+ store: new Ext.data.SimpleStore({
fields: ['value'],
data: [['是'], ['否']]
}),
@@ -875,7 +894,7 @@
}]);
function addOptionItem() {
- var goodsName = top.Ext.getCmp('optionName').getValue();
+ var goodsName = Ext.getCmp('optionName').getValue();
var isExist = false;
for (var i = 0; i < optionStore.getCount(); i++) {
var record = optionStore.getAt(i);
@@ -892,8 +911,8 @@
orderNumber: 0
});
optionStore.add(record);
- top.Ext.getCmp('optionName').setValue('');
- top.Ext.getCmp('optionName').focus();
+ Ext.getCmp('optionName').setValue('');
+ Ext.getCmp('optionName').focus();
} else {
showResult(goodsName + ",已添加!");
}
@@ -924,7 +943,7 @@
}
}];
- formObj = new top.Ext.FormPanel({
+ formObj = new Ext.FormPanel({
frame: true,
labelAlign: 'right',
labelSeparator: ':',
@@ -942,7 +961,7 @@
columnWidth: 1,
layout: 'form',
items: [
- new top.Ext.grid.EditorGridPanel({
+ new Ext.grid.EditorGridPanel({
id: 'itemOptionsGrid',
store: optionStore,
tbar: tbar,
@@ -956,7 +975,7 @@
},
bodyStyle: 'border:1px solid #afd7af',
anchor: '100%',
- selModel: new top.Ext.grid.RowSelectionModel({
+ selModel: new Ext.grid.RowSelectionModel({
singleSelect: false
}),
listeners: {
@@ -990,27 +1009,27 @@
if (optionsStr != "") {
optionsStr += ", ";
}
- if(record.get("isDefaultValue") == '是'){
+ if (record.get("isDefaultValue") == '是') {
defaultValueCount++;
}
optionsStr += record.get("name");
}
- if(defaultValueCount > 1 && type == '单选'){
+ if (defaultValueCount > 1 && type == '单选') {
showResult('单选只能有一个默认值!');
return
}
resetConfigItemOptions(JSON.stringify(optionJsonArray), optionsStr, rowIndex);
- top.Ext.getCmp("setOptionsWindow").close();
+ Ext.getCmp("setOptionsWindow").close();
}
}, {
text: '取消',
handler: function () {
- top.Ext.getCmp("setOptionsWindow").close();
+ Ext.getCmp("setOptionsWindow").close();
}
}]
});
- var formWindow = new top.Ext.Window({
+ var formWindow = new Ext.Window({
id: 'setOptionsWindow',
layout: 'fit',
title: '参数值设置',
@@ -1025,14 +1044,14 @@
}
function resetConfigItemOptions(hideValue, options, rowIndex) {
- var store = top.Ext.getCmp('formDefinitionItemConfigPanel').getStore();
+ var store = Ext.getCmp('formDefinitionItemConfigPanel').getStore();
var record = store.getAt(rowIndex);
record.set("optionsJson", hideValue);
record.set("options", options);
}
function moveUp(id, gridId) {
- var store = top.Ext.getCmp(gridId).getStore();
+ var store = Ext.getCmp(gridId).getStore();
var record = store.getById(id);
var index = store.indexOf(record);
if (index > 0) {
@@ -1041,7 +1060,7 @@
}
}
function moveDown(id, gridId) {
- var store = top.Ext.getCmp(gridId).getStore();
+ var store = Ext.getCmp(gridId).getStore();
var record = store.getById(id);
var index = store.indexOf(record);
if (index < store.getCount() - 1) {
@@ -1067,12 +1086,16 @@
}
function removeItem(gridId) {
- var gridObj = top.Ext.getCmp(gridId);
+ var gridObj = Ext.getCmp(gridId);
var rows = gridObj.getSelectionModel().getSelections();
if (rows) {
var store = gridObj.getStore();
for (var i = 0; i < rows.length; i++) {
store.remove(rows[i]);
}
}
-}
\ No newline at end of file
+}
+
+Ext.onReady(function () {
+ addFormDefinition(id)
+});
\ No newline at end of file
Index: ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/forminstanceView.js
===================================================================
diff -u -r38083 -r40949
--- ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/forminstanceView.js (.../forminstanceView.js) (revision 38083)
+++ ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/forminstanceView.js (.../forminstanceView.js) (revision 40949)
@@ -1,7 +1,15 @@
var entityName = "设备巡检记录";
var grid;
function modify(v, data) {
- addFormInstanceWin(data['id']);
+ var params = {
+ title: '表单登记信息',
+ width: 650,
+ height: 500,
+ id: 'formInstanceWin',
+ grid: grid,
+ url: WWWROOT + '/disinfectsystem/equipmentInspection/forminstanceForm.jsp?id=' + data['id']
+ }
+ getFormByIframeUtil(params);
}
// 删除
function deleteFormInstance(grid) {
@@ -107,7 +115,15 @@
iconCls: 'btn_ext_application_add',
hidden: SSTS_EquipmentInspection_Add,
handler: function () {
- addFormInstanceWin("");
+ var params = {
+ title: '表单登记信息',
+ width: 650,
+ height: 500,
+ id: 'formInstanceWin',
+ grid: grid,
+ url: WWWROOT + '/disinfectsystem/equipmentInspection/forminstanceForm.jsp'
+ }
+ getFormByIframeUtil(params);
}
}, '-', {
text: '删除',
Index: ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/forminstanceCommon.js
===================================================================
diff -u -r38048 -r40949
--- ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/forminstanceCommon.js (.../forminstanceCommon.js) (revision 38048)
+++ ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/forminstanceCommon.js (.../forminstanceCommon.js) (revision 40949)
@@ -10,11 +10,13 @@
* @returns
*/
function createFormDefinitionItemElement(type, id, name, allowBlank, options, value, isTriggerItem) {
+ var actualWidth = document.body.clientWidth;
+ var columnWidth = actualWidth > 500 ? 0.5 : 1;
var hideElement = false;
var resultValue = (value == null || value == "") ? '' : value;
if (type == '文本') {
return {
- columnWidth: .5,
+ columnWidth: columnWidth,
layout: 'form',
labelWidth: 120,
hidden: hideElement,
@@ -34,7 +36,7 @@
render: function () {
if ('是' == isTriggerItem && resultValue == '') {
setTimeout(function () {
- top.Ext.getCmp('hideElement' + id).hide();
+ Ext.getCmp('hideElement' + id).hide();
}, 1);
}
}
@@ -63,7 +65,7 @@
render: function () {
if ('是' == isTriggerItem && resultValue == '') {
setTimeout(function () {
- top.Ext.getCmp('hideElement' + id).hide();
+ Ext.getCmp('hideElement' + id).hide();
}, 1);
}
}
@@ -72,7 +74,7 @@
} else if (type == '数字') {
return {
- columnWidth: .5,
+ columnWidth: columnWidth,
layout: 'form',
labelWidth: 120,
hidden: hideElement,
@@ -92,15 +94,15 @@
render: function () {
if ('是' == isTriggerItem && resultValue == '') {
setTimeout(function () {
- top.Ext.getCmp('hideElement' + id).hide();
+ Ext.getCmp('hideElement' + id).hide();
}, 1);
}
}
}
};
} else if (type == '时间') {
return {
- columnWidth: .5,
+ columnWidth: columnWidth,
layout: 'form',
style: 'margin-top:10px',
labelWidth: 120,
@@ -122,15 +124,15 @@
render: function () {
if ('是' == isTriggerItem && resultValue == '') {
setTimeout(function () {
- top.Ext.getCmp('hideElement' + id).hide();
+ Ext.getCmp('hideElement' + id).hide();
}, 1);
}
}
}
};
} else if (type == '时间段') {
return {
- columnWidth: .5,
+ columnWidth: columnWidth,
layout: 'form',
labelWidth: 120,
hidden: hideElement,
@@ -152,15 +154,15 @@
render: function () {
if ('是' == isTriggerItem && resultValue == '') {
setTimeout(function () {
- top.Ext.getCmp('hideElement' + id).hide();
+ Ext.getCmp('hideElement' + id).hide();
}, 1);
}
}
}
};
} else if (type == '日期') {
return {
- columnWidth: .5,
+ columnWidth: columnWidth,
layout: 'form',
labelWidth: 120,
hidden: hideElement,
@@ -182,7 +184,7 @@
render: function () {
if ('是' == isTriggerItem && resultValue == '') {
setTimeout(function () {
- top.Ext.getCmp('hideElement' + id).hide();
+ Ext.getCmp('hideElement' + id).hide();
}, 1);
}
}
@@ -206,7 +208,7 @@
}
}
return {
- columnWidth: .5,
+ columnWidth: columnWidth,
layout: 'form',
labelWidth: 120,
style: 'margin-top:10px',
@@ -226,7 +228,7 @@
displayField: 'value',
allowBlank: allowBlank,
editable: false,
- store: new top.Ext.data.SimpleStore({
+ store: new Ext.data.SimpleStore({
fields: ['value', 'valueTriggerItemIds'],
data: optionsArrays
}),
@@ -238,15 +240,15 @@
listeners: {
select: function (combo, record, index) {
var valueTriggerItemIds = record.get("valueTriggerItemIds");
- var oldTriggerItemIds = top.Ext.getCmp("triggerItemIds" + id).getValue();
+ var oldTriggerItemIds = Ext.getCmp("triggerItemIds" + id).getValue();
triggerItemAction('' + oldTriggerItemIds + '', "hide");
triggerItemAction('' + valueTriggerItemIds + '', "show");
- top.Ext.getCmp("triggerItemIds" + id).setValue(valueTriggerItemIds);
+ Ext.getCmp("triggerItemIds" + id).setValue(valueTriggerItemIds);
},
render: function () {
if ('是' == isTriggerItem && resultValue == '') {
setTimeout(function () {
- top.Ext.getCmp('hideElement' + id).hide();
+ Ext.getCmp('hideElement' + id).hide();
}, 1);
}
}
@@ -264,7 +266,7 @@
});
if (options != "") {
var optionsJson = JSON.parse(options);
- var formId = top.Ext.getCmp('id').getValue();
+ var formId = Ext.getCmp('id').getValue();
for (var j = 0; j < optionsJson.length; j++) {
var checked = false;
if(formId !== ''){
@@ -279,20 +281,20 @@
}
optionsArray.push({
layout: 'form',
- columnWidth: 0.5,
+ columnWidth: columnWidth,
labelWidth: 200,
style: 'margin-top:10px',
items: [{
name: 'cconfigItemOption' + id,
fieldLabel: optionsJson[j].name,
xtype: 'checkbox',
checked: checked,
- columnWidth: .5,
+ columnWidth: columnWidth/2,
inputValue: JSON.stringify(optionsJson[j]),
listeners: {
check: function (thiz, checked) {
var elementId = thiz.getName().substring(1);
- var elementObj = top.Ext.getCmp(elementId);
+ var elementObj = Ext.getCmp(elementId);
if (elementObj != undefined && elementObj != null) {
var oldElementValue = elementObj.getValue();
@@ -337,7 +339,7 @@
render: function () {
if ('是' == isTriggerItem && resultValue == '') {
setTimeout(function () {
- top.Ext.getCmp('hideElement' + id).hide();
+ Ext.getCmp('hideElement' + id).hide();
}, 1);
}
}
@@ -355,11 +357,11 @@
var triggerItemId = itemIdArray[n];
if (triggerItemId != null && triggerItemId != "") {
if ("show" == action) {
- top.Ext.getCmp("hideElement" + triggerItemId).show();
+ Ext.getCmp("hideElement" + triggerItemId).show();
} else {
- var xtype = top.Ext.getCmp("hideElement" + triggerItemId).getXType();
+ var xtype = Ext.getCmp("hideElement" + triggerItemId).getXType();
if (xtype == 'fieldset') {
- var length = top.Ext.getCmp("hideElement" + triggerItemId).items.each(function (fsItem) {
+ var length = Ext.getCmp("hideElement" + triggerItemId).items.each(function (fsItem) {
var itemType = fsItem.getXType();
if (itemType == "panel") {
fsItem.items.each(function (item, index, length) {
@@ -370,12 +372,12 @@
}
});
} else if (xtype == 'panel') {
- var panel = top.Ext.getCmp("hideElement" + triggerItemId);
+ var panel = Ext.getCmp("hideElement" + triggerItemId);
panel.items.each(function (item, index, length) {
item.setValue("");
});
}
- top.Ext.getCmp("hideElement" + triggerItemId).hide();
+ Ext.getCmp("hideElement" + triggerItemId).hide();
}
}
}
@@ -423,12 +425,12 @@
}
}
- top.Ext.getCmp(formItemIds).setValue(itemIds);
+ Ext.getCmp(formItemIds).setValue(itemIds);
- top.Ext.getCmp(formExtId).remove('itemsFieldSet');
+ Ext.getCmp(formExtId).remove('itemsFieldSet');
if (items.length > 0) {
- top.Ext.getCmp(formExtId).add({
+ Ext.getCmp(formExtId).add({
id: 'itemsFieldSet',
xtype: "fieldset",
labelAlign: 'left',
@@ -439,10 +441,10 @@
});
}
- top.Ext.getCmp(formExtId).doLayout();
+ Ext.getCmp(formExtId).doLayout();
- if (top.Ext.getCmp('itemsFieldSet')) {
- top.Ext.getCmp('itemsFieldSet').doLayout();
+ if (Ext.getCmp('itemsFieldSet')) {
+ Ext.getCmp('itemsFieldSet').doLayout();
}
}
@@ -452,16 +454,16 @@
for (var i = 0; i <= ids.split(';').length; i++) {
var itemId = ids.split(';')[i];
if (itemId != null && itemId != '') {
- if (!top.Ext.getCmp('hideElement' + itemId).hidden) {
- if (!top.Ext.getCmp('configItemOption' + itemId).isValid()) {
+ if (!Ext.getCmp('hideElement' + itemId).hidden) {
+ if (!Ext.getCmp('configItemOption' + itemId).isValid()) {
showResult("请正确填写表单各值。");
if (thiz) {
thiz.enable();
}
return true;
}
} else {
- if (!top.Ext.getCmp('hideElement' + itemId).hidden && top.Ext.getCmp('configItemOption' + itemId).getValue() == '#@') {
+ if (!Ext.getCmp('hideElement' + itemId).hidden && Ext.getCmp('configItemOption' + itemId).getValue() == '#@') {
showResult("请正确填写表单各值。");
if (thiz) {
thiz.enable();
@@ -478,8 +480,8 @@
//获取表单的值
function getFormValueObject(that) {
- var safetyCheckFormDefinitionId = top.Ext.getCmp('safetyCheckFormDefinitionId').getValue();
- var runTableRecordFormDefinitionId = top.Ext.getCmp('runTableRecordFormDefinitionId').getValue();
+ var safetyCheckFormDefinitionId = Ext.getCmp('safetyCheckFormDefinitionId').getValue();
+ var runTableRecordFormDefinitionId = Ext.getCmp('runTableRecordFormDefinitionId').getValue();
if (verifyFormItemIsNull(safetyCheckFormDefinitionId)) {
if (that) {
that.enable();
@@ -496,16 +498,16 @@
for (var i = 0; i <= safetyCheckFormDefinitionId.split(';').length; i++) {
var itemId = safetyCheckFormDefinitionId.split(';')[i];
if (itemId != null && itemId != '') {
- if (!top.Ext.getCmp('hideElement' + itemId).hidden) {
- var name = top.Ext.getCmp('configItemOption' + itemId).name;
- var value = top.Ext.getCmp('configItemOption' + itemId).getValue() || '';
- if (top.Ext.getCmp('configItemOption' + itemId).xtype == 'datefieldWithMin') {
+ if (!Ext.getCmp('hideElement' + itemId).hidden) {
+ var name = Ext.getCmp('configItemOption' + itemId).name;
+ var value = Ext.getCmp('configItemOption' + itemId).getValue() || '';
+ if (Ext.getCmp('configItemOption' + itemId).xtype == 'datefieldWithMin') {
if (value !== '') {
- var format = top.Ext.getCmp('configItemOption' + itemId).format;
- value = top.Ext.util.Format.date(new Date(value), format)
+ var format = Ext.getCmp('configItemOption' + itemId).format;
+ value = Ext.util.Format.date(new Date(value), format)
}
}
- top.Ext.getCmp('configItemOption' + itemId).setDisabled(true);
+ Ext.getCmp('configItemOption' + itemId).setDisabled(true);
safetyCheckFormInstanceInfo[name] = value;
}
}
@@ -514,16 +516,16 @@
for (var i = 0; i <= runTableRecordFormDefinitionId.split(';').length; i++) {
var itemId = runTableRecordFormDefinitionId.split(';')[i];
if (itemId != null && itemId != '') {
- if (!top.Ext.getCmp('hideElement' + itemId).hidden) {
- var name = top.Ext.getCmp('configItemOption' + itemId).name;
- var value = top.Ext.getCmp('configItemOption' + itemId).getValue() || '';
- if (top.Ext.getCmp('configItemOption' + itemId).xtype == 'datefieldWithMin') {
+ if (!Ext.getCmp('hideElement' + itemId).hidden) {
+ var name = Ext.getCmp('configItemOption' + itemId).name;
+ var value = Ext.getCmp('configItemOption' + itemId).getValue() || '';
+ if (Ext.getCmp('configItemOption' + itemId).xtype == 'datefieldWithMin') {
if (value !== '') {
- var format = top.Ext.getCmp('configItemOption' + itemId).format;
- value = top.Ext.util.Format.date(new Date(value), format)
+ var format = Ext.getCmp('configItemOption' + itemId).format;
+ value = Ext.util.Format.date(new Date(value), format)
}
}
- top.Ext.getCmp('configItemOption' + itemId).setDisabled(true);
+ Ext.getCmp('configItemOption' + itemId).setDisabled(true);
runTableRecordFormInstanceInfo[name] = value;
}
}
@@ -536,11 +538,11 @@
//保存自定义表单的参数
function saveFormParams(sterilizationRecordId, safetyCheckFormInstanceInfo, runTableRecordFormInstanceInfo) {
- var safetyCheckFormDefinitionId = top.Ext.getCmp('safetyCheckFormDefinitionId').getValue();
- var runTableRecordFormDefinitionId = top.Ext.getCmp('runTableRecordFormDefinitionId').getValue();
+ var safetyCheckFormDefinitionId = Ext.getCmp('safetyCheckFormDefinitionId').getValue();
+ var runTableRecordFormDefinitionId = Ext.getCmp('runTableRecordFormDefinitionId').getValue();
if (safetyCheckFormDefinitionId !== '') {
- var formId = top.Ext.getCmp('safetyCheckId').getValue();
- var formDefinitionId = top.Ext.getCmp('safetyCheckFormId').getValue();
+ var formId = Ext.getCmp('safetyCheckId').getValue();
+ var formDefinitionId = Ext.getCmp('safetyCheckFormId').getValue();
safetyCheckFormInstanceInfo.id = formId;
safetyCheckFormInstanceInfo.formName = '灭菌器运行前安全检查';
safetyCheckFormInstanceInfo.formDefinitionItemIds = safetyCheckFormDefinitionId;
@@ -550,8 +552,8 @@
saveFormInstance(safetyCheckFormInstanceInfo)
}
if (runTableRecordFormDefinitionId !== '') {
- var formId = top.Ext.getCmp('runTableRecordId').getValue();
- var formDefinitionId = top.Ext.getCmp('runTableRecordFormId').getValue();
+ var formId = Ext.getCmp('runTableRecordId').getValue();
+ var formDefinitionId = Ext.getCmp('runTableRecordFormId').getValue();
runTableRecordFormInstanceInfo.id = formId;
runTableRecordFormInstanceInfo.formName = '灭菌器运行记录表';
runTableRecordFormInstanceInfo.formDefinitionItemIds = runTableRecordFormDefinitionId;
Index: ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/forminstanceForm.jsp
===================================================================
diff -u
--- ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/forminstanceForm.jsp (revision 0)
+++ ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/forminstanceForm.jsp (revision 40949)
@@ -0,0 +1,34 @@
+<%@ page contentType="text/html; charset=UTF-8"%>
+<%@ include file="/common/taglibs.jsp"%>
+
+
+
+
+
+设备巡检记录
+
+
+<%@ include file="/common/includeExtJsAndCss.jsp"%>
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: ssts-web/src/main/webapp/js/commonUtils.js
===================================================================
diff -u -r40908 -r40949
--- ssts-web/src/main/webapp/js/commonUtils.js (.../commonUtils.js) (revision 40908)
+++ ssts-web/src/main/webapp/js/commonUtils.js (.../commonUtils.js) (revision 40949)
@@ -67,4 +67,37 @@
}
}
})
+}
+
+//ZSRY-60:form表单显示在iframe(可以通用)
+function getFormByIframeUtil(params) {
+ var title = params.title;
+ var width = params.width || 850;
+ var height = params.height || 640;
+ var url = params.url;
+ var id = params.id;
+ var win = new top.Ext.Window({
+ id: id,
+ title: title,
+ width: width,
+ height: height,
+ autoScroll: false,
+ isTopContainer: true,
+ modal: true,
+ resizable: false,
+ buttonAlign: 'center',
+ items: [{
+ xtype: "panel",
+ id: "index",
+ html: ""
+ }],
+ listeners: {
+ beforeClose: function () {
+ if (params.grid) {
+ params.grid.dwrReload()
+ }
+ }
+ }
+ })
+ win.show()
}
\ No newline at end of file
Index: ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/forminstanceView.jsp
===================================================================
diff -u -r38083 -r40949
--- ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/forminstanceView.jsp (.../forminstanceView.jsp) (revision 38083)
+++ ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/forminstanceView.jsp (.../forminstanceView.jsp) (revision 40949)
@@ -17,6 +17,7 @@
var userName = '<%=request.getAttribute("userName")%>';
+
@@ -26,7 +27,6 @@
-
+
@@ -20,7 +21,6 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+