SearchResultLayoutView.js 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842
  1. define([ "require", "backbone", "table-dragger", "hbs!tmpl/search/SearchResultLayoutView_tmpl", "modules/Modal", "models/VEntity", "utils/Utils", "utils/Globals", "collection/VSearchList", "models/VCommon", "utils/CommonViewFunction", "utils/Messages", "utils/Enums", "utils/UrlLinks", "platform" ], function(require, Backbone, tableDragger, SearchResultLayoutViewTmpl, Modal, VEntity, Utils, Globals, VSearchList, VCommon, CommonViewFunction, Messages, Enums, UrlLinks, platform) {
  2. "use strict";
  3. var SearchResultLayoutView = Backbone.Marionette.LayoutView.extend({
  4. _viewName: "SearchResultLayoutView",
  5. template: SearchResultLayoutViewTmpl,
  6. regions: {
  7. RTagLayoutView: "#r_tagLayoutView",
  8. RSearchLayoutView: "#r_searchLayoutView",
  9. REntityTableLayoutView: "#r_searchResultTableLayoutView",
  10. RSearchQuery: "#r_searchQuery"
  11. },
  12. ui: {
  13. tagClick: '[data-id="tagClick"]',
  14. termClick: '[data-id="termClick"]',
  15. addTag: '[data-id="addTag"]',
  16. addTerm: '[data-id="addTerm"]',
  17. paginationDiv: '[data-id="paginationDiv"]',
  18. previousData: "[data-id='previousData']",
  19. nextData: "[data-id='nextData']",
  20. pageRecordText: "[data-id='pageRecordText']",
  21. addAssignTag: "[data-id='addAssignTag']",
  22. addAssignTerm: "[data-id='addAssignTerm']",
  23. createEntity: "[data-id='createEntity']",
  24. checkDeletedEntity: "[data-id='checkDeletedEntity']",
  25. checkSubClassification: "[data-id='checkSubClassification']",
  26. checkSubType: "[data-id='checkSubType']",
  27. colManager: "[data-id='colManager']",
  28. containerCheckBox: "[data-id='containerCheckBox']",
  29. columnEmptyInfo: "[data-id='columnEmptyInfo']",
  30. showPage: "[data-id='showPage']",
  31. gotoPage: "[data-id='gotoPage']",
  32. gotoPagebtn: "[data-id='gotoPagebtn']",
  33. activePage: "[data-id='activePage']"
  34. },
  35. templateHelpers: function() {
  36. return {
  37. entityCreate: Globals.entityCreate,
  38. searchType: this.searchType,
  39. fromView: this.fromView,
  40. isGlossaryView: "glossary" == this.fromView,
  41. isSearchTab: Utils.getUrlState.isSearchTab()
  42. };
  43. },
  44. events: function() {
  45. var events = {}, that = this;
  46. return events["click " + this.ui.tagClick] = function(e) {
  47. var scope = $(e.currentTarget);
  48. "i" == e.target.nodeName.toLocaleLowerCase() ? this.onClickTagCross(e) : this.triggerUrl({
  49. url: "#!/tag/tagAttribute/" + scope.text(),
  50. urlParams: null,
  51. mergeBrowserUrl: !1,
  52. trigger: !0,
  53. updateTabState: null
  54. });
  55. }, events["click " + this.ui.termClick] = function(e) {
  56. var scope = $(e.currentTarget);
  57. "i" == e.target.nodeName.toLocaleLowerCase() ? this.onClickTermCross(e) : this.triggerUrl({
  58. url: "#!/glossary/" + scope.find("i").data("termguid"),
  59. urlParams: {
  60. gType: "term",
  61. viewType: "term",
  62. fromView: "entity"
  63. },
  64. mergeBrowserUrl: !1,
  65. trigger: !0,
  66. updateTabState: null
  67. });
  68. }, events["keyup " + this.ui.gotoPage] = function(e) {
  69. var code = e.which;
  70. parseInt(e.currentTarget.value);
  71. e.currentTarget.value ? that.ui.gotoPagebtn.attr("disabled", !1) : that.ui.gotoPagebtn.attr("disabled", !0),
  72. 13 == code && e.currentTarget.value && that.gotoPagebtn();
  73. }, events["change " + this.ui.showPage] = "changePageLimit", events["click " + this.ui.gotoPagebtn] = "gotoPagebtn",
  74. events["click " + this.ui.addTag] = "onClickAddTag", events["click " + this.ui.addTerm] = "onClickAddTermBtn",
  75. events["click " + this.ui.addAssignTag] = "onClickAddTag", events["click " + this.ui.addAssignTerm] = "onClickAddTermBtn",
  76. events["click " + this.ui.nextData] = "onClicknextData", events["click " + this.ui.previousData] = "onClickpreviousData",
  77. events["click " + this.ui.createEntity] = "onClickCreateEntity", events["click " + this.ui.checkDeletedEntity] = "onCheckExcludeIncludeResult",
  78. events["click " + this.ui.checkSubClassification] = "onCheckExcludeIncludeResult",
  79. events["click " + this.ui.checkSubType] = "onCheckExcludeIncludeResult", events;
  80. },
  81. initialize: function(options) {
  82. if (_.extend(this, _.pick(options, "value", "guid", "initialView", "isTypeTagNotExists", "classificationDefCollection", "entityDefCollection", "typeHeaders", "searchVent", "enumDefCollection", "tagCollection", "searchTableColumns", "isTableDropDisable", "fromView", "glossaryCollection", "termName", "businessMetadataDefCollection", "profileDBView")),
  83. this.entityModel = new VEntity(), this.searchCollection = new VSearchList(), this.limit = 25,
  84. this.asyncFetchCounter = 0, this.offset = 0, this.bindEvents(), this.multiSelectEntity = [],
  85. this.searchType = "基础查询", this.columnOrder = null, this.defaultColumns = [ "selected", "name", "description", "typeName", "owner", "tag", "term" ],
  86. this.value) {
  87. if (this.value.searchType && "dsl" == this.value.searchType && (this.searchType = "高级查询"),
  88. this.value.pageLimit) {
  89. var pageLimit = parseInt(this.value.pageLimit, 10);
  90. _.isNaN(pageLimit) || 0 == pageLimit || pageLimit <= -1 ? (this.value.pageLimit = this.limit,
  91. this.triggerUrl()) : this.limit = pageLimit;
  92. }
  93. if (this.value.pageOffset) {
  94. var pageOffset = parseInt(this.value.pageOffset, 10);
  95. _.isNaN(pageOffset) || pageLimit <= -1 ? (this.value.pageOffset = this.offset, this.triggerUrl()) : this.offset = pageOffset;
  96. }
  97. }
  98. "IE" === platform.name && (this.isTableDropDisable = !0);
  99. },
  100. bindEvents: function() {
  101. var that = this;
  102. this.onClickLoadMore(), this.listenTo(this.searchCollection, "backgrid:selected", function(model, checked) {
  103. this.multiSelectEntity = [], checked === !0 ? model.set("isEnable", !0) : model.set("isEnable", !1),
  104. this.searchCollection.find(function(item) {
  105. if (item.get("isEnable")) {
  106. var obj = item.toJSON();
  107. that.multiSelectEntity.push({
  108. id: obj.guid,
  109. model: obj
  110. });
  111. }
  112. }), this.updateMultiSelect();
  113. }), this.listenTo(this.searchCollection, "error", function(model, response) {
  114. this.hideLoader({
  115. type: "error"
  116. });
  117. var responseJSON = response && response.responseJSON ? response.responseJSON : null, errorText = responseJSON && (responseJSON.errorMessage || responseJSON.message || responseJSON.error) || "无效表达式";
  118. errorText && (Utils.notifyError({
  119. content: errorText
  120. }), this.$(".searchTable > .well").html("<center>" + _.escape(errorText) + "</center>"));
  121. }, this), this.listenTo(this.searchCollection, "state-changed", function(state) {
  122. if (Utils.getUrlState.isSearchTab()) {
  123. this.updateColumnList(state);
  124. var excludeDefaultColumn = [];
  125. this.value && this.value.type && (excludeDefaultColumn = _.difference(this.searchTableColumns[this.value.type], this.defaultColumns),
  126. null === this.searchTableColumns[this.value.type] ? this.ui.columnEmptyInfo.show() : this.ui.columnEmptyInfo.hide()),
  127. this.columnOrder = this.getColumnOrder(this.REntityTableLayoutView.$el.find(".colSort th.renderable")),
  128. this.triggerUrl();
  129. var attributes = this.searchCollection.filterObj.attributes;
  130. excludeDefaultColumn && attributes && (excludeDefaultColumn.length > attributes.length || _.difference(excludeDefaultColumn, attributes).length) && this.fetchCollection(this.value);
  131. }
  132. }, this), this.listenTo(this.searchVent, "search:refresh", function(model, response) {
  133. this.fetchCollection();
  134. }, this), this.listenTo(this.searchCollection, "backgrid:sorted", function(model, response) {
  135. this.checkTableFetch();
  136. }, this);
  137. },
  138. onRender: function() {
  139. if (this.checkEntityImage = {}, this.commonTableOptions = {
  140. collection: this.searchCollection,
  141. includePagination: !1,
  142. includeFooterRecords: !1,
  143. includeColumnManager: !(!Utils.getUrlState.isSearchTab() || !this.value || "basic" !== this.value.searchType || this.profileDBView),
  144. includeOrderAbleColumns: !1,
  145. includeSizeAbleColumns: !1,
  146. includeTableLoader: !1,
  147. includeAtlasTableSorting: !0,
  148. showDefaultTableSorted: !0,
  149. updateFullCollectionManually: !0,
  150. columnOpts: {
  151. opts: {
  152. initialColumnsVisible: null,
  153. saveState: !1
  154. },
  155. visibilityControlOpts: {
  156. buttonTemplate: _.template("<button class='btn btn-action btn-sm pull-right'>选择字段&nbsp<i class='fa fa-caret-down'></i></button>")
  157. },
  158. el: this.ui.colManager
  159. },
  160. gridOpts: {
  161. emptyText: "没有找到记录!",
  162. className: "table table-hover backgrid table-quickMenu colSort"
  163. },
  164. sortOpts: {
  165. sortColumn: "name",
  166. sortDirection: "ascending"
  167. },
  168. filterOpts: {},
  169. paginatorOpts: {}
  170. }, this.initialView) Globals.entityTypeConfList && this.$(".entityLink").show(),
  171. this.isTypeTagNotExists && Utils.notifyError({
  172. content: Messages.search.notExists
  173. }); else {
  174. var value = {};
  175. this.value ? (value = this.value, value && value.includeDE && this.ui.checkDeletedEntity.prop("checked", !0),
  176. value && value.excludeSC && this.ui.checkSubClassification.prop("checked", !0),
  177. value && value.excludeST && this.ui.checkSubType.prop("checked", !0)) : value = {
  178. query: null,
  179. searchType: "basic"
  180. }, this.updateColumnList(), this.value && this.searchTableColumns && null === this.searchTableColumns[this.value.type] ? this.ui.columnEmptyInfo.show() : this.ui.columnEmptyInfo.hide(),
  181. this.fetchCollection(value, _.extend({
  182. fromUrl: !0
  183. }, this.value && this.value.pageOffset ? {
  184. next: !0
  185. } : null)), this.ui.showPage.select2({
  186. data: _.sortBy(_.union([ 25, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500 ], [ this.limit ])),
  187. tags: !0,
  188. dropdownCssClass: "number-input",
  189. multiple: !1
  190. }), this.value && this.value.pageLimit && this.ui.showPage.val(this.limit).trigger("change", {
  191. skipViewChange: !0
  192. });
  193. }
  194. },
  195. getColumnOrderWithPosition: function() {
  196. var that = this;
  197. return _.map(that.columnOrder, function(value, key) {
  198. return key + "::" + value;
  199. }).join(",");
  200. },
  201. triggerUrl: function(options) {
  202. Utils.setUrl(_.extend({
  203. url: Utils.getUrlState.getQueryUrl().queyParams[0],
  204. urlParams: this.columnOrder ? _.extend(this.value, {
  205. uiParameters: this.getColumnOrderWithPosition()
  206. }) : this.value,
  207. mergeBrowserUrl: !1,
  208. trigger: !1,
  209. updateTabState: !0
  210. }, options));
  211. },
  212. updateMultiSelect: function() {
  213. this.multiSelectEntity.length > 0 ? this.$(".multiSelectTag,.multiSelectTerm").show() : this.$(".multiSelectTag,.multiSelectTerm").hide();
  214. },
  215. updateColumnList: function(updatedList) {
  216. if (updatedList) {
  217. var listOfColumns = [];
  218. _.map(updatedList, function(obj) {
  219. obj.name;
  220. obj.renderable && listOfColumns.push(obj.name);
  221. }), listOfColumns = _.sortBy(listOfColumns), this.value.attributes = listOfColumns.length ? listOfColumns.join(",") : null,
  222. this.value && this.value.type && this.searchTableColumns && (this.searchTableColumns[this.value.type] = listOfColumns.length ? listOfColumns : null);
  223. } else this.value && this.value.type && this.searchTableColumns && this.value.attributes && (this.searchTableColumns[this.value.type] = this.value.attributes.split(","));
  224. },
  225. fetchCollection: function(value, options) {
  226. var that = this, isPostMethod = this.value && "basic" === this.value.searchType, isSearchTab = Utils.getUrlState.isSearchTab(), tagFilters = null, entityFilters = null;
  227. if (isSearchTab && (tagFilters = CommonViewFunction.attributeFilter.generateAPIObj(this.value.tagFilters),
  228. entityFilters = CommonViewFunction.attributeFilter.generateAPIObj(this.value.entityFilters)),
  229. isPostMethod && isSearchTab) var excludeDefaultColumn = this.value.type && this.searchTableColumns ? _.difference(this.searchTableColumns[this.value.type], this.defaultColumns) : null, filterObj = {
  230. entityFilters: entityFilters,
  231. tagFilters: tagFilters,
  232. attributes: excludeDefaultColumn ? excludeDefaultColumn : null
  233. };
  234. this.showLoader(), Globals.searchApiCallRef && 1 === Globals.searchApiCallRef.readyState && Globals.searchApiCallRef.abort();
  235. var apiObj = {
  236. skipDefaultError: !0,
  237. sort: !1,
  238. success: function(dataOrCollection, response) {
  239. if (!that.isDestroyed) {
  240. Globals.searchApiCallRef = void 0;
  241. var isFirstPage = 0 === that.offset, dataLength = 0, goToPage = that.ui.gotoPage.val();
  242. if (that.ui.gotoPage.val(""), that.ui.gotoPage.parent().removeClass("has-error"),
  243. that.ui.gotoPagebtn.prop("disabled", !0), that.ui.pageRecordText instanceof jQuery) {
  244. if (dataLength = isPostMethod && dataOrCollection && dataOrCollection.entities ? dataOrCollection.entities.length : dataOrCollection.length,
  245. !dataLength && that.offset >= that.limit && (options && options.next || goToPage) && options && !options.fromUrl) {
  246. that.hideLoader();
  247. var pageNumber = that.activePage + 1;
  248. return goToPage ? (pageNumber = goToPage, that.offset = (that.activePage - 1) * that.limit) : (that.finalPage = that.activePage,
  249. that.ui.nextData.attr("disabled", !0), that.offset = that.offset - that.limit),
  250. that.value && (that.value.pageOffset = that.offset, that.triggerUrl()), void Utils.notifyInfo({
  251. html: !0,
  252. content: Messages.search.noRecordForPage + "<b>" + Utils.getNumberSuffix({
  253. number: pageNumber,
  254. sup: !0
  255. }) + "</b> 页"
  256. });
  257. }
  258. if (isPostMethod && (Utils.findAndMergeRefEntity({
  259. attributeObject: dataOrCollection.entities,
  260. referredEntities: dataOrCollection.referredEntities
  261. }), that.searchCollection.reset(dataOrCollection.entities, {
  262. silent: !0
  263. }), that.searchCollection.fullCollection.reset(dataOrCollection.entities, {
  264. silent: !0
  265. })), dataLength < that.limit ? that.ui.nextData.attr("disabled", !0) : that.ui.nextData.attr("disabled", !1),
  266. isFirstPage && (!dataLength || dataLength < that.limit) ? that.ui.paginationDiv.hide() : that.ui.paginationDiv.show(),
  267. isFirstPage ? (that.ui.previousData.attr("disabled", !0), that.pageFrom = 1, that.pageTo = that.limit) : that.ui.previousData.attr("disabled", !1),
  268. options && options.next ? (that.pageTo = that.offset + that.limit, that.pageFrom = that.offset + 1) : !isFirstPage && options && options.previous && (that.pageTo = that.pageTo - that.limit,
  269. that.pageFrom = that.pageTo - that.limit + 1), that.ui.pageRecordText.html("显示 <u>" + that.searchCollection.models.length + " 条记录</u> 从 " + that.pageFrom + " - " + that.pageTo),
  270. that.activePage = Math.round(that.pageTo / that.limit), that.ui.activePage.attr("title", "Page " + that.activePage),
  271. that.ui.activePage.text(that.activePage), that.renderTableLayoutView(), that.multiSelectEntity = [],
  272. that.updateMultiSelect(), dataLength > 0 && that.$(".searchTable").removeClass("noData"),
  273. Utils.getUrlState.isSearchTab() && value && !that.profileDBView) {
  274. var searchString = '搜索条件:<span class="filterQuery">' + CommonViewFunction.generateQueryOfFilter(that.value) + "的结果为:</span>";
  275. Globals.entityCreate && Globals.entityTypeConfList && Utils.getUrlState.isSearchTab() && (searchString += '<p>如果你没有在搜索结果中找到目标实体,那么你可以<a href="javascript:void(0)" data-id="createEntity">创建新实体</a></p>'),
  276. that.$(".searchResult").html(searchString);
  277. }
  278. }
  279. }
  280. },
  281. silent: !0,
  282. reset: !0
  283. };
  284. if (this.value) var checkBoxValue = {
  285. excludeDeletedEntities: !this.value.includeDE,
  286. includeSubClassifications: !this.value.excludeSC,
  287. includeSubTypes: !this.value.excludeST,
  288. includeClassificationAttributes: !0
  289. };
  290. if (value) {
  291. if (value.searchType && (this.searchCollection.url = UrlLinks.searchApiUrl(value.searchType)),
  292. _.extend(this.searchCollection.queryParams, {
  293. limit: this.limit,
  294. offset: this.offset,
  295. query: _.trim(value.query),
  296. typeName: value.type || null,
  297. classification: value.tag || null,
  298. termName: value.term || null
  299. }), this.profileDBView && value.typeName && value.guid) {
  300. var profileParam = {};
  301. profileParam.guid = value.guid, profileParam.relation = "hive_db" === value.typeName ? "__hive_table.db" : "__hbase_table.namespace",
  302. profileParam.sortBy = "name", profileParam.sortOrder = "ASCENDING", _.extend(this.searchCollection.queryParams, profileParam);
  303. }
  304. isPostMethod ? (this.searchCollection.filterObj = _.extend({}, filterObj), apiObj.data = _.extend(checkBoxValue, filterObj, _.pick(this.searchCollection.queryParams, "query", "excludeDeletedEntities", "limit", "offset", "typeName", "classification", "termName")),
  305. Globals.searchApiCallRef = this.searchCollection.getBasicRearchResult(apiObj)) : (apiObj.data = null,
  306. this.searchCollection.filterObj = null, this.profileDBView && _.extend(this.searchCollection.queryParams, checkBoxValue),
  307. Globals.searchApiCallRef = this.searchCollection.fetch(apiObj));
  308. } else _.extend(this.searchCollection.queryParams, {
  309. limit: this.limit,
  310. offset: this.offset
  311. }), isPostMethod ? (apiObj.data = _.extend(checkBoxValue, filterObj, _.pick(this.searchCollection.queryParams, "query", "excludeDeletedEntities", "limit", "offset", "typeName", "classification", "termName")),
  312. Globals.searchApiCallRef = this.searchCollection.getBasicRearchResult(apiObj)) : (apiObj.data = null,
  313. this.profileDBView && _.extend(this.searchCollection.queryParams, checkBoxValue),
  314. Globals.searchApiCallRef = this.searchCollection.fetch(apiObj));
  315. },
  316. tableRender: function(options) {
  317. var that = this, savedColumnOrder = options.order, TableLayout = options.table, columnCollection = Backgrid.Columns.extend({
  318. sortKey: "displayOrder",
  319. className: "my-awesome-css-animated-grid",
  320. comparator: function(item) {
  321. return item.get(this.sortKey) || 999;
  322. },
  323. setPositions: function() {
  324. return _.each(this.models, function(model, index) {
  325. model.set("displayOrder", (null == savedColumnOrder ? index : parseInt(savedColumnOrder[model.get("label")])) + 1, {
  326. silent: !0
  327. });
  328. }), this;
  329. }
  330. }), columns = new columnCollection(that.searchCollection.dynamicTable ? that.getDaynamicColumns(that.searchCollection.toJSON()) : that.getFixedDslColumn());
  331. if (columns.setPositions().sort(), "Advanced Search" == this.searchType && columns.length && that.searchCollection.length) {
  332. var tableColumnNames = Object.keys(that.searchCollection.toJSON()[0]);
  333. that.commonTableOptions.sortOpts = {
  334. sortColumn: tableColumnNames[0],
  335. sortDirection: "ascending"
  336. };
  337. }
  338. var table = new TableLayout(_.extend({}, that.commonTableOptions, {
  339. columns: columns
  340. }));
  341. if (0 === table.collection.length && that.$(".searchTable").addClass("noData"),
  342. that.REntityTableLayoutView && (that.value || (that.value = that.options.value),
  343. that.REntityTableLayoutView.show(table), "dsl" !== that.value.searchType ? that.ui.containerCheckBox.show() : that.ui.containerCheckBox.hide(),
  344. that.$(".ellipsis-with-margin .inputAssignTag").hide(), table.trigger("grid:refresh"),
  345. that.isTableDropDisable !== !0)) {
  346. var tableDropFunction = function(from, to, el) {
  347. tableDragger(document.querySelector(".colSort")).destroy(), that.columnOrder = that.getColumnOrder(el.querySelectorAll("th.renderable")),
  348. that.triggerUrl(), that.tableRender({
  349. order: that.columnOrder,
  350. table: TableLayout
  351. }), that.checkTableFetch();
  352. };
  353. that.REntityTableLayoutView.$el.find(".colSort thead tr th:not(.select-all-header-cell)").addClass("dragHandler"),
  354. tableDragger(document.querySelector(".colSort"), {
  355. dragHandler: ".dragHandler"
  356. }).on("drop", tableDropFunction);
  357. }
  358. },
  359. renderTableLayoutView: function(col) {
  360. var that = this;
  361. require([ "utils/TableLayout" ], function(TableLayout) {
  362. if (that.value.uiParameters) var savedColumnOrder = _.object(that.value.uiParameters.split(",").map(function(a) {
  363. return a.split("::");
  364. }));
  365. that.tableRender({
  366. order: savedColumnOrder,
  367. table: TableLayout
  368. }), that.checkTableFetch();
  369. });
  370. },
  371. getColumnOrder: function(arr) {
  372. for (var obj = {}, i = 0; i < arr.length; ++i) {
  373. var innerText = arr[i].innerText.trim();
  374. obj["" == innerText ? "Select" : innerText] = i;
  375. }
  376. return obj;
  377. },
  378. checkTableFetch: function() {
  379. this.asyncFetchCounter <= 0 && (this.hideLoader(), Utils.generatePopover({
  380. el: this.$('[data-id="showMoreLess"]'),
  381. contentClass: "popover-tag-term",
  382. viewFixedPopover: !0,
  383. popoverOptions: {
  384. container: null,
  385. content: function() {
  386. return $(this).find(".popup-tag-term").children().clone();
  387. }
  388. }
  389. }));
  390. },
  391. getFixedDslColumn: function() {
  392. var that = this, columnToShow = null, col = {};
  393. if (this.value = "glossary" === this.fromView ? this.value : Utils.getUrlState.getQueryParams() || this.value,
  394. this.value && "basic" === this.value.searchType && this.searchTableColumns && void 0 !== this.searchTableColumns[this.value.type] && (columnToShow = null == this.searchTableColumns[this.value.type] ? [] : this.searchTableColumns[this.value.type]),
  395. col.Check = {
  396. name: "selected",
  397. label: "选择",
  398. cell: "select-row",
  399. resizeable: !1,
  400. orderable: !1,
  401. renderable: !columnToShow || _.contains(columnToShow, "selected"),
  402. headerCell: "select-all"
  403. }, col.name = {
  404. label: this.value && this.profileDBView ? "表格名称" : "名称",
  405. cell: "html",
  406. editable: !1,
  407. resizeable: !0,
  408. orderable: !1,
  409. renderable: !0,
  410. className: "searchTableName",
  411. formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
  412. fromRaw: function(rawValue, model) {
  413. var obj = model.toJSON(), nameHtml = "", name = Utils.getName(obj);
  414. if (obj.attributes && void 0 !== obj.attributes.serviceType) void 0 === Globals.serviceTypeMap[obj.typeName] && (Globals.serviceTypeMap[obj.typeName] = obj.attributes ? obj.attributes.serviceType : null); else if (void 0 === Globals.serviceTypeMap[obj.typeName] && that.entityDefCollection) {
  415. var defObj = that.entityDefCollection.fullCollection.find({
  416. name: obj.typeName
  417. });
  418. defObj && (Globals.serviceTypeMap[obj.typeName] = defObj.get("serviceType"));
  419. }
  420. obj.serviceType = Globals.serviceTypeMap[obj.typeName], nameHtml = obj.guid ? "-1" == obj.guid ? '<span title="' + name + '">' + name + "</span>" : '<a title="' + name + '" href="#!/detailPage/' + obj.guid + (that.fromView ? "?from=" + that.fromView : "") + '">' + name + "</a>" : '<span title="' + name + '">' + name + "</span>",
  421. obj.status && Enums.entityStateReadOnly[obj.status] && (nameHtml += '<button type="button" title="Deleted" class="btn btn-action btn-md deleteBtn"><i class="fa fa-trash"></i></button>',
  422. nameHtml = '<div class="readOnly readOnlyLink">' + nameHtml + "</div>");
  423. var getImageData = function(options) {
  424. var imagePath = options.imagePath, returnImgUrl = null;
  425. that.checkEntityImage[model.get("guid")] = !1, $.ajax({
  426. url: imagePath,
  427. method: "get",
  428. cache: !0
  429. }).always(function(data, status, xhr) {
  430. 404 == data.status ? returnImgUrl = getImageData({
  431. imagePath: Utils.getEntityIconPath({
  432. entityData: obj,
  433. errorUrl: imagePath
  434. })
  435. }) : data && (that.checkEntityImage[model.get("guid")] = imagePath, returnImgUrl = imagePath,
  436. that.$("img[data-imgGuid='" + obj.guid + "']").removeClass("searchTableLogoLoader").attr("src", imagePath));
  437. });
  438. }, img = "";
  439. return img = "<div><img data-imgGuid='" + obj.guid + "' class='searchTableLogoLoader'></div>",
  440. void 0 == that.checkEntityImage[model.get("guid")] ? getImageData({
  441. imagePath: Utils.getEntityIconPath({
  442. entityData: obj
  443. })
  444. }) : 0 != that.checkEntityImage[model.get("guid")] && (img = "<div><img data-imgGuid='" + obj.guid + "' src='" + that.checkEntityImage[model.get("guid")] + "'></div>"),
  445. img + nameHtml;
  446. }
  447. })
  448. }, col.owner = {
  449. label: "所有者",
  450. cell: "String",
  451. editable: !1,
  452. resizeable: !0,
  453. orderable: !0,
  454. renderable: !0,
  455. formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
  456. fromRaw: function(rawValue, model) {
  457. var obj = model.toJSON();
  458. if (obj && obj.attributes && obj.attributes.owner) return obj.attributes.owner;
  459. }
  460. })
  461. }, this.value && this.profileDBView && (col.createTime = {
  462. label: "创建时间",
  463. cell: "Html",
  464. editable: !1,
  465. formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
  466. fromRaw: function(rawValue, model) {
  467. var obj = model.toJSON();
  468. return obj && obj.attributes && obj.attributes.createTime ? Utils.formatDate({
  469. date: obj.attributes.createTime
  470. }) : "-";
  471. }
  472. })
  473. }), this.value && !this.profileDBView && (col.description = {
  474. label: "描述",
  475. cell: "String",
  476. editable: !1,
  477. resizeable: !0,
  478. orderable: !0,
  479. renderable: !0,
  480. formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
  481. fromRaw: function(rawValue, model) {
  482. var obj = model.toJSON();
  483. if (obj && obj.attributes && obj.attributes.description) return obj.attributes.description;
  484. }
  485. })
  486. }, col.typeName = {
  487. label: "类型",
  488. cell: "Html",
  489. editable: !1,
  490. resizeable: !0,
  491. orderable: !0,
  492. renderable: !columnToShow || _.contains(columnToShow, "typeName"),
  493. formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
  494. fromRaw: function(rawValue, model) {
  495. var obj = model.toJSON();
  496. if (obj && obj.typeName) return '<a title="Search ' + obj.typeName + '" href="#!/search/searchResult?query=' + obj.typeName + ' &searchType=dsl&dslChecked=true">' + obj.typeName + "</a>";
  497. }
  498. })
  499. }, this.getTagCol({
  500. col: col,
  501. columnToShow: columnToShow
  502. }), _.contains([ "glossary" ], this.fromView) || this.getTermCol({
  503. col: col,
  504. columnToShow: columnToShow
  505. }), this.value && "basic" === this.value.searchType)) {
  506. var def = this.entityDefCollection.fullCollection.find({
  507. name: this.value.type
  508. }), systemAttr = [], businessMetadataAttr = [], businessAttributes = {};
  509. if ("_ALL_ENTITY_TYPES" == this.value.type ? this.businessMetadataDefCollection.each(function(model) {
  510. var sortedAttributes = model.get("attributeDefs") || null, name = model.get("name");
  511. sortedAttributes && (sortedAttributes = _.sortBy(sortedAttributes, function(obj) {
  512. return obj.name;
  513. }), businessAttributes[name] = $.extend(!0, {}, sortedAttributes));
  514. }) : businessAttributes = def ? $.extend(!0, {}, def.get("businessAttributeDefs")) || null : null,
  515. def || Globals[this.value.type] || (this.value.tag ? Globals[this.value.tag] ? Globals[this.value.tag] : Globals[Enums.addOnClassification[0]] : void 0)) {
  516. var attrObj = def ? Utils.getNestedSuperTypeObj({
  517. data: def.toJSON(),
  518. collection: this.entityDefCollection,
  519. attrMerge: !0
  520. }) : [];
  521. this.value.type && (Globals[this.value.type] || Globals[Enums.addOnEntities[0]]) && (systemAttr = (Globals[this.value.type] || Globals[Enums.addOnEntities[0]]).attributeDefs),
  522. this.value.tag && (Globals[this.value.tag] || Globals[Enums.addOnClassification[0]]) && (systemAttr = (Globals[this.value.tag] || Globals[Enums.addOnClassification[0]]).attributeDefs),
  523. attrObj = attrObj.concat(systemAttr), businessAttributes && _.each(businessAttributes, function(businessMetadata, businessMetadataName) {
  524. _.each(businessMetadata, function(attr, index) {
  525. var attribute = attr;
  526. attribute.isBusinessAttributes = !0, attribute.name = businessMetadataName + "." + attribute.name,
  527. businessMetadataAttr.push(attribute);
  528. });
  529. }), attrObj = attrObj.concat(businessMetadataAttr), _.each(attrObj, function(obj, key) {
  530. var key = obj.name, isRenderable = _.contains(columnToShow, key), isSortable = obj.typeName.search(/(array|map)/i) == -1;
  531. return "name" == key || "description" == key || "owner" == key ? void (columnToShow && (col[key].renderable = isRenderable)) : void ("__historicalGuids" != key && "__classificationsText" != key && "__classificationNames" != key && "__propagatedClassificationNames" != key && (col[obj.name] = {
  532. label: Enums.systemAttributes[obj.name] ? Enums.systemAttributes[obj.name] : _.escape(obj.isBusinessAttributes ? obj.name : obj.name.capitalize()),
  533. cell: "Html",
  534. headerCell: Backgrid.HeaderHTMLDecodeCell,
  535. editable: !1,
  536. resizeable: !0,
  537. orderable: !0,
  538. sortable: isSortable,
  539. renderable: isRenderable,
  540. headerClassName: obj.isBusinessAttributes ? "no-capitalize" : "",
  541. formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
  542. fromRaw: function(rawValue, model) {
  543. var modelObj = model.toJSON();
  544. if (modelObj && modelObj.attributes && !_.isUndefined(modelObj.attributes[key])) {
  545. var tempObj = {
  546. scope: that,
  547. attributeDefs: [ obj ],
  548. valueObject: {},
  549. isTable: !1
  550. };
  551. if ("__labels" == key) {
  552. var values = modelObj.attributes[key] ? modelObj.attributes[key].split("|") : null, valueOfArray = [];
  553. if (values) return "" === values[values.length - 1] && values.pop(), "" === values[0] && values.shift(),
  554. _.each(values, function(names) {
  555. valueOfArray.push('<span class="json-string"><a class="btn btn-action btn-sm btn-blue btn-icon" ><span>' + _.escape(names) + "</span></a></span>");
  556. }), valueOfArray.join(" ");
  557. }
  558. if ("__customAttributes" == key) {
  559. var customAttributes = modelObj.attributes[key] ? JSON.parse(modelObj.attributes[key]) : null, valueOfArray = [];
  560. if (customAttributes) return _.each(Object.keys(customAttributes), function(value, index) {
  561. valueOfArray.push('<span class="json-string"><a class="btn btn-action btn-sm btn-blue btn-icon" ><span><span>' + _.escape(value) + "</span> : <span>" + _.escape(Object.values(customAttributes)[index]) + "</span></span></a></span>");
  562. }), valueOfArray.join(" ");
  563. }
  564. tempObj.valueObject[key] = modelObj.attributes[key];
  565. var tablecolumn = CommonViewFunction.propertyTable(tempObj);
  566. if (_.isArray(modelObj.attributes[key])) {
  567. var column = $("<div>" + tablecolumn + "</div>");
  568. return tempObj.valueObject[key].length > 2 && column.addClass("toggleList semi-collapsed").append("<span><a data-id='load-more-columns'>Show More</a></span>"),
  569. column;
  570. }
  571. return tablecolumn;
  572. }
  573. }
  574. })
  575. }));
  576. });
  577. }
  578. }
  579. return this.searchCollection.constructor.getTableCols(col, this.searchCollection);
  580. },
  581. onClickLoadMore: function() {
  582. this.$el.on("click", "[data-id='load-more-columns']", function(event) {
  583. event.stopPropagation(), event.stopImmediatePropagation();
  584. var $this = $(this), $toggleList = $(this).parents(".toggleList");
  585. $toggleList.length && ($toggleList.hasClass("semi-collapsed") ? ($toggleList.removeClass("semi-collapsed"),
  586. $this.text("Show Less")) : ($toggleList.addClass("semi-collapsed"), $this.text("Show More")));
  587. });
  588. },
  589. getDaynamicColumns: function(valueObj) {
  590. var that = this, col = {};
  591. if (valueObj && valueObj.length) {
  592. var firstObj = _.first(valueObj);
  593. _.each(_.keys(firstObj), function(key) {
  594. col[key] = {
  595. label: key.capitalize(),
  596. cell: "Html",
  597. editable: !1,
  598. resizeable: !0,
  599. orderable: !0,
  600. formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
  601. fromRaw: function(rawValue, model) {
  602. var modelObj = model.toJSON();
  603. if ("name" == key) {
  604. var nameHtml = "", name = _.escape(modelObj[key]);
  605. return nameHtml = modelObj.guid ? '<a title="' + name + '" href="#!/detailPage/' + modelObj.guid + (that.fromView ? "?from=" + that.fromView : "") + '">' + name + "</a>" : '<span title="' + name + '">' + name + "</span>",
  606. modelObj.status && Enums.entityStateReadOnly[modelObj.status] ? (nameHtml += '<button type="button" title="Deleted" class="btn btn-action btn-md deleteBtn"><i class="fa fa-trash"></i></button>',
  607. '<div class="readOnly readOnlyLink">' + nameHtml + "</div>") : nameHtml;
  608. }
  609. if (modelObj && !_.isUndefined(modelObj[key])) {
  610. var tempObj = {
  611. scope: that,
  612. valueObject: {},
  613. isTable: !1
  614. };
  615. return tempObj.valueObject[key] = modelObj[key], CommonViewFunction.propertyTable(tempObj);
  616. }
  617. }
  618. })
  619. };
  620. });
  621. }
  622. return this.searchCollection.constructor.getTableCols(col, this.searchCollection);
  623. },
  624. getTagCol: function(options) {
  625. var columnToShow = options.columnToShow, col = options.col;
  626. col && (col.tag = {
  627. label: "分类",
  628. cell: "Html",
  629. editable: !1,
  630. sortable: !1,
  631. resizeable: !0,
  632. orderable: !0,
  633. renderable: !columnToShow || _.contains(columnToShow, "tag"),
  634. className: "searchTag",
  635. formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
  636. fromRaw: function(rawValue, model) {
  637. var obj = model.toJSON();
  638. if ("-1" != obj.guid) return obj.status && Enums.entityStateReadOnly[obj.status] ? '<div class="readOnly">' + CommonViewFunction.tagForTable(obj) : CommonViewFunction.tagForTable(obj);
  639. }
  640. })
  641. });
  642. },
  643. getTermCol: function(options) {
  644. var columnToShow = options.columnToShow, col = options.col;
  645. col && (col.term = {
  646. label: "术语",
  647. cell: "Html",
  648. editable: !1,
  649. sortable: !1,
  650. resizeable: !0,
  651. orderable: !0,
  652. renderable: !columnToShow || _.contains(columnToShow, "term"),
  653. className: "searchTag",
  654. formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
  655. fromRaw: function(rawValue, model) {
  656. var obj = model.toJSON();
  657. if ("-1" != obj.guid) return obj.typeName && !_.startsWith(obj.typeName, "AtlasGlossary") ? obj.status && Enums.entityStateReadOnly[obj.status] ? '<div class="readOnly">' + CommonViewFunction.termForTable(obj) : CommonViewFunction.termForTable(obj) : void 0;
  658. }
  659. })
  660. });
  661. },
  662. addTagModalView: function(guid, multiple) {
  663. var that = this;
  664. require([ "views/tag/AddTagModalView" ], function(AddTagModalView) {
  665. new AddTagModalView({
  666. guid: guid,
  667. multiple: multiple,
  668. callback: function() {
  669. that.multiSelectEntity = [], that.$(".multiSelectTag,.multiSelectTerm").hide(),
  670. that.fetchCollection(), that.searchVent && that.searchVent.trigger("entityList:refresh");
  671. },
  672. tagList: that.getTagList(guid, multiple),
  673. showLoader: that.showLoader.bind(that),
  674. hideLoader: that.hideLoader.bind(that),
  675. collection: that.classificationDefCollection,
  676. enumDefCollection: that.enumDefCollection
  677. });
  678. });
  679. },
  680. getTagList: function(guid, multiple) {
  681. if (multiple && 0 !== multiple.length) return [];
  682. var model = this.searchCollection.find(function(item) {
  683. var obj = item.toJSON();
  684. if (obj.guid === guid) return !0;
  685. });
  686. if (!model) return [];
  687. var obj = model.toJSON();
  688. return _.compact(_.map(obj.classifications, function(val) {
  689. if (val.entityGuid == guid) return val.typeName;
  690. }));
  691. },
  692. showLoader: function() {
  693. this.$(".fontLoader:not(.for-ignore)").addClass("show"), this.$(".tableOverlay").addClass("show");
  694. },
  695. hideLoader: function(options) {
  696. this.$(".fontLoader:not(.for-ignore)").removeClass("show"), options && "error" === options.type ? this.$(".ellipsis-with-margin,.pagination-box").hide() : this.$(".ellipsis-with-margin,.pagination-box").show(),
  697. this.$(".tableOverlay").removeClass("show");
  698. },
  699. onClickAddTag: function(e) {
  700. var guid = "", that = this, isTagMultiSelect = $(e.currentTarget).hasClass("multiSelectTag");
  701. isTagMultiSelect && this.multiSelectEntity && this.multiSelectEntity.length ? that.addTagModalView(guid, this.multiSelectEntity) : (guid = that.$(e.currentTarget).data("guid"),
  702. that.addTagModalView(guid));
  703. },
  704. assignTermModalView: function(glossaryCollection, obj) {
  705. var that = this, terms = 0;
  706. _.each(glossaryCollection.fullCollection.models, function(model) {
  707. model.get("terms") && (terms += model.get("terms").length);
  708. }), terms ? require([ "views/glossary/AssignTermLayoutView" ], function(AssignTermLayoutView) {
  709. new AssignTermLayoutView({
  710. guid: obj.guid,
  711. multiple: obj.multiple,
  712. associatedTerms: obj.associatedTerms,
  713. callback: function() {
  714. that.multiSelectEntity = [], that.$(".multiSelectTag,.multiSelectTerm").hide(),
  715. that.fetchCollection();
  716. },
  717. glossaryCollection: glossaryCollection
  718. });
  719. }) : Utils.notifyInfo({
  720. content: "There are no available terms"
  721. });
  722. },
  723. onClickAddTermBtn: function(e) {
  724. var that = this, entityGuid = $(e.currentTarget).data("guid"), obj = {
  725. guid: entityGuid,
  726. multiple: void 0,
  727. associatedTerms: void 0
  728. }, isTermMultiSelect = $(e.currentTarget).hasClass("multiSelectTerm");
  729. that.assignTermModalView(this.glossaryCollection, obj), isTermMultiSelect && this.multiSelectEntity && this.multiSelectEntity.length ? obj.multiple = this.multiSelectEntity : entityGuid && (obj.associatedTerms = this.searchCollection.find({
  730. guid: entityGuid
  731. }).get("meanings"));
  732. },
  733. onClickTagCross: function(e) {
  734. var that = this, tagName = $(e.target).data("name"), guid = $(e.target).data("guid"), entityGuid = $(e.target).data("entityguid"), assetName = $(e.target).data("assetname");
  735. CommonViewFunction.deleteTag({
  736. tagName: tagName,
  737. guid: guid,
  738. associatedGuid: guid != entityGuid ? entityGuid : null,
  739. msg: "<div class='ellipsis-with-margin'>确认删除 <b>" + _.escape(tagName) + "</b> 与 <b>" + _.escape(assetName) + "的关联?</b></div>",
  740. titleMessage: Messages.removeTag,
  741. okText: "Remove",
  742. showLoader: that.showLoader.bind(that),
  743. hideLoader: that.hideLoader.bind(that),
  744. callback: function() {
  745. that.fetchCollection(), that.searchVent && that.searchVent.trigger("entityList:refresh");
  746. }
  747. });
  748. },
  749. onClickTermCross: function(e) {
  750. var $el = $(e.target), termGuid = $el.data("termguid"), guid = $el.data("guid"), termName = $(e.currentTarget).text(), assetname = $el.data("assetname"), meanings = this.searchCollection.find({
  751. guid: guid
  752. }).get("meanings"), that = this, termObj = _.find(meanings, {
  753. termGuid: termGuid
  754. });
  755. CommonViewFunction.removeCategoryTermAssociation({
  756. termGuid: termGuid,
  757. model: {
  758. guid: guid,
  759. relationshipGuid: termObj.relationGuid
  760. },
  761. collection: that.glossaryCollection,
  762. msg: "<div class='ellipsis-with-margin'>Remove: <b>" + _.escape(termName) + "</b> assignment from <b>" + _.escape(assetname) + "?</b></div>",
  763. titleMessage: Messages.glossary.removeTermfromEntity,
  764. isEntityView: !0,
  765. buttonText: "Remove",
  766. callback: function() {
  767. that.fetchCollection();
  768. }
  769. });
  770. },
  771. onClicknextData: function() {
  772. this.offset = this.offset + this.limit, _.extend(this.searchCollection.queryParams, {
  773. offset: this.offset
  774. }), this.value && (this.value.pageOffset = this.offset, this.triggerUrl()), this.fetchCollection(null, {
  775. next: !0
  776. });
  777. },
  778. onClickpreviousData: function() {
  779. this.offset = this.offset - this.limit, this.offset <= -1 && (this.offset = 0),
  780. _.extend(this.searchCollection.queryParams, {
  781. offset: this.offset
  782. }), this.value && (this.value.pageOffset = this.offset, this.triggerUrl()), this.fetchCollection(null, {
  783. previous: !0
  784. });
  785. },
  786. onClickCreateEntity: function(e) {
  787. var that = this;
  788. $(e.currentTarget).blur(), require([ "views/entity/CreateEntityLayoutView" ], function(CreateEntityLayoutView) {
  789. new CreateEntityLayoutView({
  790. entityDefCollection: that.entityDefCollection,
  791. typeHeaders: that.typeHeaders,
  792. searchVent: that.searchVent,
  793. callback: function() {
  794. that.fetchCollection();
  795. }
  796. });
  797. });
  798. },
  799. onCheckExcludeIncludeResult: function(e) {
  800. var flag = !1, val = $(e.currentTarget).attr("data-value");
  801. e.target.checked && (flag = !0), this.value && (this.value[val] = flag, this.triggerUrl()),
  802. _.extend(this.searchCollection.queryParams, {
  803. limit: this.limit,
  804. offset: this.offset
  805. }), this.fetchCollection();
  806. },
  807. changePageLimit: function(e, obj) {
  808. if (!obj || obj && !obj.skipViewChange) {
  809. var limit = parseInt(this.ui.showPage.val());
  810. if (0 == limit) return void this.ui.showPage.data("select2").$container.addClass("has-error");
  811. this.ui.showPage.data("select2").$container.removeClass("has-error"), this.limit = limit,
  812. this.offset = 0, this.value && (this.value.pageLimit = this.limit, this.value.pageOffset = this.offset,
  813. this.triggerUrl()), _.extend(this.searchCollection.queryParams, {
  814. limit: this.limit,
  815. offset: this.offset
  816. }), this.fetchCollection();
  817. }
  818. },
  819. gotoPagebtn: function(e) {
  820. var goToPage = parseInt(this.ui.gotoPage.val());
  821. if (!(_.isNaN(goToPage) || goToPage <= -1)) {
  822. if (this.finalPage && this.finalPage < goToPage) return void Utils.notifyInfo({
  823. html: !0,
  824. content: Messages.search.noRecordForPage + "<b>" + Utils.getNumberSuffix({
  825. number: goToPage,
  826. sup: !0
  827. }) + "</b> 页"
  828. });
  829. this.offset = (goToPage - 1) * this.limit, this.offset <= -1 && (this.offset = 0),
  830. _.extend(this.searchCollection.queryParams, {
  831. limit: this.limit,
  832. offset: this.offset
  833. }), this.offset == this.pageFrom - 1 ? Utils.notifyInfo({
  834. content: Messages.search.onSamePage
  835. }) : (this.value && (this.value.pageOffset = this.offset, this.triggerUrl()), this.fetchCollection(null, {
  836. next: !0
  837. }));
  838. }
  839. }
  840. });
  841. return SearchResultLayoutView;
  842. });