|
@@ -272,6 +272,27 @@ $(document).ready(() => {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+ $('#choose').on('show.bs.modal', function () {
|
|
|
+ function chooseType(obj) {
|
|
|
+ obj.style.cursor = 'default';
|
|
|
+ $(obj).children().addClass('text-primary');
|
|
|
+ $('h5', obj).prepend('<i class="fa fa-check pull-right"></i>');
|
|
|
+ }
|
|
|
+ function validType(obj) {
|
|
|
+ obj.style.cursor = 'pointer';
|
|
|
+ $(obj).children().removeClass('text-primary');
|
|
|
+ $('i', obj).remove();
|
|
|
+ }
|
|
|
+ $('#im-pre').val(stage.im_pre ? stage.im_pre : '');
|
|
|
+ const typeArr = $('div[name="im-type"]');
|
|
|
+ for (const t of typeArr) {
|
|
|
+ if ($(t).attr('im-type') === stage.im_type) {
|
|
|
+ chooseType(t);
|
|
|
+ } else {
|
|
|
+ validType(t)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
// 提交 中间计量模式
|
|
|
$('#choose-ok').click(() => {
|
|
|
const chooseType = _.find($('div[name="im-type"]', '#im-type'), function (it) {
|
|
@@ -389,17 +410,17 @@ $(document).ready(() => {
|
|
|
}
|
|
|
});
|
|
|
SpreadJsObj.loadSheetData(gsSpread.getActiveSheet(), SpreadJsObj.DataType.Tree, gsTree);
|
|
|
- const gatherNodes = stage.im_gather_node ? _.map(stage.im_gather_node.split(','), _.toNumber) : [];
|
|
|
+ const gatherNodes = stage.im_gather_node ? _.map(stage.im_gather_node.split(',')) : [];
|
|
|
for (const node of gsTree.datas) {
|
|
|
- node.check = gatherNodes.indexOf(node.id) !== -1;
|
|
|
+ node.check = gatherNodes.indexOf(node.id + '') !== -1;
|
|
|
}
|
|
|
gsTree.expandByLevel(4);
|
|
|
SpreadJsObj.refreshTreeRowVisible(gsSpread.getActiveSheet());
|
|
|
SpreadJsObj.resetFieldReadOnly(gsSpread.getActiveSheet, 'check', !$('#im-gather-check')[0].checked);
|
|
|
} else {
|
|
|
- const gatherNodes = stage.im_gather_node ? _.map(stage.im_gather_node.split(','), _.toNumber) : [];
|
|
|
+ const gatherNodes = stage.im_gather_node ? _.map(stage.im_gather_node.split(',')) : [];
|
|
|
for (const node of gsTree.datas) {
|
|
|
- node.check = gatherNodes.indexOf(node.id) !== -1;
|
|
|
+ node.check = gatherNodes.indexOf(node.id + '') !== -1;
|
|
|
}
|
|
|
SpreadJsObj.reLoadColsData(gsSpread.getActiveSheet(), [0]);
|
|
|
}
|