@gitee-code/plugin-xtreme 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/588.10b71307e3730e2215b6.js +1 -0
- package/dist/components/588.eb6e62e44b5b1c185bdf.js +1 -0
- package/dist/components/596.10b71307e3730e2215b6.js +1 -0
- package/dist/components/596.css +3 -0
- package/dist/components/596.eb6e62e44b5b1c185bdf.js +1 -0
- package/dist/components/677.10b71307e3730e2215b6.js +1 -0
- package/dist/components/677.css +10 -0
- package/dist/components/7.10b71307e3730e2215b6.js +1 -0
- package/dist/components/7.eb6e62e44b5b1c185bdf.js +1 -0
- package/dist/components/819.css +7 -0
- package/dist/components/819.eb6e62e44b5b1c185bdf.js +1 -0
- package/dist/images/583df19a86401f3bf2044c2033476fbe.jpg +0 -0
- package/dist/images/65b33c117668fb44a1dfa5fc4fb93836.png +0 -0
- package/dist/repo_search.js +1 -0
- package/dist/search/search.css +17 -0
- package/dist/search/search.js +1 -0
- package/manifest.yml +1 -1
- package/package.json +1 -1
- package/dist/branches.css +0 -90
- package/dist/branches.js +0 -1
- package/dist/conversation_manage.css +0 -31
- package/dist/conversation_manage.js +0 -1
- package/dist/enterprise.js +0 -1
- package/dist/group.js +0 -1
- package/dist/knowledge_base.css +0 -60
- package/dist/knowledge_base.js +0 -1
- package/dist/project.js +0 -1
- package/dist/pull_requests.css +0 -18
- package/dist/pull_requests.js +0 -1
- package/dist/settings.js +0 -1
- package/dist/xtreme.css +0 -2
- package/dist/xtreme.js +0 -1
- package/dist/xtreme_pullrequest.css +0 -4
- package/dist/xtreme_pullrequest.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_gitee_code_plugin_search=self.webpackChunk_gitee_code_plugin_search||[]).push([[588],{1989:(t,r,e)=>{var n=e(1789),o=e(401),a=e(7667),i=e(1327),s=e(1866);function u(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=i,u.prototype.set=s,t.exports=u},8407:(t,r,e)=>{var n=e(7040),o=e(4125),a=e(2117),i=e(7518),s=e(4705);function u(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=i,u.prototype.set=s,t.exports=u},7071:(t,r,e)=>{var n=e(852)(e(5639),"Map");t.exports=n},3369:(t,r,e)=>{var n=e(4785),o=e(1285),a=e(6e3),i=e(9916),s=e(5265);function u(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=i,u.prototype.set=s,t.exports=u},6384:(t,r,e)=>{var n=e(8407),o=e(7465),a=e(3779),i=e(7599),s=e(4758),u=e(4309);function c(t){var r=this.__data__=new n(t);this.size=r.size}c.prototype.clear=o,c.prototype.delete=a,c.prototype.get=i,c.prototype.has=s,c.prototype.set=u,t.exports=c},2705:(t,r,e)=>{var n=e(5639).Symbol;t.exports=n},1149:(t,r,e)=>{var n=e(5639).Uint8Array;t.exports=n},6874:t=>{t.exports=function(t,r,e){switch(e.length){case 0:return t.call(r);case 1:return t.call(r,e[0]);case 2:return t.call(r,e[0],e[1]);case 3:return t.call(r,e[0],e[1],e[2])}return t.apply(r,e)}},4636:(t,r,e)=>{var n=e(2545),o=e(5694),a=e(1469),i=e(4144),s=e(5776),u=e(6719),c=Object.prototype.hasOwnProperty;t.exports=function(t,r){var e=a(t),p=!e&&o(t),f=!e&&!p&&i(t),v=!e&&!p&&!f&&u(t),l=e||p||f||v,_=l?n(t.length,String):[],h=_.length;for(var y in t)!r&&!c.call(t,y)||l&&("length"==y||f&&("offset"==y||"parent"==y)||v&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||s(y,h))||_.push(y);return _}},6556:(t,r,e)=>{var n=e(9465),o=e(7813);t.exports=function(t,r,e){(void 0!==e&&!o(t[r],e)||void 0===e&&!(r in t))&&n(t,r,e)}},4865:(t,r,e)=>{var n=e(9465),o=e(7813),a=Object.prototype.hasOwnProperty;t.exports=function(t,r,e){var i=t[r];a.call(t,r)&&o(i,e)&&(void 0!==e||r in t)||n(t,r,e)}},8470:(t,r,e)=>{var n=e(7813);t.exports=function(t,r){for(var e=t.length;e--;)if(n(t[e][0],r))return e;return-1}},9465:(t,r,e)=>{var n=e(8777);t.exports=function(t,r,e){"__proto__"==r&&n?n(t,r,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[r]=e}},3118:(t,r,e)=>{var n=e(3218),o=Object.create,a=function(){function t(){}return function(r){if(!n(r))return{};if(o)return o(r);t.prototype=r;var e=new t;return t.prototype=void 0,e}}();t.exports=a},8483:(t,r,e)=>{var n=e(5063)();t.exports=n},4239:(t,r,e)=>{var n=e(2705),o=e(9607),a=e(2333),i=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":i&&i in Object(t)?o(t):a(t)}},9454:(t,r,e)=>{var n=e(4239),o=e(7005);t.exports=function(t){return o(t)&&"[object Arguments]"==n(t)}},8458:(t,r,e)=>{var n=e(3560),o=e(5346),a=e(3218),i=e(346),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,p=u.toString,f=c.hasOwnProperty,v=RegExp("^"+p.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!a(t)||o(t))&&(n(t)?v:s).test(i(t))}},8749:(t,r,e)=>{var n=e(4239),o=e(1780),a=e(7005),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,t.exports=function(t){return a(t)&&o(t.length)&&!!i[n(t)]}},313:(t,r,e)=>{var n=e(3218),o=e(5726),a=e(3498),i=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return a(t);var r=o(t),e=[];for(var s in t)("constructor"!=s||!r&&i.call(t,s))&&e.push(s);return e}},2980:(t,r,e)=>{var n=e(6384),o=e(6556),a=e(8483),i=e(9783),s=e(3218),u=e(1704),c=e(6390);t.exports=function t(r,e,p,f,v){r!==e&&a(e,(function(a,u){if(v||(v=new n),s(a))i(r,e,u,p,t,f,v);else{var l=f?f(c(r,u),a,u+"",r,e,v):void 0;void 0===l&&(l=a),o(r,u,l)}}),u)}},9783:(t,r,e)=>{var n=e(6556),o=e(4626),a=e(7133),i=e(278),s=e(8517),u=e(5694),c=e(1469),p=e(9246),f=e(4144),v=e(3560),l=e(3218),_=e(8630),h=e(6719),y=e(6390),x=e(9881);t.exports=function(t,r,e,d,b,g,j){var O=y(t,e),w=y(r,e),m=j.get(w);if(m)n(t,e,m);else{var A=g?g(O,w,e+"",t,r,j):void 0,z=void 0===A;if(z){var S=c(w),P=!S&&f(w),T=!S&&!P&&h(w);A=w,S||P||T?c(O)?A=O:p(O)?A=i(O):P?(z=!1,A=o(w,!0)):T?(z=!1,A=a(w,!0)):A=[]:_(w)||u(w)?(A=O,u(O)?A=x(O):l(O)&&!v(O)||(A=s(w))):z=!1}z&&(j.set(w,A),b(A,w,d,g,j),j.delete(w)),n(t,e,A)}}},5976:(t,r,e)=>{var n=e(6557),o=e(5357),a=e(61);t.exports=function(t,r){return a(o(t,r,n),t+"")}},6560:(t,r,e)=>{var n=e(5703),o=e(8777),a=e(6557),i=o?function(t,r){return o(t,"toString",{configurable:!0,enumerable:!1,value:n(r),writable:!0})}:a;t.exports=i},2545:t=>{t.exports=function(t,r){for(var e=-1,n=Array(t);++e<t;)n[e]=r(e);return n}},1717:t=>{t.exports=function(t){return function(r){return t(r)}}},4318:(t,r,e)=>{var n=e(1149);t.exports=function(t){var r=new t.constructor(t.byteLength);return new n(r).set(new n(t)),r}},4626:(t,r,e)=>{t=e.nmd(t);var n=e(5639),o=r&&!r.nodeType&&r,a=o&&t&&!t.nodeType&&t,i=a&&a.exports===o?n.Buffer:void 0,s=i?i.allocUnsafe:void 0;t.exports=function(t,r){if(r)return t.slice();var e=t.length,n=s?s(e):new t.constructor(e);return t.copy(n),n}},7133:(t,r,e)=>{var n=e(4318);t.exports=function(t,r){var e=r?n(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}},278:t=>{t.exports=function(t,r){var e=-1,n=t.length;for(r||(r=Array(n));++e<n;)r[e]=t[e];return r}},8363:(t,r,e)=>{var n=e(4865),o=e(9465);t.exports=function(t,r,e,a){var i=!e;e||(e={});for(var s=-1,u=r.length;++s<u;){var c=r[s],p=a?a(e[c],t[c],c,e,t):void 0;void 0===p&&(p=t[c]),i?o(e,c,p):n(e,c,p)}return e}},4429:(t,r,e)=>{var n=e(5639)["__core-js_shared__"];t.exports=n},1463:(t,r,e)=>{var n=e(5976),o=e(6612);t.exports=function(t){return n((function(r,e){var n=-1,a=e.length,i=a>1?e[a-1]:void 0,s=a>2?e[2]:void 0;for(i=t.length>3&&"function"==typeof i?(a--,i):void 0,s&&o(e[0],e[1],s)&&(i=a<3?void 0:i,a=1),r=Object(r);++n<a;){var u=e[n];u&&t(r,u,n,i)}return r}))}},5063:t=>{t.exports=function(t){return function(r,e,n){for(var o=-1,a=Object(r),i=n(r),s=i.length;s--;){var u=i[t?s:++o];if(!1===e(a[u],u,a))break}return r}}},8777:(t,r,e)=>{var n=e(852),o=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},1957:(t,r,e)=>{var n="object"==typeof e.g&&e.g&&e.g.Object===Object&&e.g;t.exports=n},5050:(t,r,e)=>{var n=e(7019);t.exports=function(t,r){var e=t.__data__;return n(r)?e["string"==typeof r?"string":"hash"]:e.map}},852:(t,r,e)=>{var n=e(8458),o=e(7801);t.exports=function(t,r){var e=o(t,r);return n(e)?e:void 0}},5924:(t,r,e)=>{var n=e(5569)(Object.getPrototypeOf,Object);t.exports=n},9607:(t,r,e)=>{var n=e(2705),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,s=n?n.toStringTag:void 0;t.exports=function(t){var r=a.call(t,s),e=t[s];try{t[s]=void 0;var n=!0}catch(t){}var o=i.call(t);return n&&(r?t[s]=e:delete t[s]),o}},7801:t=>{t.exports=function(t,r){return null==t?void 0:t[r]}},1789:(t,r,e)=>{var n=e(4536);t.exports=function(){this.__data__=n?n(null):{},this.size=0}},401:t=>{t.exports=function(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}},7667:(t,r,e)=>{var n=e(4536),o=Object.prototype.hasOwnProperty;t.exports=function(t){var r=this.__data__;if(n){var e=r[t];return"__lodash_hash_undefined__"===e?void 0:e}return o.call(r,t)?r[t]:void 0}},1327:(t,r,e)=>{var n=e(4536),o=Object.prototype.hasOwnProperty;t.exports=function(t){var r=this.__data__;return n?void 0!==r[t]:o.call(r,t)}},1866:(t,r,e)=>{var n=e(4536);t.exports=function(t,r){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=n&&void 0===r?"__lodash_hash_undefined__":r,this}},8517:(t,r,e)=>{var n=e(3118),o=e(5924),a=e(5726);t.exports=function(t){return"function"!=typeof t.constructor||a(t)?{}:n(o(t))}},5776:t=>{var r=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&r.test(t))&&t>-1&&t%1==0&&t<e}},6612:(t,r,e)=>{var n=e(7813),o=e(8612),a=e(5776),i=e(3218);t.exports=function(t,r,e){if(!i(e))return!1;var s=typeof r;return!!("number"==s?o(e)&&a(r,e.length):"string"==s&&r in e)&&n(e[r],t)}},7019:t=>{t.exports=function(t){var r=typeof t;return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t}},5346:(t,r,e)=>{var n,o=e(4429),a=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";t.exports=function(t){return!!a&&a in t}},5726:t=>{var r=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||r)}},7040:t=>{t.exports=function(){this.__data__=[],this.size=0}},4125:(t,r,e)=>{var n=e(8470),o=Array.prototype.splice;t.exports=function(t){var r=this.__data__,e=n(r,t);return!(e<0||(e==r.length-1?r.pop():o.call(r,e,1),--this.size,0))}},2117:(t,r,e)=>{var n=e(8470);t.exports=function(t){var r=this.__data__,e=n(r,t);return e<0?void 0:r[e][1]}},7518:(t,r,e)=>{var n=e(8470);t.exports=function(t){return n(this.__data__,t)>-1}},4705:(t,r,e)=>{var n=e(8470);t.exports=function(t,r){var e=this.__data__,o=n(e,t);return o<0?(++this.size,e.push([t,r])):e[o][1]=r,this}},4785:(t,r,e)=>{var n=e(1989),o=e(8407),a=e(7071);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||o),string:new n}}},1285:(t,r,e)=>{var n=e(5050);t.exports=function(t){var r=n(this,t).delete(t);return this.size-=r?1:0,r}},6e3:(t,r,e)=>{var n=e(5050);t.exports=function(t){return n(this,t).get(t)}},9916:(t,r,e)=>{var n=e(5050);t.exports=function(t){return n(this,t).has(t)}},5265:(t,r,e)=>{var n=e(5050);t.exports=function(t,r){var e=n(this,t),o=e.size;return e.set(t,r),this.size+=e.size==o?0:1,this}},4536:(t,r,e)=>{var n=e(852)(Object,"create");t.exports=n},3498:t=>{t.exports=function(t){var r=[];if(null!=t)for(var e in Object(t))r.push(e);return r}},1167:(t,r,e)=>{t=e.nmd(t);var n=e(1957),o=r&&!r.nodeType&&r,a=o&&t&&!t.nodeType&&t,i=a&&a.exports===o&&n.process,s=function(){try{return a&&a.require&&a.require("util").types||i&&i.binding&&i.binding("util")}catch(t){}}();t.exports=s},2333:t=>{var r=Object.prototype.toString;t.exports=function(t){return r.call(t)}},5569:t=>{t.exports=function(t,r){return function(e){return t(r(e))}}},5357:(t,r,e)=>{var n=e(6874),o=Math.max;t.exports=function(t,r,e){return r=o(void 0===r?t.length-1:r,0),function(){for(var a=arguments,i=-1,s=o(a.length-r,0),u=Array(s);++i<s;)u[i]=a[r+i];i=-1;for(var c=Array(r+1);++i<r;)c[i]=a[i];return c[r]=e(u),n(t,this,c)}}},5639:(t,r,e)=>{var n=e(1957),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();t.exports=a},6390:t=>{t.exports=function(t,r){if(("constructor"!==r||"function"!=typeof t[r])&&"__proto__"!=r)return t[r]}},61:(t,r,e)=>{var n=e(6560),o=e(1275)(n);t.exports=o},1275:t=>{var r=Date.now;t.exports=function(t){var e=0,n=0;return function(){var o=r(),a=16-(o-n);if(n=o,a>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},7465:(t,r,e)=>{var n=e(8407);t.exports=function(){this.__data__=new n,this.size=0}},3779:t=>{t.exports=function(t){var r=this.__data__,e=r.delete(t);return this.size=r.size,e}},7599:t=>{t.exports=function(t){return this.__data__.get(t)}},4758:t=>{t.exports=function(t){return this.__data__.has(t)}},4309:(t,r,e)=>{var n=e(8407),o=e(7071),a=e(3369);t.exports=function(t,r){var e=this.__data__;if(e instanceof n){var i=e.__data__;if(!o||i.length<199)return i.push([t,r]),this.size=++e.size,this;e=this.__data__=new a(i)}return e.set(t,r),this.size=e.size,this}},346:t=>{var r=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return r.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},5703:t=>{t.exports=function(t){return function(){return t}}},7813:t=>{t.exports=function(t,r){return t===r||t!=t&&r!=r}},6557:t=>{t.exports=function(t){return t}},5694:(t,r,e)=>{var n=e(9454),o=e(7005),a=Object.prototype,i=a.hasOwnProperty,s=a.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(t){return o(t)&&i.call(t,"callee")&&!s.call(t,"callee")};t.exports=u},1469:t=>{var r=Array.isArray;t.exports=r},8612:(t,r,e)=>{var n=e(3560),o=e(1780);t.exports=function(t){return null!=t&&o(t.length)&&!n(t)}},9246:(t,r,e)=>{var n=e(8612),o=e(7005);t.exports=function(t){return o(t)&&n(t)}},4144:(t,r,e)=>{t=e.nmd(t);var n=e(5639),o=e(5062),a=r&&!r.nodeType&&r,i=a&&t&&!t.nodeType&&t,s=i&&i.exports===a?n.Buffer:void 0,u=(s?s.isBuffer:void 0)||o;t.exports=u},3560:(t,r,e)=>{var n=e(4239),o=e(3218);t.exports=function(t){if(!o(t))return!1;var r=n(t);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}},1780:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},3218:t=>{t.exports=function(t){var r=typeof t;return null!=t&&("object"==r||"function"==r)}},7005:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},8630:(t,r,e)=>{var n=e(4239),o=e(5924),a=e(7005),i=Function.prototype,s=Object.prototype,u=i.toString,c=s.hasOwnProperty,p=u.call(Object);t.exports=function(t){if(!a(t)||"[object Object]"!=n(t))return!1;var r=o(t);if(null===r)return!0;var e=c.call(r,"constructor")&&r.constructor;return"function"==typeof e&&e instanceof e&&u.call(e)==p}},6719:(t,r,e)=>{var n=e(8749),o=e(1717),a=e(1167),i=a&&a.isTypedArray,s=i?o(i):n;t.exports=s},1704:(t,r,e)=>{var n=e(4636),o=e(313),a=e(8612);t.exports=function(t){return a(t)?n(t,!0):o(t)}},2492:(t,r,e)=>{var n=e(2980),o=e(1463)((function(t,r,e){n(t,r,e)}));t.exports=o},5062:t=>{t.exports=function(){return!1}},9881:(t,r,e)=>{var n=e(8363),o=e(1704);t.exports=function(t){return n(t,o(t))}},1900:(t,r,e)=>{"use strict";function n(t,r,e,n,o,a,i,s){var u,c="function"==typeof t?t.options:t;if(r&&(c.render=r,c.staticRenderFns=e,c._compiled=!0),n&&(c.functional=!0),a&&(c._scopeId="data-v-"+a),i?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},c._ssrRegister=u):o&&(u=s?function(){o.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:o),u)if(c.functional){c._injectStyles=u;var p=c.render;c.render=function(t,r){return u.call(r),p(t,r)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,u):[u]}return{exports:t,options:c}}e.d(r,{Z:()=>n})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_gitee_code_plugin_search=self.webpackChunk_gitee_code_plugin_search||[]).push([[588],{1989:(t,r,e)=>{var n=e(1789),o=e(401),a=e(7667),i=e(1327),s=e(1866);function u(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=i,u.prototype.set=s,t.exports=u},8407:(t,r,e)=>{var n=e(7040),o=e(4125),a=e(2117),i=e(7518),s=e(4705);function u(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=i,u.prototype.set=s,t.exports=u},7071:(t,r,e)=>{var n=e(852)(e(5639),"Map");t.exports=n},3369:(t,r,e)=>{var n=e(4785),o=e(1285),a=e(6e3),i=e(9916),s=e(5265);function u(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=i,u.prototype.set=s,t.exports=u},6384:(t,r,e)=>{var n=e(8407),o=e(7465),a=e(3779),i=e(7599),s=e(4758),u=e(4309);function c(t){var r=this.__data__=new n(t);this.size=r.size}c.prototype.clear=o,c.prototype.delete=a,c.prototype.get=i,c.prototype.has=s,c.prototype.set=u,t.exports=c},2705:(t,r,e)=>{var n=e(5639).Symbol;t.exports=n},1149:(t,r,e)=>{var n=e(5639).Uint8Array;t.exports=n},6874:t=>{t.exports=function(t,r,e){switch(e.length){case 0:return t.call(r);case 1:return t.call(r,e[0]);case 2:return t.call(r,e[0],e[1]);case 3:return t.call(r,e[0],e[1],e[2])}return t.apply(r,e)}},4636:(t,r,e)=>{var n=e(2545),o=e(5694),a=e(1469),i=e(4144),s=e(5776),u=e(6719),c=Object.prototype.hasOwnProperty;t.exports=function(t,r){var e=a(t),p=!e&&o(t),f=!e&&!p&&i(t),v=!e&&!p&&!f&&u(t),l=e||p||f||v,_=l?n(t.length,String):[],h=_.length;for(var y in t)!r&&!c.call(t,y)||l&&("length"==y||f&&("offset"==y||"parent"==y)||v&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||s(y,h))||_.push(y);return _}},6556:(t,r,e)=>{var n=e(9465),o=e(7813);t.exports=function(t,r,e){(void 0!==e&&!o(t[r],e)||void 0===e&&!(r in t))&&n(t,r,e)}},4865:(t,r,e)=>{var n=e(9465),o=e(7813),a=Object.prototype.hasOwnProperty;t.exports=function(t,r,e){var i=t[r];a.call(t,r)&&o(i,e)&&(void 0!==e||r in t)||n(t,r,e)}},8470:(t,r,e)=>{var n=e(7813);t.exports=function(t,r){for(var e=t.length;e--;)if(n(t[e][0],r))return e;return-1}},9465:(t,r,e)=>{var n=e(8777);t.exports=function(t,r,e){"__proto__"==r&&n?n(t,r,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[r]=e}},3118:(t,r,e)=>{var n=e(3218),o=Object.create,a=function(){function t(){}return function(r){if(!n(r))return{};if(o)return o(r);t.prototype=r;var e=new t;return t.prototype=void 0,e}}();t.exports=a},8483:(t,r,e)=>{var n=e(5063)();t.exports=n},4239:(t,r,e)=>{var n=e(2705),o=e(9607),a=e(2333),i=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":i&&i in Object(t)?o(t):a(t)}},9454:(t,r,e)=>{var n=e(4239),o=e(7005);t.exports=function(t){return o(t)&&"[object Arguments]"==n(t)}},8458:(t,r,e)=>{var n=e(3560),o=e(5346),a=e(3218),i=e(346),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,p=u.toString,f=c.hasOwnProperty,v=RegExp("^"+p.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!a(t)||o(t))&&(n(t)?v:s).test(i(t))}},8749:(t,r,e)=>{var n=e(4239),o=e(1780),a=e(7005),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,t.exports=function(t){return a(t)&&o(t.length)&&!!i[n(t)]}},313:(t,r,e)=>{var n=e(3218),o=e(5726),a=e(3498),i=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return a(t);var r=o(t),e=[];for(var s in t)("constructor"!=s||!r&&i.call(t,s))&&e.push(s);return e}},2980:(t,r,e)=>{var n=e(6384),o=e(6556),a=e(8483),i=e(9783),s=e(3218),u=e(1704),c=e(6390);t.exports=function t(r,e,p,f,v){r!==e&&a(e,(function(a,u){if(v||(v=new n),s(a))i(r,e,u,p,t,f,v);else{var l=f?f(c(r,u),a,u+"",r,e,v):void 0;void 0===l&&(l=a),o(r,u,l)}}),u)}},9783:(t,r,e)=>{var n=e(6556),o=e(4626),a=e(7133),i=e(278),s=e(8517),u=e(5694),c=e(1469),p=e(9246),f=e(4144),v=e(3560),l=e(3218),_=e(8630),h=e(6719),y=e(6390),x=e(9881);t.exports=function(t,r,e,d,b,g,j){var O=y(t,e),w=y(r,e),m=j.get(w);if(m)n(t,e,m);else{var A=g?g(O,w,e+"",t,r,j):void 0,z=void 0===A;if(z){var S=c(w),P=!S&&f(w),T=!S&&!P&&h(w);A=w,S||P||T?c(O)?A=O:p(O)?A=i(O):P?(z=!1,A=o(w,!0)):T?(z=!1,A=a(w,!0)):A=[]:_(w)||u(w)?(A=O,u(O)?A=x(O):l(O)&&!v(O)||(A=s(w))):z=!1}z&&(j.set(w,A),b(A,w,d,g,j),j.delete(w)),n(t,e,A)}}},5976:(t,r,e)=>{var n=e(6557),o=e(5357),a=e(61);t.exports=function(t,r){return a(o(t,r,n),t+"")}},6560:(t,r,e)=>{var n=e(5703),o=e(8777),a=e(6557),i=o?function(t,r){return o(t,"toString",{configurable:!0,enumerable:!1,value:n(r),writable:!0})}:a;t.exports=i},2545:t=>{t.exports=function(t,r){for(var e=-1,n=Array(t);++e<t;)n[e]=r(e);return n}},1717:t=>{t.exports=function(t){return function(r){return t(r)}}},4318:(t,r,e)=>{var n=e(1149);t.exports=function(t){var r=new t.constructor(t.byteLength);return new n(r).set(new n(t)),r}},4626:(t,r,e)=>{t=e.nmd(t);var n=e(5639),o=r&&!r.nodeType&&r,a=o&&t&&!t.nodeType&&t,i=a&&a.exports===o?n.Buffer:void 0,s=i?i.allocUnsafe:void 0;t.exports=function(t,r){if(r)return t.slice();var e=t.length,n=s?s(e):new t.constructor(e);return t.copy(n),n}},7133:(t,r,e)=>{var n=e(4318);t.exports=function(t,r){var e=r?n(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}},278:t=>{t.exports=function(t,r){var e=-1,n=t.length;for(r||(r=Array(n));++e<n;)r[e]=t[e];return r}},8363:(t,r,e)=>{var n=e(4865),o=e(9465);t.exports=function(t,r,e,a){var i=!e;e||(e={});for(var s=-1,u=r.length;++s<u;){var c=r[s],p=a?a(e[c],t[c],c,e,t):void 0;void 0===p&&(p=t[c]),i?o(e,c,p):n(e,c,p)}return e}},4429:(t,r,e)=>{var n=e(5639)["__core-js_shared__"];t.exports=n},1463:(t,r,e)=>{var n=e(5976),o=e(6612);t.exports=function(t){return n((function(r,e){var n=-1,a=e.length,i=a>1?e[a-1]:void 0,s=a>2?e[2]:void 0;for(i=t.length>3&&"function"==typeof i?(a--,i):void 0,s&&o(e[0],e[1],s)&&(i=a<3?void 0:i,a=1),r=Object(r);++n<a;){var u=e[n];u&&t(r,u,n,i)}return r}))}},5063:t=>{t.exports=function(t){return function(r,e,n){for(var o=-1,a=Object(r),i=n(r),s=i.length;s--;){var u=i[t?s:++o];if(!1===e(a[u],u,a))break}return r}}},8777:(t,r,e)=>{var n=e(852),o=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},1957:(t,r,e)=>{var n="object"==typeof e.g&&e.g&&e.g.Object===Object&&e.g;t.exports=n},5050:(t,r,e)=>{var n=e(7019);t.exports=function(t,r){var e=t.__data__;return n(r)?e["string"==typeof r?"string":"hash"]:e.map}},852:(t,r,e)=>{var n=e(8458),o=e(7801);t.exports=function(t,r){var e=o(t,r);return n(e)?e:void 0}},5924:(t,r,e)=>{var n=e(5569)(Object.getPrototypeOf,Object);t.exports=n},9607:(t,r,e)=>{var n=e(2705),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,s=n?n.toStringTag:void 0;t.exports=function(t){var r=a.call(t,s),e=t[s];try{t[s]=void 0;var n=!0}catch(t){}var o=i.call(t);return n&&(r?t[s]=e:delete t[s]),o}},7801:t=>{t.exports=function(t,r){return null==t?void 0:t[r]}},1789:(t,r,e)=>{var n=e(4536);t.exports=function(){this.__data__=n?n(null):{},this.size=0}},401:t=>{t.exports=function(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}},7667:(t,r,e)=>{var n=e(4536),o=Object.prototype.hasOwnProperty;t.exports=function(t){var r=this.__data__;if(n){var e=r[t];return"__lodash_hash_undefined__"===e?void 0:e}return o.call(r,t)?r[t]:void 0}},1327:(t,r,e)=>{var n=e(4536),o=Object.prototype.hasOwnProperty;t.exports=function(t){var r=this.__data__;return n?void 0!==r[t]:o.call(r,t)}},1866:(t,r,e)=>{var n=e(4536);t.exports=function(t,r){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=n&&void 0===r?"__lodash_hash_undefined__":r,this}},8517:(t,r,e)=>{var n=e(3118),o=e(5924),a=e(5726);t.exports=function(t){return"function"!=typeof t.constructor||a(t)?{}:n(o(t))}},5776:t=>{var r=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&r.test(t))&&t>-1&&t%1==0&&t<e}},6612:(t,r,e)=>{var n=e(7813),o=e(8612),a=e(5776),i=e(3218);t.exports=function(t,r,e){if(!i(e))return!1;var s=typeof r;return!!("number"==s?o(e)&&a(r,e.length):"string"==s&&r in e)&&n(e[r],t)}},7019:t=>{t.exports=function(t){var r=typeof t;return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t}},5346:(t,r,e)=>{var n,o=e(4429),a=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";t.exports=function(t){return!!a&&a in t}},5726:t=>{var r=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||r)}},7040:t=>{t.exports=function(){this.__data__=[],this.size=0}},4125:(t,r,e)=>{var n=e(8470),o=Array.prototype.splice;t.exports=function(t){var r=this.__data__,e=n(r,t);return!(e<0||(e==r.length-1?r.pop():o.call(r,e,1),--this.size,0))}},2117:(t,r,e)=>{var n=e(8470);t.exports=function(t){var r=this.__data__,e=n(r,t);return e<0?void 0:r[e][1]}},7518:(t,r,e)=>{var n=e(8470);t.exports=function(t){return n(this.__data__,t)>-1}},4705:(t,r,e)=>{var n=e(8470);t.exports=function(t,r){var e=this.__data__,o=n(e,t);return o<0?(++this.size,e.push([t,r])):e[o][1]=r,this}},4785:(t,r,e)=>{var n=e(1989),o=e(8407),a=e(7071);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||o),string:new n}}},1285:(t,r,e)=>{var n=e(5050);t.exports=function(t){var r=n(this,t).delete(t);return this.size-=r?1:0,r}},6e3:(t,r,e)=>{var n=e(5050);t.exports=function(t){return n(this,t).get(t)}},9916:(t,r,e)=>{var n=e(5050);t.exports=function(t){return n(this,t).has(t)}},5265:(t,r,e)=>{var n=e(5050);t.exports=function(t,r){var e=n(this,t),o=e.size;return e.set(t,r),this.size+=e.size==o?0:1,this}},4536:(t,r,e)=>{var n=e(852)(Object,"create");t.exports=n},3498:t=>{t.exports=function(t){var r=[];if(null!=t)for(var e in Object(t))r.push(e);return r}},1167:(t,r,e)=>{t=e.nmd(t);var n=e(1957),o=r&&!r.nodeType&&r,a=o&&t&&!t.nodeType&&t,i=a&&a.exports===o&&n.process,s=function(){try{return a&&a.require&&a.require("util").types||i&&i.binding&&i.binding("util")}catch(t){}}();t.exports=s},2333:t=>{var r=Object.prototype.toString;t.exports=function(t){return r.call(t)}},5569:t=>{t.exports=function(t,r){return function(e){return t(r(e))}}},5357:(t,r,e)=>{var n=e(6874),o=Math.max;t.exports=function(t,r,e){return r=o(void 0===r?t.length-1:r,0),function(){for(var a=arguments,i=-1,s=o(a.length-r,0),u=Array(s);++i<s;)u[i]=a[r+i];i=-1;for(var c=Array(r+1);++i<r;)c[i]=a[i];return c[r]=e(u),n(t,this,c)}}},5639:(t,r,e)=>{var n=e(1957),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();t.exports=a},6390:t=>{t.exports=function(t,r){if(("constructor"!==r||"function"!=typeof t[r])&&"__proto__"!=r)return t[r]}},61:(t,r,e)=>{var n=e(6560),o=e(1275)(n);t.exports=o},1275:t=>{var r=Date.now;t.exports=function(t){var e=0,n=0;return function(){var o=r(),a=16-(o-n);if(n=o,a>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},7465:(t,r,e)=>{var n=e(8407);t.exports=function(){this.__data__=new n,this.size=0}},3779:t=>{t.exports=function(t){var r=this.__data__,e=r.delete(t);return this.size=r.size,e}},7599:t=>{t.exports=function(t){return this.__data__.get(t)}},4758:t=>{t.exports=function(t){return this.__data__.has(t)}},4309:(t,r,e)=>{var n=e(8407),o=e(7071),a=e(3369);t.exports=function(t,r){var e=this.__data__;if(e instanceof n){var i=e.__data__;if(!o||i.length<199)return i.push([t,r]),this.size=++e.size,this;e=this.__data__=new a(i)}return e.set(t,r),this.size=e.size,this}},346:t=>{var r=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return r.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},5703:t=>{t.exports=function(t){return function(){return t}}},7813:t=>{t.exports=function(t,r){return t===r||t!=t&&r!=r}},6557:t=>{t.exports=function(t){return t}},5694:(t,r,e)=>{var n=e(9454),o=e(7005),a=Object.prototype,i=a.hasOwnProperty,s=a.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(t){return o(t)&&i.call(t,"callee")&&!s.call(t,"callee")};t.exports=u},1469:t=>{var r=Array.isArray;t.exports=r},8612:(t,r,e)=>{var n=e(3560),o=e(1780);t.exports=function(t){return null!=t&&o(t.length)&&!n(t)}},9246:(t,r,e)=>{var n=e(8612),o=e(7005);t.exports=function(t){return o(t)&&n(t)}},4144:(t,r,e)=>{t=e.nmd(t);var n=e(5639),o=e(5062),a=r&&!r.nodeType&&r,i=a&&t&&!t.nodeType&&t,s=i&&i.exports===a?n.Buffer:void 0,u=(s?s.isBuffer:void 0)||o;t.exports=u},3560:(t,r,e)=>{var n=e(4239),o=e(3218);t.exports=function(t){if(!o(t))return!1;var r=n(t);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}},1780:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},3218:t=>{t.exports=function(t){var r=typeof t;return null!=t&&("object"==r||"function"==r)}},7005:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},8630:(t,r,e)=>{var n=e(4239),o=e(5924),a=e(7005),i=Function.prototype,s=Object.prototype,u=i.toString,c=s.hasOwnProperty,p=u.call(Object);t.exports=function(t){if(!a(t)||"[object Object]"!=n(t))return!1;var r=o(t);if(null===r)return!0;var e=c.call(r,"constructor")&&r.constructor;return"function"==typeof e&&e instanceof e&&u.call(e)==p}},6719:(t,r,e)=>{var n=e(8749),o=e(1717),a=e(1167),i=a&&a.isTypedArray,s=i?o(i):n;t.exports=s},1704:(t,r,e)=>{var n=e(4636),o=e(313),a=e(8612);t.exports=function(t){return a(t)?n(t,!0):o(t)}},2492:(t,r,e)=>{var n=e(2980),o=e(1463)((function(t,r,e){n(t,r,e)}));t.exports=o},5062:t=>{t.exports=function(){return!1}},9881:(t,r,e)=>{var n=e(8363),o=e(1704);t.exports=function(t){return n(t,o(t))}},1900:(t,r,e)=>{"use strict";function n(t,r,e,n,o,a,i,s){var u,c="function"==typeof t?t.options:t;if(r&&(c.render=r,c.staticRenderFns=e,c._compiled=!0),n&&(c.functional=!0),a&&(c._scopeId="data-v-"+a),i?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},c._ssrRegister=u):o&&(u=s?function(){o.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:o),u)if(c.functional){c._injectStyles=u;var p=c.render;c.render=function(t,r){return u.call(r),p(t,r)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,u):[u]}return{exports:t,options:c}}e.d(r,{Z:()=>n})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_gitee_code_plugin_search=self.webpackChunk_gitee_code_plugin_search||[]).push([[596],{1596:(e,t,r)=>{r.r(t),r.d(t,{default:()=>p});var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("PageTitle",[e._v(e._s(e.$t("repo_search.title")))]),e._v(" "),r("FormCommon",{ref:"form",attrs:{"form-items":e.formItems,form:e.form,rules:e.rules,"form-key":"GITEE_SEARCH_SETTINGS"},on:{"form-change":e.handleFormChange}})],1)};a._withStripped=!0;var s=r(2492),i=r.n(s);const n={methods:{getDotObj(e){return e.split(".").reduce(((e,t)=>e[t]),this)},setForm(e,t){const r=this.getDotObj(e),a=this.getDotObj(t);r.forEach((e=>{e.key_not_in_form||this.$set(a,e.key,e.value),e.extraValue&&Object.keys(e.extraValue).forEach((t=>{this.$set(a,t,e.extraValue[t])}))}))},setRule(e,t){const r=this.getDotObj(e);let a=this.getDotObj(t);r.forEach((e=>{a=i()(a,e.rule)}))},getParams(e,t){const r=this.getDotObj(e),a=this.getDotObj(t);return r.reduce(((e,t)=>(Object.hasOwnProperty.call(t,"visible")&&!t.visible||(t.extraValue&&Object.keys(t.extraValue).forEach((t=>{e[t]=a[t]})),t.key_not_in_form||(e[t.key]=a[t.key])),e)),{})},handleFormChange(e,t="form"){const r=this.getDotObj(t);Object.keys(e).forEach((t=>{r[t]=e[t]}))}}};var o=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("ElAlert",{staticClass:"danger_alert",attrs:{type:"error"}},[r("div",{staticClass:"danger-item"},[r("div",{staticClass:"title"},[e._v(e._s(e.$t("repo_search.regenerate_index")))]),e._v(" "),r("div",{staticClass:"delete-group"},[r("div",{staticClass:"desc"},[e._v("\n "+e._s(e.$t("repo_search.regenerate_index_desc"))+"\n ")]),e._v(" "),r("ElButton",{attrs:{disabled:e.disabledFormItem,type:"danger"},on:{click:e.handleClick}},[e._v("\n "+e._s(e.$t("repo_search.regenerate_index_btn"))+"\n ")])],1)])])};o._withStripped=!0;const l={name:"RefreshIndex",props:{form:{type:Object,default:()=>({})}},computed:{disabledFormItem(){return this.FEATURE_TOGGLES.abc_enabled?this.projectArchivedEnabled||!window.gon.user.can_manage_enterprise:this.projectArchivedEnabled}},methods:{handleClick(){this.form.search_branch_rule||this.form.default_search_index_enable?this.$confirm(this.$t("repo_search.regenerate_index_tips"),this.$t("tips"),{type:"warning",beforeClose:(e,t,r)=>{"confirm"===e?(t.confirmButtonLoading=!0,window.GITEE.tools.$http.post(`${window.GITEE.api.goApiProjectPrefix()}/search/index`).then((()=>{this.$message.success(this.$t("repo_search.regenerate_index_success")),r()})).finally((()=>{t.confirmButtonLoading=!1}))):r()}}):this.$message.error(this.$t("repo_search.regenerate_index_error"))}}};var c=r(1900);const h=(0,c.Z)(l,o,[],!1,null,"6f8855bd",null).exports;var d=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("FormItem",{staticClass:"branch_match",attrs:{label:e.label,tip:e.tip}},[r("div",{staticClass:"rule_wrap"},[r("ElInput",{attrs:{maxlength:e.maxlength},on:{change:function(t){return e.$emit("input",t)}},model:{value:e.rule,callback:function(t){e.rule=t},expression:"rule"}}),e._v(" "),r("ElButton",{attrs:{type:"osc",disabled:e.disabled},on:{click:e.handleClick}},[e._v(e._s(e.$t("update")))])],1)])};d._withStripped=!0;const m={name:"BranchMatchingRule",components:{FormItem:window.comps.FormItem},props:{name:String,label:{type:String,default:""},tip:{type:Object,default:()=>({})},value:{type:String,default:""},maxlength:{type:Number,default:255},disabled:{type:Boolean,default:!1},searchBranchRule:{type:String,default:""}},data:()=>({rule:""}),watch:{value:{handler(e){this.rule=e},immediate:!0}},methods:{handleClick(){this.searchBranchRule!==this.rule&&this.$emit("form-change",{})}}},_=(0,c.Z)(m,d,[],!1,null,"4d59da03",null).exports,u={name:"RepoSearch",components:{FormCommon:window.comps.FormCommon},mixins:[n],data:()=>({form:{},rules:{},searchBranchRule:""}),computed:{disabledFormItem(){return this.FEATURE_TOGGLES.abc_enabled?this.projectArchivedEnabled||!window.gon.user.can_manage_enterprise:this.projectArchivedEnabled},formItems(){return[{key:"enabled",value:!1,customComponent:"FormItemSwitch",meta:{label:this.$t("repo_search.enable_repo_search_content"),description:this.$t("repo_search.enable_repo_search_content_desc"),disabled:this.disabledFormItem}},{key:"search_branch_rule",value:"",customComponent:_,visible:this.form.enabled,meta:{label:this.$t("repo_search.branch_matching_rule"),disabled:this.disabledFormItem,maxlength:4096,searchBranchRule:this.searchBranchRule,tip:{content:this.$t("repo_search.branch_matching_rule_placeholder"),width:180}},rule:{search_branch_rule:[{trigger:"blur",validator:(e,t,r)=>{if(t){/^\|.*|.*\|$/.test(t)&&r(new Error(this.$t("repo_search.branch_matching_tips")));const e=t.split("|");let a="";e.forEach((e=>{const t=window.GITEE.tools.branchNameValidator("",e);t&&(a=t)})),a?r(new Error(a)):r()}else r()}}]}},{key:"default_search_index_enable",value:!1,customComponent:"FormItemSwitch",visible:this.form.enabled,meta:{label:this.$t("repo_search.default_branch_index"),description:this.$t("repo_search.default_branch_index_desc"),disabled:this.disabledFormItem}},{key:"regenerate_index",not_prop:!0,value:!1,visible:this.form.enabled,customComponent:h}]}},created(){this.setForm("formItems","form"),this.setRule("formItems","rules"),this.getDetail()},methods:{getDetail(){window.GITEE.tools.$http.get(`${window.GITEE.api.goApiProjectPrefix()}/search_project_setting`).then((({data:e})=>{this.form={...e},this.searchBranchRule=e.search_branch_rule}))},handleFormChange(e){Object.keys(e).forEach((t=>{this.form[t]=e[t]})),this.$nextTick((()=>{this.SCHEMA.FORM_MAPS.GITEE_SEARCH_SETTINGS.validate((e=>{e&&this.submit()}))}))},submit(){window.GITEE.tools.$http.put(`${window.GITEE.api.goApiProjectPrefix()}/search_project_setting`,this.form).then((({data:e})=>{this.searchBranchRule=e.search_branch_rule,this.$message.success(this.$t("update_success"))}))}}},p=(0,c.Z)(u,a,[],!1,null,"d11a64e0",null).exports}}]);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
.danger_alert[data-v-6f8855bd]{width:584px;position:relative;overflow:visible}.danger_alert[data-v-6f8855bd] .el-alert__content{width:100%}.danger_alert[data-v-6f8855bd] .el-alert__description{width:100%;color:var(--gray-9)}.delete-group[data-v-6f8855bd]{display:flex;gap:10px;align-items:center;justify-content:space-between}.desc[data-v-6f8855bd]{padding:10px 0px;width:400px}.title[data-v-6f8855bd]{font-weight:700}
|
|
2
|
+
.branch_match[data-v-4d59da03]{display:block}.rule_wrap[data-v-4d59da03]{display:flex;gap:20px}.rule_wrap .el-input[data-v-4d59da03]{flex:1}
|
|
3
|
+
.danger-item[data-v-d11a64e0]{border-bottom:1px solid var(--red-2);margin-bottom:20px;padding-bottom:20px}.danger-item[data-v-d11a64e0]:last-child{border-bottom:none;margin-bottom:0px}.danger-item .title[data-v-d11a64e0]{font-weight:700}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_gitee_code_plugin_search=self.webpackChunk_gitee_code_plugin_search||[]).push([[596],{1596:(e,t,r)=>{r.r(t),r.d(t,{default:()=>p});var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("PageTitle",[e._v(e._s(e.$t("repo_search.title")))]),e._v(" "),r("FormCommon",{ref:"form",attrs:{"form-items":e.formItems,form:e.form,rules:e.rules,"form-key":"GITEE_SEARCH_SETTINGS"},on:{"form-change":e.handleFormChange}})],1)};a._withStripped=!0;var s=r(2492),i=r.n(s);const n={methods:{getDotObj(e){return e.split(".").reduce(((e,t)=>e[t]),this)},setForm(e,t){const r=this.getDotObj(e),a=this.getDotObj(t);r.forEach((e=>{e.key_not_in_form||this.$set(a,e.key,e.value),e.extraValue&&Object.keys(e.extraValue).forEach((t=>{this.$set(a,t,e.extraValue[t])}))}))},setRule(e,t){const r=this.getDotObj(e);let a=this.getDotObj(t);r.forEach((e=>{a=i()(a,e.rule)}))},getParams(e,t){const r=this.getDotObj(e),a=this.getDotObj(t);return r.reduce(((e,t)=>(Object.hasOwnProperty.call(t,"visible")&&!t.visible||(t.extraValue&&Object.keys(t.extraValue).forEach((t=>{e[t]=a[t]})),t.key_not_in_form||(e[t.key]=a[t.key])),e)),{})},handleFormChange(e,t="form"){const r=this.getDotObj(t);Object.keys(e).forEach((t=>{r[t]=e[t]}))}}};var o=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("ElAlert",{staticClass:"danger_alert",attrs:{type:"error"}},[r("div",{staticClass:"danger-item"},[r("div",{staticClass:"title"},[e._v(e._s(e.$t("repo_search.regenerate_index")))]),e._v(" "),r("div",{staticClass:"delete-group"},[r("div",{staticClass:"desc"},[e._v("\n "+e._s(e.$t("repo_search.regenerate_index_desc"))+"\n ")]),e._v(" "),r("ElButton",{attrs:{disabled:e.disabledFormItem,type:"danger"},on:{click:e.handleClick}},[e._v("\n "+e._s(e.$t("repo_search.regenerate_index_btn"))+"\n ")])],1)])])};o._withStripped=!0;const l={name:"RefreshIndex",props:{form:{type:Object,default:()=>({})}},computed:{disabledFormItem(){return this.FEATURE_TOGGLES.abc_enabled?this.projectArchivedEnabled||!window.gon.user.can_manage_enterprise:this.projectArchivedEnabled}},methods:{handleClick(){this.form.search_branch_rule||this.form.default_search_index_enable?this.$confirm(this.$t("repo_search.regenerate_index_tips"),this.$t("tips"),{type:"warning",beforeClose:(e,t,r)=>{"confirm"===e?(t.confirmButtonLoading=!0,window.GITEE.tools.$http.post(`${window.GITEE.api.goApiProjectPrefix()}/search/index`).then((()=>{this.$message.success(this.$t("repo_search.regenerate_index_success")),r()})).finally((()=>{t.confirmButtonLoading=!1}))):r()}}):this.$message.error(this.$t("repo_search.regenerate_index_error"))}}};var c=r(1900);const h=(0,c.Z)(l,o,[],!1,null,"6f8855bd",null).exports;var d=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("FormItem",{staticClass:"branch_match",attrs:{label:e.label,tip:e.tip}},[r("div",{staticClass:"rule_wrap"},[r("ElInput",{attrs:{maxlength:e.maxlength},on:{change:function(t){return e.$emit("input",t)}},model:{value:e.rule,callback:function(t){e.rule=t},expression:"rule"}}),e._v(" "),r("ElButton",{attrs:{type:"osc",disabled:e.disabled},on:{click:e.handleClick}},[e._v(e._s(e.$t("update")))])],1)])};d._withStripped=!0;const m={name:"BranchMatchingRule",components:{FormItem:window.comps.FormItem},props:{name:String,label:{type:String,default:""},tip:{type:Object,default:()=>({})},value:{type:String,default:""},maxlength:{type:Number,default:255},disabled:{type:Boolean,default:!1},searchBranchRule:{type:String,default:""}},data:()=>({rule:""}),watch:{value:{handler(e){this.rule=e},immediate:!0}},methods:{handleClick(){this.searchBranchRule!==this.rule&&this.$emit("form-change",{})}}},_=(0,c.Z)(m,d,[],!1,null,"4d59da03",null).exports,u={name:"RepoSearch",components:{FormCommon:window.comps.FormCommon},mixins:[n],data:()=>({form:{},rules:{},searchBranchRule:""}),computed:{disabledFormItem(){return this.FEATURE_TOGGLES.abc_enabled?this.projectArchivedEnabled||!window.gon.user.can_manage_enterprise:this.projectArchivedEnabled},formItems(){return[{key:"enabled",value:!1,customComponent:"FormItemSwitch",meta:{label:this.$t("repo_search.enable_repo_search_content"),description:this.$t("repo_search.enable_repo_search_content_desc"),disabled:this.disabledFormItem}},{key:"search_branch_rule",value:"",customComponent:_,visible:this.form.enabled,meta:{label:this.$t("repo_search.branch_matching_rule"),disabled:this.disabledFormItem,maxlength:4096,searchBranchRule:this.searchBranchRule,tip:{content:this.$t("repo_search.branch_matching_rule_placeholder"),width:180}},rule:{search_branch_rule:[{trigger:"blur",validator:(e,t,r)=>{if(t){/^\|.*|.*\|$/.test(t)&&r(new Error(this.$t("repo_search.branch_matching_tips")));const e=t.split("|");let a="";e.forEach((e=>{const t=window.GITEE.tools.branchNameValidator("",e);t&&(a=t)})),a?r(new Error(a)):r()}else r()}}]}},{key:"default_search_index_enable",value:!1,customComponent:"FormItemSwitch",visible:this.form.enabled,meta:{label:this.$t("repo_search.default_branch_index"),description:this.$t("repo_search.default_branch_index_desc"),disabled:this.disabledFormItem}},{key:"regenerate_index",not_prop:!0,value:!1,visible:this.form.enabled,customComponent:h}]}},created(){this.setForm("formItems","form"),this.setRule("formItems","rules"),this.getDetail()},methods:{getDetail(){window.GITEE.tools.$http.get(`${window.GITEE.api.goApiProjectPrefix()}/search_project_setting`).then((({data:e})=>{this.form={...e},this.searchBranchRule=e.search_branch_rule}))},handleFormChange(e){Object.keys(e).forEach((t=>{this.form[t]=e[t]})),this.$nextTick((()=>{this.SCHEMA.FORM_MAPS.GITEE_SEARCH_SETTINGS.validate((e=>{e&&this.submit()}))}))},submit(){window.GITEE.tools.$http.put(`${window.GITEE.api.goApiProjectPrefix()}/search_project_setting`,this.form).then((({data:e})=>{this.searchBranchRule=e.search_branch_rule,this.$message.success(this.$t("update_success"))}))}}},p=(0,c.Z)(u,a,[],!1,null,"d11a64e0",null).exports}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_gitee_code_plugin_search=self.webpackChunk_gitee_code_plugin_search||[]).push([[677],{928:(e,t,a)=>{a.r(t),a.d(t,{default:()=>K});var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"code_global_search"},[e.hasKeywords?a("div",{staticClass:"global_search_result"},[a("div",{staticClass:"global_search_wrap"},[a("el-input",{staticClass:"global_search_input",attrs:{placeholder:e.$t("common.search"),value:e.$route.query.wd},on:{focus:e.handleTrigger}},[a("i",{staticClass:"iconfont-new iconsearch",attrs:{slot:"prepend"},slot:"prepend"}),e._v(" "),a("template",{slot:"append"},[e._v(">_")])],2)],1),e._v(" "),a("keep-alive",[a(e.searchComponent,{ref:e.activeName+"SearchComponent",tag:"component",class:e.activeName+"_comp",attrs:{keywords:e.keywords},on:{search:e.handleSearch}})],1)],1):a("div",[a("GlobalSearchEntry")],1)])};s._withStripped=!0;var i=function(){var e=this,t=e.$createElement;return(e._self._c||t)("CommonSearch",{attrs:{keywords:e.keywords,"total-count":e.totalCount,"spend-time":e.spendTime,"search-array":e.searchArray,"item-component":e.itemComponent,"table-data":e.tableData,loading:e.loading,"load-end":!0,params:e.params,page:e.page,pagination:e.pagination},on:{search:e.handleSearch,action:e.handleRowAction}})};i._withStripped=!0;var o=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"search_wrap"},[e.isGlobalSearch?a("div",{staticClass:"search_result_tab"},[a("div",{staticClass:"search_result_tab__sticky"},[a("div",[a("CommonTitle",{attrs:{"font-size":14}},[e._v(e._s(e.$t("dashboard.filter_result")))]),e._v(" "),e._l(e.tabArr,(function(t){return a("div",{key:t.code,staticClass:"search_result_tab_item",class:{active:e.activeName===t.code},on:{click:function(a){e.activeName=t.code}}},[a("span",[t.showMove?a("i",{staticClass:"iconfont-new icon-move"}):e._e(),e._v(" "),a("i",{class:t.icon}),e._v("\n "+e._s(t.name)+"\n ")])])}))],2),e._v(" "),e.searchArray.length?a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.searchArrayLoading,expression:"searchArrayLoading"}],staticClass:"search_wrap_extra"},[e._l(e.searchArray,(function(t){return[t.onlyInput&&t.visible||t.defaultChildren&&t.defaultChildren.length>0?a("div",{key:t.value,staticClass:"search_wrap_extra_item mt-2 pt-2"},[a("CommonTitle",{attrs:{"font-size":14}},[a("div",[e._v("\n "+e._s(t.name)+"\n "),t.tips?a("el-tooltip",{attrs:{placement:"top",content:t.tips}},[a("i",{staticClass:"iconfont-new iconremark cursor-pointer ml-1"})]):e._e()],1)]),e._v(" "),t.filter?a("el-input",{staticClass:"mb-1",attrs:{disabled:!e.loadEnd,size:"medium",clearable:"","suffix-icon":"el-icon-search",placeholder:t.filterPlaceholder},on:{input:function(e){return t.handleInput(e,t)}},model:{value:t.filterWord,callback:function(a){e.$set(t,"filterWord",a)},expression:"item.filterWord"}}):e._e(),e._v(" "),"select"===t.type?a("el-select",{staticStyle:{width:"240px"},attrs:{multiple:"",filterable:"","collapse-tags":"",placeholder:e.$t("please_select"),"filter-method":e.filterRepoCode,"popper-append-to-body":!1},on:{"visible-change":e.changeSelect,"remove-tag":e.repoChange},model:{value:e.repoCode,callback:function(t){e.repoCode=t},expression:"repoCode"}},e._l(t.children,(function(t){return a("el-option",{key:t.identity,attrs:{label:t.name,value:t.identity}},[a("el-tooltip",{attrs:{content:t.name}},[a("div",[e._v(e._s(t.name))])])],1)})),1):a("ul",{staticClass:"search_list",class:{search_scoll:t.childrenScroller},on:{scroll:function(a){return e.handleSearchScroll(a,t)}}},[e._l(t.children,(function(s,i){return a("li",{key:i,staticClass:"search_item",class:{active:s.active,disabled:t.disabled},on:{click:function(a){return e.handleSearch(t,s)}}},[a("el-tooltip",{attrs:{"show-overflow-tooltip":t.showOverflowTooltip,content:s.tooltipName||s.name,placement:"top"}},[a("span",{staticClass:"item_name"},["languages"===t.value?a("LanguageColorDot",{attrs:{name:s.name}}):[e._v(e._s(s.name))]],2)]),e._v(" "),s.active?a("i",{staticClass:"iconfont-new icondelete-"}):[a("span",{directives:[{name:"show",rawName:"v-show",value:e.loadEnd,expression:"loadEnd"}],staticClass:"item_num"},[e._v(e._s(s.num))]),e._v(" "),a("i",{directives:[{name:"show",rawName:"v-show",value:!e.loadEnd&&t.hasNumLoading,expression:"!loadEnd && item.hasNumLoading"}],staticClass:"el-icon-loading"})]],2)})),e._v(" "),t.hasMore&&!t.childrenScroller?a("li",{staticClass:"search_item show-more",on:{click:function(a){return e.handleShowMore(t)}}},[e._v(e._s(e.$t("dashboard.show_more")))]):e._e()],2),e._v(" "),a(t.listBottomComp&&t.listBottomComp(),{tag:"component",staticClass:"search_item show-more"})],1):e._e()]}))],2):e._e()])]):e._e(),e._v(" "),a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading&&(e.page<=1&&!e.pagination||e.pagination),expression:"loading && (page <= 1 && !pagination || pagination)"}],staticClass:"search_wrap_right",class:{search_wrap_right_padding:e.isGlobalSearch}},[e.showResultNoData?a("NoData"):[e.$slots.searchResult?[e._t("searchResult")]:[e.tableData.length>0?a("div",{staticClass:"search_summary"},[e.totalCount?a("span",{staticClass:"search_count"},[e._v("\n "+e._s(e.$t("dashboard.search_result",{totalCount:e.totalCount}))+"\n ")]):e._e()]):e._e()],e._v(" "),e.dynamicScroll?a("DynamicScroller",{ref:"dynamicScroller",staticClass:"search_result_list",attrs:{items:e.tableData,"min-item-size":e.minItemSize,"key-field":e.keyField},nativeOn:{scroll:function(t){return e.handleScroll.apply(null,arguments)}},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.item,i=t.index,o=t.active;return[a("DynamicScrollerItem",{staticClass:"result_item",attrs:{item:s,active:o,"data-index":i,"size-dependencies":e.getSizeDependencies(s)}},[e.itemComponent?[a(e.itemComponent,{tag:"component",attrs:{"row-data":s,keywords:e.keywords},on:{action:e.handleAction,"dependenc-change":e.handleDependencChange}})]:e._e()],2)]}}],null,!1,1522311884)}):a("ul",{staticClass:"search_result_list"},e._l(e.tableData,(function(t){return a("li",{key:t.id||t.key,staticClass:"result_item"},[e.itemComponent?[a(e.itemComponent,{tag:"component",attrs:{"row-data":t,keywords:e.keywords},on:{action:e.handleAction,"dependenc-change":e.handleDependencChange}})]:e._e()],2)})),0),e._v(" "),e.pagination?a("el-pagination",{attrs:{"hide-on-single-page":!1,"current-page":e.pagination.page,"page-size":e.pagination.per_page,"page-sizes":[10,20,30,40],layout:e.pagination.layout||"prev, adaption, next, jumper, sizes",total:e.pagination.count},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}}):e._e(),e._v(" "),e.moreLoading&&!e.pagination?a("li",{staticClass:"loading-text"},[e._v("\n "+e._s(e.$t("loading"))),a("i",{staticClass:"el-icon-loading"})]):e._e()]],2)])};o._withStripped=!0;var r=a(7007),n=a(8140);const l={name:"CommonSearch",mixins:[n.Z],components:{LanguageColorDot:window.comps.LanguageColorDot,DynamicScroller:r.cV,DynamicScrollerItem:r.Wk},props:{itemComponent:{type:Object},tableData:{type:Array,default:()=>[]},totalCount:{type:Number,default:0},spendTime:{type:Number,default:0},searchArray:{type:Array,default:()=>[]},searchArrayLoading:{type:Boolean,default:!1},keywords:{type:String,default:""},loading:{type:Boolean,default:!1},loadEnd:{type:Boolean,default:!1},moreLoading:{type:Boolean,default:!1},params:{type:Object,default:()=>({})},type:{type:String,default:""},pagination:{type:Object,default:null},page:{type:Number,default:1},dynamicScroll:{type:Boolean,default:!1},minItemSize:{type:Number},getSizeDependencies:{type:Function,default:()=>[]},keyField:{type:String,default:"id"}},data:()=>({leftSideHeight:0,repoCode:"",activeName:"",listHeight:1e3}),computed:{isGlobalSearch(){return"company#search"===this.$route.name},usedTime(){return this.spendTime<1e3?`${this.spendTime}ms`:`${(this.spendTime/1e3).toFixed(2)}s`},hasSearchParams(){return Object.values(this.params).filter((e=>e)).length>0},showPageNoData(){return!this.loading&&0===this.tableData.length&&!this.hasSearchParams},showResultNoData(){return!this.loading&&0===this.tableData.length},leftSideStyle(){return{height:`${this.leftSideHeight}px`}}},watch:{params:{handler(e){e&&!e.project_ids&&(this.repoCode="")}},activeName(e){this.$store.commit("dashboard/setActiveTab",e)}},activated(){this.activeName=this.$store.getters["dashboard/getActiveTab"]},mounted(){this.isGlobalSearch&&(window.addEventListener("resize",this.getLeftSideStyle),this.getLeftSideStyle())},beforeDestroy(){this.isGlobalSearch&&window.removeEventListener("resize",this.getLeftSideStyle)},methods:{getLeftSideStyle(){const{top:e}=document.querySelector(".code-app .code-app-layout").getBoundingClientRect();this.leftSideHeight=document.documentElement.clientHeight-e},handleAction(...e){this.$emit("action",...e)},handleSearch(e,t){if(e.disabled||!this.loadEnd)return;const a={...this.getParams()};e.multiple?t.active?a[e.paramsKey]=a[e.paramsKey].filter((e=>e!==t.identity)):(a[e.paramsKey]||(a[e.paramsKey]=[]),a[e.paramsKey].push(t.identity)):a[e.paramsKey]=t.active?"":t.identity,this.$emit("search",a,e),this.$root.$el.querySelector(".ent-resource-body").scrollTop=0},handleShowMore(e){!e.disabled&&this.loadEnd&&e.handleShowMore(e)},getParams(){const e={};return this.searchArray.forEach((t=>{if(t.multiple){const a=t.children.filter((e=>e.active));e[t.paramsKey]=a.map((e=>e.identity))}else if(t.onlyInput)e[t.paramsKey]=t.filterWord;else{const a=t.children.find((e=>e.active));e[t.paramsKey]=a?.identity||""}})),e},filterRepoCode(e){this.$emit("update:repoSearchWord",e)},changeSelect(e){e||this.repoChange()},repoChange(){const e={...this.getParams(),project_ids:this.repoCode.join(",")};this.$emit("search",e)},handleSizeChange(e){this.$emit("action","changeSize",e,this.pagination.page>Math.ceil(this.pagination.count/e))},handleCurrentChange(e){this.$emit("action","changeCurrent",e)},handleToggle(e,t){this.$emit("action","handleToggle",e,t)},handleDependencChange(e,t){this.$emit("dependenc-change",e,t)},handleScroll:window.GITEE.tools.debounce((function(e){const{scrollTop:t,clientHeight:a,scrollHeight:s}=e.target;s-(t+a)<50&&this.$emit("action","loadMore")}),300),handleSearchScroll:window.GITEE.tools.debounce((function(e,t){if(!t.childrenScroller||!t.hasMore)return;const{scrollTop:a,clientHeight:s,scrollHeight:i}=e.target;i-(a+s)<50&&this.handleShowMore(t)}),300)}};var h=a(1900);const c=(0,h.Z)(l,o,[],!1,null,"a0e7e130",null).exports,d={name:"SearchProjects",components:{CommonSearch:c},mixins:[n.Z],props:{keywords:{type:String,default:""}},data(){return{page:1,per_page:20,totalCount:0,totalPage:0,tableData:[],spendTime:0,itemComponent:GITEE.components.ProjectItem,searchArray:[{name:this.$t("type"),value:"project_types",paramsKey:"type",showOverflowTooltip:!0,children:[],defaultChildren:[]},{name:this.$t("common.language"),value:"languages",paramsKey:"lang_id",showOverflowTooltip:!0,children:[],defaultChildren:[]},{name:this.$t("groups.repo_groups"),value:"top_groups",paramsKey:"top_group_path",showOverflowTooltip:!0,children:[],defaultChildren:[]}],params:{type:null,lang_id:null,top_group_path:null},loading:!1}},computed:{pagination(){return{page:this.page,per_page:this.per_page,count:this.totalCount,layout:"prev, adaption, next, sizes"}}},methods:{handleSearch(e){this.assignParams(e,this.searchArray),this.tableData=[],this.page=1,this.getProjectList()},getProjectList(){this.loading=!0,this.api.dashboard.getProjects({params:{page:this.page,per_page:this.per_page,keyword:this.keywords,...this.params},noCancel:!0}).then((({data:e})=>{this.spendTime=e.data.total_time,this.totalCount=e.meta.total_count,this.totalPage=e.meta.total_pages;const t=e.data.list?.map((e=>({...e,full_name:this.deleteEnterpriseLevel(e.full_name)})))||[];this.tableData=t,this.keywords&&["project_types","languages","top_groups"].forEach((t=>{const a=this.searchArray.findIndex((e=>e.value===t)),s=[];e.data[t]?.forEach((e=>{s.push({...e,active:e.identity===this.params[this.searchArray[a].paramsKey]})})),this.$set(this.searchArray[a],"children",s),this.$set(this.searchArray[a],"defaultChildren",s)})),1===this.page&&window.eventHub.$emit(this.EVENT_HUB_NAME.SEARCH_WORD)})).finally((()=>{this.loading=!1}))},hasMore(){return this.page<this.totalPage},handleFavorite(e){const t=this.tableData.find((t=>t.id===e.id));t&&Object.assign(t,e)},changeSize(e,t){this.per_page=e,t||this.getProjectList()},changeCurrent(e){this.page=e,this.getProjectList()},getSizeDependencies:e=>[e.descHtml],handleDependencChange(e,t){const a=this.tableData.findIndex((t=>t.id===e.id));a>-1&&this.$set(this.tableData[a],"descHtml",t)}}},p=(0,h.Z)(d,i,[],!1,null,null,null).exports;var u=function(){var e=this,t=e.$createElement;return(e._self._c||t)("CommonSearch",{attrs:{keywords:e.keywords,"total-count":e.totalCount,"spend-time":e.spendTime,"search-array":e.searchArray,"item-component":e.itemComponent,"table-data":e.tableData,loading:e.loading,"load-end":!0,params:e.params,page:e.page,pagination:e.pagination},on:{search:e.handleSearch,action:e.handleRowAction}})};u._withStripped=!0;var m=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"issue_info_wrap mb-2"},[a("router-link",{staticClass:"project_name fs-12 fw-500",attrs:{target:"_blank",to:{name:"project#code",params:{0:e.rowData.project.full_path}}}},[a("el-tooltip",{attrs:{"show-overflow-tooltip":"",content:e.displayFullPath}},[a("div",{staticClass:"truncate"},[e._v(e._s(e.displayFullPath))])])],1),e._v(" "),a("div",{staticClass:"issue_info_top"},[a("IssueStateIcon",{staticClass:"issue_state",attrs:{size:14,state:e.rowData.state}}),e._v(" "),a("router-link",{staticClass:"issue_title",attrs:{target:"_blank",to:{name:"project#issues#detail",params:e.issueDetailParams}}},[a("el-tooltip",{attrs:{"show-overflow-tooltip":""}},[a("div",{attrs:{slot:"content"},domProps:{innerHTML:e._s(e.rowData.highlight_title)},slot:"content"}),e._v(" "),a("div",{staticClass:"issue_title_content",domProps:{innerHTML:e._s(e.rowData.highlight_title)}})])],1)],1),e._v(" "),e.descHtml?a("div",{staticClass:"issue_desc",domProps:{innerHTML:e._s(e.descHtml)}}):e._e(),e._v(" "),a("div",{staticClass:"issue_info_bottom text-muted fs-12"},[e.rowData.author?a("span",{staticClass:"issue_bottom_item"},[a("Avatar",{attrs:{url:e.rowData.author.avatar_url,name:e.rowData.author.name,"show-name":!0}}),e._v(" "),a("span",{staticClass:"ml-1 mr-1"},[e._v("·")])],1):e._e(),e._v(" "),a("span",[a("i",{staticClass:"iconfont-new icon-comment"}),e._v("\n "+e._s(e.rowData.noteable_count||0)+"\n "),a("span",{staticClass:"ml-1 mr-1"},[e._v("·")])]),e._v(" "),e.rowData.created_at?a("span",{staticClass:"issue_create_time"},[e._v("\n "+e._s(e.$t("pulls.created_at"))+"\n "),a("timeago",{attrs:{tooltip:"",since:e.rowData.created_at}}),e._v(" "),a("span",{staticClass:"ml-1 mr-1"},[e._v("·")])],1):e._e(),e._v(" "),a("span",[e._v("\n "+e._s("#"+e.rowData.ident)+"\n ")])])],1)};m._withStripped=!0;const g={name:"IssueItem",props:{rowData:{type:Object}},data:()=>({descHtml:""}),computed:{issueDetailParams(){return{...this.params0,0:this.rowData.project.full_path,issue_ident:this.rowData.ident}},showCollaborators(){return this.rowData.collaborators.slice(0,3)},moreCollaborators(){return this.rowData.collaborators.slice(3)},displayFullPath(){return this.deleteEnterpriseLevel(this.rowData.project.full_path)}},created(){this.getIssueDesc()},methods:{getIssueDesc(){this.descHtml=Array.isArray(this.rowData.description)?this.rowData.description.join("..."):res,this.$emit("dependenc-change",this.rowData,this.descHtml)}}},_=(0,h.Z)(g,m,[],!1,null,"ce460ff0",null).exports,f={name:"SearchIssues",components:{CommonSearch:c},mixins:[n.Z],props:{keywords:{type:String,default:""}},data(){return{page:1,per_page:20,totalCount:0,totalPage:0,tableData:[],spendTime:0,itemComponent:_,searchArray:[{name:this.$t("repo"),value:"projects",paramsKey:"project_id",showOverflowTooltip:!0,children:[],defaultChildren:[]}],params:{project_id:""},loading:!1}},computed:{pagination(){return{page:this.page,per_page:this.per_page,count:this.totalCount,layout:"prev, adaption, next, sizes"}}},methods:{handleSearch(e){this.assignParams(e,this.searchArray),this.tableData=[],this.page=1,this.getIssueList()},getIssueList(){this.loading=!0,this.api.dashboard.getIssues({params:{page:this.page,per_page:this.per_page,keyword:this.keywords,...this.params},noCancel:!0}).then((({data:e})=>{this.spendTime=e.data.total_time,this.totalCount=e.meta.total_count,this.totalPage=e.meta.total_pages;const t=e.data.list?.map((e=>({...e,project:{...e.project,full_name:this.deleteEnterpriseLevel(e.project.full_name)}})))||[];if(this.tableData=t,this.keywords){const t=[];e.data.projects?.forEach((e=>{t.push({...e,active:e.identity===this.params.project_id})})),this.$set(this.searchArray[0],"children",t),this.$set(this.searchArray[0],"defaultChildren",t)}1===this.page&&window.eventHub.$emit(this.EVENT_HUB_NAME.SEARCH_WORD)})).finally((()=>{this.loading=!1}))},hasMore(){return this.page<this.totalPage},changeSize(e,t){this.per_page=e,t||this.getIssueList()},changeCurrent(e){this.page=e,this.getIssueList()},getSizeDependencies:e=>[e.descHtml],handleDependencChange(e,t){const a=this.tableData.findIndex((t=>t.ident===e.ident));a>-1&&this.$set(this.tableData[a],"descHtml",t)}}},w=(0,h.Z)(f,u,[],!1,null,null,null).exports;var v=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("CommonSearch",{ref:"commonSearch",attrs:{type:"code",keywords:e.keywords,"total-count":e.totalCount,"spend-time":e.spendTime,"search-array":e.searchArray,"search-array-loading":e.searchArrayLoading,"item-component":e.itemComponent,"table-data":e.tableData,loading:e.loading,"load-end":e.loadEnd,"more-loading":e.moreLoading,"repo-search-word":e.repoSearchWord,params:e.params,page:e.page,"min-item-size":22,"dynamic-scroll":!0,"key-field":"key"},on:{"update:repoSearchWord":function(t){e.repoSearchWord=t},"update:repo-search-word":function(t){e.repoSearchWord=t},search:e.handleSearch,action:e.handleRowAction},scopedSlots:e._u([{key:"searchResult",fn:function(){return[a("div",{staticClass:"code_search_summary"},[a("CodeSearchNumChange",{attrs:{"total-count":e.totalCount,changedNumChecked:e.changedNumChecked,changedNum:e.changedNum},on:{changeNum:e.handleChangeNumClick}}),e._v(" "),e.showExport?a("CodeExportList",{attrs:{keywords:e.keywords}}):e._e()],1)]},proxy:!0}])})};v._withStripped=!0;var y=function(){var e=this,t=e.$createElement,a=e._self._c||t;return"file-header"===e.rowData.type?a("div",{staticClass:"code-location",class:{"border-radius-8":!e.rowData.visible||e.rowData.noContent}},[a("span",{staticClass:"location_left truncate"},[a("i",{staticClass:"iconfont-new toggle-icon cursor-pointer",class:[e.rowData.visible?"icondown":"iconright"],on:{click:e.handleToggle}}),e._v(" "),e.rowData.contentLoading?a("i",{staticClass:"el-icon-loading"}):e._e(),e._v(" "),e.isProjectPage?e._e():[a("ProjectListItemImg",{staticClass:"project_img",attrs:{"font-size":14,size:24,"row-data":e.repoAvatarData}}),e._v(" "),a("el-tooltip",{attrs:{"show-overflow-tooltip":"",content:e.rowData.data.project.full_name}},[a("router-link",{staticClass:"repo_name link-dark",attrs:{target:"_blank",to:{name:"project#code",params:{0:e.rowData.data.project.full_path}}}},[e._v("\n "+e._s(e.deleteEnterpriseLevel(e.rowData.data.project.full_path))+"\n ")])],1),e._v(" "),a("span",{staticClass:"ml-half mr-half"},[e._v("·")])],e._v(" "),a("router-link",{staticClass:"file_name text-black truncate",attrs:{target:e.target,to:{name:"project#blob",params:Object.assign({},{branch:e.branch},e.params)}},nativeOn:{click:function(t){return e.resetSearchKeyword.apply(null,arguments)}}},[a("el-tooltip",{attrs:{"show-overflow-tooltip":""}},[a("div",{attrs:{slot:"content"},domProps:{innerHTML:e._s(e.rowData.data.html_content)},slot:"content"}),e._v(" "),a("div",{staticClass:"file_name_content",domProps:{innerHTML:e._s(e.rowData.data.html_content)}})])],1)],2),e._v(" "),a("span",{staticClass:"location_right"},[e.rowData.data.language?[a("LanguageColorDot",{attrs:{name:e.rowData.data.language}}),e._v(" "),a("span",{staticClass:"ml-1 mr-1"},[e._v("·")])]:e._e(),e._v(" "),a("el-popover",{attrs:{width:"100",trigger:"hover","popper-class":"branch-popover",placement:"bottom-end","append-to-body":!0,"close-delay":300,disabled:e.rowData.data.branches.length<=1}},[a("ul",{staticClass:"location_branches"},e._l(e.rowData.data.branches,(function(t){return a("li",{key:t},[a("router-link",{attrs:{target:"_blank",to:{name:"project#blob",params:Object.assign({},{branch:t},e.params)}}},[a("el-tooltip",{staticClass:"branch_item",attrs:{effect:"dark",content:t,"show-overflow-tooltip":""}},[a("div",{staticClass:"item"},[a("i",{staticClass:"iconfont-new iconbranch"}),e._v("\n "+e._s(t)+"\n ")])])],1)],1)})),0),e._v(" "),a("router-link",{staticClass:"branch_name",attrs:{slot:"reference",target:"_blank",to:{name:"project#blob",params:Object.assign({},{branch:e.branch},e.params)}},slot:"reference"},[a("el-tooltip",{attrs:{content:e.branch,"show-overflow-tooltip":""}},[a("span",[a("i",{staticClass:"iconfont-new iconbranch"}),e._v("\n "+e._s(e.branch)+"\n ")])])],1)],1)],2)]):"code-line"===e.rowData.type?a("div",{staticClass:"code-content",class:{"is-last":e.rowData.data.isLast}},[a("code",{staticClass:"line-number"},[e._v(e._s(e.rowData.data.line.line_num))]),e._v(" "),a("pre",{staticClass:"line-content"},[a("code",{domProps:{innerHTML:e._s(e.rowData.data.html_content)}})])]):"toggle-line"===e.rowData.type?a("div",{staticClass:"expand-more",on:{click:e.handleShowMore}},[a("i",{staticClass:"iconfont-new font14 mr-2",class:[e.rowData.showMore?"icondoubletop-top":"icondouble-bottom"]}),e._v("\n "+e._s(e.showMoreBtnText)+"\n")]):"abnormal-file"===e.rowData.type&&e.contentMessage.text&&!e.rowData.showMore?a("div",{staticClass:"file_no_show"},[a("p",[e._v(e._s(e.contentMessage.text))]),e._v(" "),e.isMarkDownTooBig?[e._v("\n "+e._s(e.$t("code.click"))+"\n "),a("strong",{staticClass:"blue_text",on:{click:e.handleLoadBigMarkDown}},[e._v(e._s(e.$t("code.continue_loading")))]),e._v("\n "+e._s(e.$t("code.or"))+"\n ")]:e._e(),e._v(" "),e.contentMessage.showDownload?a("a",{staticClass:"download",attrs:{href:e.contentMessage.href,target:e.contentMessage.target,download:e.fileContent.path},on:{click:e.downloadLFSFile}},[a("strong",[e._v(e._s(e.$t("download"))+" ("+e._s(e._f("fileSize")(e.contentMessage.size))+")")])]):e._e()],2):"empty-line"===e.rowData.type?a("div",{staticStyle:{height:"16px"}}):e._e()};y._withStripped=!0;const C={name:"CodeItem",filters:{fileSize:window.GITEE.tools.fileSizeFilter},components:{LanguageColorDot:window.comps.LanguageColorDot},props:{rowData:{type:Object}},data:()=>({showMoreCount:15}),computed:{branch(){return this.rowData.data.branches[0]},fileContent(){return this.rowData.data.fileContent||{}},target:()=>window.GITEE.tools.inProjectPage()?"_self":"_blank",rowMatches(){return this.rowData.contents?.filter((e=>0!==e.line_num))},showRowMatches(){return this.rowData.showMore?this.rowMatches:this.rowMatches.slice(0,this.showMoreCount)},repoName(){const e=this.rowData.data.project.full_name.split("/");return e[e.length-1]},params(){return window.GITEE.tools.inOneProgramPage()?{...this.params0,0:this.rowData.data.file_path}:{...this.params0,0:this.rowData.data.project.full_path,1:this.rowData.data.file_path}},showMoreBtnText(){return this.rowData.showMore?this.$t("code.code_search.collapse_all"):this.$t("code.code_search.expand_all")},repoAvatarData(){return{icon_url:this.rowData.data.project.icon_url,icon_color:this.rowData.data.project.icon_color,name:this.repoName}},isMarkDownTooBig(){return this.fileContent&&this.fileContent.is_markdown&&this.fileContent.size>102400&&this.fileContent.size<=1048576},tooBigText(){return this.fileContent&&this.fileContent.too_big_text},fileRawPathDownload(){return`${GITEE.api.API_GO_BASEURL}/api/${this.rowData.data.full_path}/-/${encodeURIComponent(this.rowData.data.branch)}/blobs/display?path=${encodeURIComponent(this.fileContent.path)}&is_download=1`},contentMessage(){const e=this.fileContent;if(!e)return{};let t="",a=!1,s=e.size,i=this.fileRawPathDownload,o="_blank";return e.is_lfs_file?void 0!==e.file_type&&(t=this.$t("code.new.preview_file_not_supported"),a=!0,s=e.lfs_size,i="javascript:void(0)",o=null):"text"===e.file_type?e.empty_text?t=this.$t("code.new.empty_file"):this.isMarkDownTooBig?(t=this.$t("code.too_big_md_tips"),a=!0):this.tooBigText&&(t=this.$t("code.new.more_file_not_supported"),a=!0):(t=this.$t("code.new.preview_file_not_supported"),"image"!==e.file_type&&(a=!0)),{text:t,size:s,href:i,showDownload:a,target:o}}},methods:{handleShowMore(){this.$emit("action","handleShowMore",this.rowData,!this.rowData.showMore)},handleToggle(){this.$emit("action","handleToggle",this.rowData,!this.rowData.visible),this.$emit("dependenc-change",this.rowData,this.rowData.showMore)},resetSearchKeyword(){this.isProjectPage&&window.eventHub.$emit(this.EVENT_HUB_NAME.RESET_SEARCH_KEYWORD)},downloadLFSFile(){this.fileContent&&this.fileContent.is_lfs_file&&void 0!==this.fileContent.file_type&&window.$http.get(`${GITEE.api.API_GO_BASEURL}/api/${this.rowData.data.full_path}/-/lfs_files/${this.fileContent.lfs_oid}/download`,{params:{filename:this.fileContent.name}}).then((({data:e})=>{e.download_path&&window.open(e.download_path,"_blank")}))},handleLoadBigMarkDown(){this.$emit("action","handleShowMore",this.rowData,!this.rowData.showMore)}}},b=(0,h.Z)(C,y,[],!1,null,"366c0704",null).exports;var S=function(){var e=this,t=e.$createElement;return(e._self._c||t)("router-link",{staticClass:"repo_name link-dark",attrs:{to:{name:"project#search",params:{0:e.full_path}},target:"_blank"}},[e._v("\n "+e._s(e.$t("dashboard.no_search_branch"))+"\n")])};S._withStripped=!0;const D={name:"LinkToRepoSearch",props:{full_path:String}},$=(0,h.Z)(D,S,[],!1,null,null,null).exports;var k=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("GiteePopover",{attrs:{trigger:"click",placement:"bottom-end","hide-on-click-reference-outside":!1,appendToBody:!1,"popper-class":"result_summary",border:"",width:"500"},on:{show:e.handleShow,hide:e.handleHide}},[a("div",{staticClass:"code_search_summary_popover",attrs:{slot:"popover"},slot:"popover"},[a("div",{staticClass:"export_header"},[a("div",{staticClass:"popover_header_title"},[e._v(e._s(e.$t("search.export_result")))]),e._v(" "),a("ElButton",{attrs:{type:"osc",size:"small"},on:{click:e.handleExport}},[e._v(e._s(e.$t("conflict_logs.export")))])],1),e._v(" "),a("CommonList",{attrs:{"table-data":e.exportList,columns:e.columns,loading:e.loading,pagination:{count:e.totalCount,page:e.page,per_page:e.perPage,layout:"prev, pager, next"},disableMinHeight:""},on:{changeSize:function(t){return e.changeSize(t)},changeCurrent:e.changeCurrent}})],1),e._v(" "),a("div",{attrs:{slot:"reference"},slot:"reference"},[a("div",{staticClass:"popover_reference_header"},[e._v(e._s(e.$t("conflict_logs.export")))]),e._v(" "),a("div",{staticClass:"popover_reference_desc"},[e._v(e._s(e.$t("search.export_desc")))])])])};k._withStripped=!0;const E={name:"CodeExportList",components:{GiteePopover:window.comps.GiteePopover},props:{keywords:{type:String,default:""},isCaseSensitive:{type:Boolean,default:!1},isStrictMatch:{type:Boolean,default:!1}},data:()=>({exportList:[],loading:!1,totalCount:0,page:1,perPage:5,timer:null,source:null}),computed:{columns(){return[{label:this.$t("search.file_name"),prop:"file_name",showOverflowTooltip:!0},{label:this.$t("company_settings.custom_statistics.generated_state"),width:"90",component:{props:["rowData"],computed:{iconClass(){return["iconfont-new",this.rowData.status?"iconcheck-circle-fill icon-check":"iconrunning scan-simple-icon"]}},template:'<i v-if="rowData.url" :class="iconClass" />'}},{label:this.$t("action"),width:"100",component:{props:["rowData"],template:'\n <i v-if="rowData.url" i class="iconfont-new icondownload cursor-pointer" @click="download" />\n ',methods:{download(){window.open(`/api/code${this.rowData.url}&filename=${this.rowData.file_name}`,"_blank")}}}}]}},methods:{handleShow(){this.page=1,this.fetchData()},changeSize(e){this.perPage=e,this.page=1,this.fetchData()},changeCurrent(e){this.page=e,this.fetchData()},async fetchData(){this.stopGetStatus(),this.loading=!0;try{const e=(await this.api.dashboard.getCodeSearchExportList({page:this.page,per_page:this.perPage})).data;this.exportList=e.data,this.totalCount=e.meta.total_count,this.getRunningStatus()}catch(e){console.error("Error fetching data:",e)}finally{this.loading=!1}},handleExport(){this.api.dashboard.exportCodeSearch({keywords:[this.keywords],is_case_sensitive:this.isCaseSensitive,is_strict_match:this.isStrictMatch}).then((()=>{this.$message.success(this.$t("search.export_task_suc")),this.fetchData()}))},getRunningStatus(){this.source=window.GITEE.tools.$http.CancelToken.source();const e=this.exportList.filter((e=>!e.status)).map((e=>e.id));e.length&&this.api.dashboard.getCodeSearchExportStatus({ids:e},{cancelToken:this.source.token}).then((({data:e})=>{e&&e.length&&(this.exportList=this.exportList.map((t=>{const a=e.find((e=>e.id===t.id));return a?{...t,...a}:t})),this.exportList.filter((e=>!e.status)).length&&(this.timer=setTimeout((()=>{this.getRunningStatus()}),5e3)))}))},stopGetStatus(){clearTimeout(this.timer),this.timer=null,this.source?.cancel()},handleHide(){this.stopGetStatus()}}},x=(0,h.Z)(E,k,[],!1,null,"6b21f248",null).exports;var j=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("GiteePopover",{attrs:{trigger:"click",placement:"bottom-start","hide-on-click-reference-outside":!1,appendToBody:!1,"popper-class":"result_summary",border:"",width:"360"}},[a("div",{staticClass:"code_search_summary_popover",attrs:{slot:"popover"},slot:"popover"},[a("div",{staticClass:"popover_header_title"},[e._v(e._s(e.$t("search.search_again")))]),e._v(" "),a("ElCheckbox",{model:{value:e.numberChecked,callback:function(t){e.numberChecked=t},expression:"numberChecked"}},[e._v(e._s(e.$t("search.change_num_2_2000")))]),e._v(" "),a("div",{staticClass:"button_wrap"},[a("ElButton",{attrs:{type:"osc",size:"small"},on:{click:e.handleChangeNumClick}},[e._v(e._s(e.$t("query")))])],1)],1),e._v(" "),a("div",{attrs:{slot:"reference"},slot:"reference"},[a("div",{staticClass:"popover_reference_header"},[e._v(e._s(e.$t("search.search_result",{totalCount:e.totalCount})))]),e._v(" "),a("div",{staticClass:"popover_reference_desc"},[e.totalCount>=e.changedNumber?[e._v("\n "+e._s(e.$t("search.search_result_desc"))+"\n ")]:e._e(),e._v("\n "+e._s(e.$t("search.search_max_limit",{changedNum:e.changedNumber}))+"\n ")],2)])])};j._withStripped=!0;const I={name:"CodeSearchNumChange",components:{GiteePopover:window.comps.GiteePopover},props:{totalCount:{type:Number,default:0},changedNumChecked:{type:Boolean,default:!1},changedNum:{type:Number,default:null}},data:()=>({numberChecked:!1}),computed:{changedNumber(){return this.changedNumChecked?this.changedNum:1e3}},watch:{changedNumChecked:{immediate:!0,handler(e){this.numberChecked=e}}},methods:{handleChangeNumClick(e){this.$emit("changeNum",{changedNumChecked:this.numberChecked,num:this.numberChecked?2e3:null})}}},T=(0,h.Z)(I,j,[],!1,null,"351aabe4",null).exports;let L=0;const A={name:"SearchCode",components:{CommonSearch:c,CodeExportList:x,CodeSearchNumChange:T},mixins:[n.Z],props:{keywords:{type:String,default:""}},data:()=>({totalCount:0,originTotalCount:0,fullData:[],hiddenFiles:[],toggledFiles:[],spendTime:0,itemComponent:b,page:1,per_page:20,loading:!1,timer:null,searchLanguages:[],searchProjects:[],repoSearchWord:"",params:{project_ids:"",languages:"",branches:"",path:""},evtSource:null,evtSourceEvents:{filters:"getFilters",progress:"getProgress",matches:"getMatches",done:"closeEventSource",error:"closeEventSource"},searchArray:[],searchArrayLoading:!1,loadEnd:!1,fullBranch:{},dbRequest:null,db:null,initGetData:!0,search_limit:1e4,changedNumChecked:!1,changedNum:null}),computed:{showExport:()=>!0,tableData(){return this.fullData.filter((e=>{const t=!this.params.languages||e.data.language===this.params.languages,a=!this.params.project_ids?.length||this.params.project_ids.includes(e.data.projectId);let s=!0;"code-line"===e.type&&(this.hiddenFiles.includes(e.fileKey)&&(s=!1),this.toggledFiles.includes(e.fileKey)&&(this.fileIsMdTooBig(e.data.fileContent)||e.data.toggleIndex>14)&&(s=!1));const i="toggle-line"!==e.type||!this.hiddenFiles.includes(e.fileKey),o="abnormal-file"!==e.type||!this.hiddenFiles.includes(e.fileKey);return t&&a&&s&&i&&o}))},isGlobalSearch(){return"company#search"===this.$route.name},projectsData(){return this.searchProjects?.filter((e=>e.name.indexOf(this.repoSearchWord)>-1)).slice(0,20)},scrollWrapperDom(){const e=this.isGlobalSearch?".ent-resource-body":".ent-project-bread .tree-holder";return document.querySelector(`.code-app ${e}`)},isEnd(){return this.totalCount<=this.tableData.length},moreLoading(){return this.loading&&this.page>1}},watch:{keywords(){this.searchArrayInit()}},created(){this.searchArrayInit()},beforeDestroy(){this.closeEventSource()},methods:{searchArrayInit(){this.searchArray=this.isGlobalSearch?[{name:this.$t("common.language"),value:"languages",paramsKey:"languages",children:[],defaultChildren:[],filterChildren:[],childrenScroller:!0,childrenSlice:20,showOverflowTooltip:!0,transfer:e=>({...e,identity:e.name}),hasMore:!1,handleShowMore:this.handleShowMoreSearchItem,hasNumLoading:!0,filter:!0,filterWord:"",handleInput:this.handleFilterSearchItem,filterPlaceholder:this.$t_join("please_enter","language"),sort_by:"num"},{name:this.$t("code_repo"),value:"projects",paramsKey:"project_ids",multiple:!0,children:[],childrenScroller:!0,itemSize:41,defaultChildren:[],filterChildren:[],childrenSlice:20,showOverflowTooltip:!1,transfer:e=>{const t=e.full_name.split("/"),a=t[t.length-1],s=e.full_path.split("/"),i=s[s.length-1];return{...e,name:a,path:i,tooltipName:e.full_name,identity:e.id}},hasMore:!1,handleShowMore:this.handleShowMoreSearchItem,filter:!0,filterWord:"",handleInput:this.handleFilterSearchRepoItem,filterPlaceholder:this.$t("groups.search_tree_placeholder")},{name:"分支",value:"branches",paramsKey:"branches",multiple:!0,filter:!0,children:[],childrenScroller:!0,itemSize:41,defaultChildren:[],filterChildren:[],childrenSlice:20,showOverflowTooltip:!1,filterPlaceholder:"请输入分支",listBottomComp:()=>{if(1===this.params.project_ids.length){const e=this.searchArray.findIndex((e=>"projects"===e.value)),t=this.searchArray[e].children.find((e=>e.id===this.params.project_ids[0]));return{components:{LinkToRepoSearch:$},template:`<LinkToRepoSearch :full_path="'${t.full_path}'" />`}}return null},handleShowMore:this.handleShowMoreSearchItem,filterWord:"",handleInput:this.handleFilterSearchItem},{name:"路径",value:"path",paramsKey:"path",filter:!0,onlyInput:!0,visible:!1,children:[],filterWord:"",handleInput:this.handleInputPath,filterPlaceholder:"请输入路径"}]:[]},updateSearchItem(e,t=!1){t?this.$set(e,"children",e.filterChildren.slice(0,e.childrenSlice)):this.$set(e,"children",e.children.concat(e.filterChildren.slice(e.children.length,e.children.length+e.childrenSlice))),this.$set(e,"hasMore",e.filterChildren.length>e.children.length)},handleFilterSearchItem:window.GITEE.tools.debounce((function(e,t){this.$set(t,"filterChildren",e?t.defaultChildren.filter((t=>t.name.toUpperCase().indexOf(e.toUpperCase())>-1)):t.defaultChildren.slice(0)),this.updateSearchItem(t,!0)}),100),handleFilterSearchRepoItem:window.GITEE.tools.debounce((function(e,t){this.$set(t,"filterChildren",e?t.defaultChildren.filter((t=>t.name.toUpperCase().indexOf(e.toUpperCase())>-1||t.path.toUpperCase().indexOf(e.toUpperCase())>-1)):t.defaultChildren.slice(0)),this.updateSearchItem(t,!0)}),100),handleInputPath(e,t){this.params.path=e,this.handleSearch(this.params,t)},handleShowMoreSearchItem(e){this.updateSearchItem(e)},handleSearch(e,t){if(e){if("projects"===t.value){e.branches="";let t=[];e.project_ids&&e.project_ids.forEach((e=>{t.push(...this.fullBranch[e])})),t=[...new Set(t)].sort().map((e=>({name:e.replace("heads/",""),active:!1,identity:e})));const a=this.searchArray.findIndex((e=>"branches"===e.value));this.$set(this.searchArray,a,{...this.searchArray[a],filterWord:"",defaultChildren:t,filterChildren:t}),this.updateSearchItem(this.searchArray[a],!0)}if(["projects","branches"].includes(t.value)){e.path="";const t=this.searchArray.findIndex((e=>"path"===e.value));this.$set(this.searchArray,t,{...this.searchArray[t],visible:e.branches&&e.branches.length,filterWord:""})}}this.db?(this.assignParams(e,this.searchArray),this.resetCodeList(e)):this.initIndexDb((()=>{this.assignParams(e,this.searchArray),this.resetCodeList()}))},resetCodeList(e){L=0,this.fullData=[],this.toggledFiles=[],this.totalCount=0,this.page=1,e?this.getData():(this.initGetData=!0,this.getSearchLimitNum(),this.getCodeList())},closeEventSource(){this.loading&&(this.loading=!1),this.loadEnd||(this.loadEnd=!0),this.searchArrayLoading&&(this.searchArrayLoading=!1),this.evtSource&&(this.evtSource.close(),Object.keys(this.evtSourceEvents).forEach((e=>{this.evtSource.removeEventListener(e,this[this.evtSourceEvents[e]])})),this.evtSource=null)},getFilters(e){if(this.params.languages||this.params.project_ids)return;this.searchArrayLoading=!1;const t=JSON.parse(e.data);this.searchArray.map((e=>e.value)).forEach(((e,a)=>{const s=this.searchArray[a],i=t[e]?.map((e=>s.transfer(e)))||[];s.hasOwnProperty("sort_by")&&s.sort_by&&i.sort(((e,t)=>t[s.sort_by]-e[s.sort_by])),this.$set(s,"defaultChildren",i),this.$set(s,"filterChildren",i),this.updateSearchItem(s,!0)}))},getProgress(e){const t=JSON.parse(e.data);this.spendTime=t.elapsedTime,this.totalCount=t.totalRecords,this.originTotalCount=t.totalRecords},getMatches(e){this.loading&&(this.loading=!1);const t=JSON.parse(e.data);this.$nextTick((()=>{const e=t.data;e.forEach((e=>{this.fullBranch[e.project.id]?e.branches.forEach((t=>this.fullBranch[e.project.id].add(t))):this.fullBranch[e.project.id]=new Set(e.branches)})),this.addData(e).then((()=>{if(this.initGetData)this.initGetData=!1,this.getData();else{const e=this.$refs.commonSearch?.$refs.dynamicScroller?.$el;e&&0===e.scrollTop&&e.scrollHeight===e.clientHeight&&this.loadMore()}}))}))},async getCodeList(){this.clearData((()=>{this.closeEventSource(),this.loading=!0,this.loadEnd=!1,this.params.languages||this.params.project_ids||(this.searchArrayLoading=!0);const e=new URLSearchParams({keywords:this.keywords,start_line:1,end_line:40,num:this.search_limit,is_case_sensitive:this.$route.query.case||!1,is_strict_match:void 0===this.$route.query.strict||this.$route.query.strict,...this.params}).toString();this.evtSource=new EventSource(`/api/search/enterprises/${window.gon.info.enterprise_uuid}/code/stream?${e}`),Object.keys(this.evtSourceEvents).forEach((e=>{this.evtSource.addEventListener(e,this[this.evtSourceEvents[e]])}))}))},transferFileMatchs(e){if(!e)return[];const t=[];return e.forEach((e=>{const{project:a,file_path:s,file_name:i,contents:o,language:r,branches:n,matches:l,index:h,fileContent:c}=e,d=`${a.full_path}-${s}-${Math.random().toString().slice(-10)}`,p=o?.filter((e=>0===e.line_num))||[],u=o?.filter((e=>0!==e.line_num))||[],m={key:`${d}-file-header`,fileKey:d,type:"file-header",visible:u.length>0,contentLoading:!1,noContent:0===u.length,data:{index:h,project:a,projectId:a.id,file_path:s,file_name:i,language:r,branches:n,html_content:p.length?this.transferLineContent(p[0],e.matches):e.file_path,matches:l}};t.push(m),c&&(!c||"text"!==c.file_type||c.is_lfs_file||c.too_big_text||c.empty_text)||!u.length?c&&t.push({key:`${d}-abnormal-file`,fileKey:d,type:"abnormal-file",data:{language:r,projectId:a.id,toggleIndex:1,isLast:!0,line:{content:"",line_num:1},full_path:a.full_path,fileContent:c,branch:n[0],file:`${a.full_path}-${s}`,html_content:""}}):(u.forEach(((e,i)=>{t.push({key:`${d}-${e.line_num}`,fileKey:d,type:"code-line",data:{language:r,projectId:a.id,toggleIndex:i,isLast:i===u.length-1,line:e,file:`${a.full_path}-${s}`,fileContent:c,html_content:this.transferLineContent(e,l)}})})),this.fileIsMdTooBig(c)?(t.push({key:`${d}-abnormal-file`,fileKey:d,type:"abnormal-file",data:{language:r,projectId:a.id,toggleIndex:1,isLast:!0,line:{content:"",line_num:1},branch:n[0],full_path:a.full_path,fileContent:c,file:`${a.full_path}-${s}`,html_content:""}}),this.toggledFiles.push(d)):u.length>15&&(this.toggledFiles.push(d),t.push({key:`${d}-toggle-line`,fileKey:d,type:"toggle-line",showMore:!1,data:{language:r,projectId:a.id}}))),t.push({key:`${d}-empty-line`,type:"empty-line",index:h,data:{language:r,projectId:a.id}})})),t},transferLineContent(e,t){const{content:a="",line_num:s}=e;if(!t||!t.length||!t.some((e=>e.line_num===s)))return window.GITEE.tools.escapeHtml(a);const i=Boolean(this.$route.query.case),o=[...new Set(t.map((e=>i?e.match:e.match.toLowerCase())))],r=o.map((e=>this.escapeRegExp(e))).join("|");return a.slice(0,500).split(new RegExp(`(${r})`,"g"+(i?"":"i"))).map((e=>o.includes(i?e:e.toLowerCase())?`<em class="highlight">${window.GITEE.tools.escapeHtml(e)}</em>`:window.GITEE.tools.escapeHtml(e))).join("")},escapeRegExp:e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),handleShowMore(e,t){this.updateTableData(e,"showMore",t),t?this.toggledFiles=this.toggledFiles.filter((t=>t!==e.fileKey)):this.toggledFiles.push(e.fileKey)},fileIsMdTooBig:e=>e&&e.is_markdown&&e.size>102400&&e.size<=1048576,handleToggle(e,t){if(this.updateTableData(e,"visible",t),t?this.hiddenFiles=this.hiddenFiles.filter((t=>t!==e.fileKey)):this.hiddenFiles.push(e.fileKey),e.noContent&&!e.contentLoading){this.updateTableData(e,"contentLoading",!0);const t=decodeURIComponent(e.data.branches[0]),a=e.data.project.full_path;window.$http.get(`${GITEE.api.API_GO_BASEURL}/api/${a}/-/${encodeURIComponent(t)}/blobs`,{params:{path:e.data.file_path},noCancel:!0}).then((t=>{const{branches:a,file_name:s,file_path:i,matches:o,language:r,project:n,index:l}=e.data,h=[{content:i,line_num:0}];"text"!==t.data.file_type||t.data.is_lfs_file||t.data.too_big_text||t.data.raw_content.split("\n").forEach(((e,t)=>{h.push({content:e,line_num:t+1})})),1===h.length&&h.push({content:"",line_num:""});const c={branches:[...a],contents:[...h],file_name:s,file_path:i,index:l,language:r,fileContent:t.data,matches:[...o],project:{...n}};this.updateData(c);const d=this.transferFileMatchs([c]),p=this.fullData.findIndex((t=>t.key===`${e.fileKey}-file-header`));p>-1&&this.fullData.splice(p,2,...d)})).finally((()=>{this.updateTableData(e,"contentLoading",!1)}))}},updateTableData(e,t,a){const s=this.fullData.findIndex((t=>t.key===e.key));s>-1&&this.$set(this.fullData[s],t,a)},getData(e){this.loading=!0,this.getPaginatedData({index:e,per_page:this.per_page,...this.params}).then((({data:t,totalCount:a})=>{const{project_ids:s,branches:i,path:o,languages:r}=this.params,n=!s||!s.length,l=!i||!i.length,h=n&&l&&!r&&!o;this.fullData=[...this.fullData,...this.transferFileMatchs(t)],h?this.totalCount=this.originTotalCount:!e&&(this.totalCount=a),this.loading=!1}))},loadMore(){this.fullData.length&&this.fullData[this.fullData.length-1].index<this.totalCount&&(this.page++,this.getData(this.fullData[this.fullData.length-1].index))},initIndexDb(e){this.dbRequest=window.indexedDB.open("codeDB"),this.dbRequest.onsuccess=t=>this.dbRequestSuccess(t,e),this.dbRequest.onupgradeneeded=t=>this.dbRequestSuccess(t,e)},dbRequestSuccess(e,t){this.db=e.target.result,this.db.objectStoreNames.contains("searchCode")||this.db.createObjectStore("searchCode",{keyPath:"index",autoIncrement:!0}),t&&t()},addData(e){const t=L;return L+=e.length,new Promise(((a,s)=>{const i=this.db.transaction(["searchCode"],"readwrite"),o=i.objectStore("searchCode");e.forEach(((e,a)=>{const s=t+a+1;e.index=s,o.add(e).onerror=t=>{console.error("添加失败:",e,"原因:",t.target.error)}})),i.oncomplete=()=>a(),i.onerror=e=>{s(e.target.error)}}))},clearData(e,t){this.db||e();const a=this.db.transaction(["searchCode"],"readwrite").objectStore("searchCode").clear();a.onsuccess=function(t){e&&e(t)},a.onerror=function(e){t&&t(e)}},updateData(e){return new Promise(((t,a)=>{const s=this.db.transaction(["searchCode"],"readwrite").objectStore("searchCode").put(e);s.onsuccess=()=>{t()},s.onerror=e=>{a(e)}}))},getPaginatedData(e){return new Promise(((t,a)=>{const{project_ids:s,branches:i,path:o,languages:r,index:n,per_page:l}=e,h=this.db.transaction("searchCode","readonly").objectStore("searchCode");let c,d;n?(c=IDBKeyRange.lowerBound(n,!0),d=h.openCursor(c)):d=h.openCursor();const p=[];let u=0,m=0;d.onsuccess=e=>{const a=e.target.result,h=!s||!s.length,c=!i||!i.length,d=!r,g=!o,_=h&&c&&d&&g;if(!a)return void t({data:p,totalCount:m});const f=a.value,w=h||s.includes(f.project.id),v=c||i.some((e=>f.branches.includes(e))),y=d||f.language===r,C=g||f.file_path.indexOf(o)>-1;w&&v&&y&&C&&(m++,u++,u<=l?p.push(f):(n||_)&&t({data:p})),a.continue()},d.onerror=e=>{a(e.target.error)}}))},handleChangeNumClick({changedNumChecked:e,num:t}){this.changedNumChecked=e,this.changedNum=t,this.getSearchLimitNum(),this.resetCodeList()},getSearchLimitNum(){this.changedNumChecked?this.search_limit=this.changedNum:window.gon.feature_toggles_value&&window.gon.feature_toggles_value.search_limit&&(this.search_limit=window.gon.feature_toggles_value.search_limit)}}},N=(0,h.Z)(A,v,[],!1,null,"0032fe80",null).exports;var P=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"code-search__entry"},[a("div",{staticClass:"code-search__box"},[a("h2",{staticClass:"code-search__title"},[e._v("Gitee Search")]),e._v(" "),a("div",{staticClass:"code-search__input"},[a("el-input",{attrs:{clearable:"",placeholder:e.$t("common.search")},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:function(){return e.handleSearch()}.apply(null,arguments)}},model:{value:e.keywords,callback:function(t){e.keywords=t},expression:"keywords"}},[a("i",{staticClass:"iconfont-new iconsearch",attrs:{slot:"prepend"},slot:"prepend"})])],1)]),e._v(" "),a("img",{staticClass:"majiancang",attrs:{src:e.imageUrl,alt:"majiancang"}})])};P._withStripped=!0;const M=a.p+"images/65b33c117668fb44a1dfa5fc4fb93836.png";var R=a(3418);const z={name:"GlobalSearchEntry",data:()=>({keywords:"",imageUrl:M}),methods:{handleSearch(){this.$router.push({name:"company#search",query:{...this.$route.query,wd:this.keywords},params:(0,R.e)()})}}},H=(0,h.Z)(z,P,[],!1,null,"7a70b4e7",null).exports;var O=a(696),B=a(7376);const G={name:"GlobalSearchPage",components:{SearchProjects:p,SearchIssues:w,SearchCode:N,GlobalSearchEntry:H},data:()=>({keywords:"",tabArr:[{code:"project",component:p,init:!1},{code:"issue",component:w,init:!1},{code:"code",component:N,init:!1}],userTabConfigKey:"default_global_search_type"}),computed:{activeName(){return this.$store.getters["dashboard/getActiveTab"]},searchComponent(){return this.tabArr.find((e=>e.code===this.activeName))?.component},hasKeywords(){return this.$route.query.hasOwnProperty("wd")&&this.$route.query.wd}},watch:{$route:{immediate:!0,handler(){if(this.hasKeywords){if(!this.$route.query.hasOwnProperty("tab")||!this.$route.query.tab)return void this.$router.replace({query:{...this.$route.query,tab:"project"}});this.keywords=this.$route.query.wd,this.storeActiveName();const e=this.tabArr.find((e=>e.code===this.activeName));if(e.init)return;e.init=!0,this.handleSearch()}}},activeName(){this.hasKeywords&&this.$router.push({name:"company#search",query:{wd:this.keywords,tab:this.activeName,case:this.$route.query.case,strict:this.$route.query.strict},params:(0,R.e)()})}},created(){this.storeActiveName(),this.registerEventHubListener(B.I.REFRESH_SEARCH_CODE,this.handleSearch),this.registerEventHubListener(B.I.RESET_SEARCH_INIT,this.resetSearchInit)},methods:{resetSearchInit(){this.tabArr.forEach((e=>{e.init&&(e.init=!1)}))},storeActiveName(){this.$route.query.tab&&this.$store.commit("dashboard/setActiveTab",this.$route.query.tab)},handleMove(e,t,a){this.$set(this.tabArr[t],"showMove",a)},async handleSearch(){this.$nextTick((()=>{this.$refs[`${this.activeName}SearchComponent`].handleSearch()}))},handleTrigger(){(0,O.tm)()}}},K=(0,h.Z)(G,s,[],!1,null,"8426e210",null).exports}}]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
.vue-recycle-scroller{position:relative}.vue-recycle-scroller.direction-vertical:not(.page-mode){overflow-y:auto}.vue-recycle-scroller.direction-horizontal:not(.page-mode){overflow-x:auto}.vue-recycle-scroller.direction-horizontal{display:-webkit-box;display:-ms-flexbox;display:flex}.vue-recycle-scroller__slot{-webkit-box-flex:1;-ms-flex:auto 0 0px;flex:auto 0 0}.vue-recycle-scroller__item-wrapper{-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;position:relative}.vue-recycle-scroller.ready .vue-recycle-scroller__item-view{position:absolute;top:0;left:0;will-change:transform}.vue-recycle-scroller.direction-vertical .vue-recycle-scroller__item-wrapper{width:100%}.vue-recycle-scroller.direction-horizontal .vue-recycle-scroller__item-wrapper{height:100%}.vue-recycle-scroller.ready.direction-vertical .vue-recycle-scroller__item-view{width:100%}.vue-recycle-scroller.ready.direction-horizontal .vue-recycle-scroller__item-view{height:100%}.resize-observer[data-v-b329ee4c]{position:absolute;top:0;left:0;z-index:-1;width:100%;height:100%;border:none;background-color:transparent;pointer-events:none;display:block;overflow:hidden;opacity:0}.resize-observer[data-v-b329ee4c] object{display:block;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1}
|
|
2
|
+
.search_wrap[data-v-a0e7e130]{flex:1;display:flex;min-height:120px}.search_wrap .search_result_tab[data-v-a0e7e130]{width:260px;border-right:1px solid var(--gray-4);padding:0 20px;position:sticky;top:0;overflow-y:auto;height:100%}.search_wrap .search_result_tab .search_result_tab__sticky[data-v-a0e7e130]{padding-top:16px;padding-bottom:67px}.search_wrap .search_result_tab .search_result_tab_item[data-v-a0e7e130]{display:flex;align-items:center;justify-content:space-between;padding:8px 8px;border-radius:4px;cursor:pointer}.search_wrap .search_result_tab .search_result_tab_item i[data-v-a0e7e130]{margin-right:6px}.search_wrap .search_result_tab .search_result_tab_item .custom-round-number[data-v-a0e7e130]{background-color:var(--gray-4)}.search_wrap .search_result_tab .search_result_tab_item.active[data-v-a0e7e130]{background-color:var(--blue-2);color:var(--blue-6);position:relative}.search_wrap .search_result_tab .search_result_tab_item[data-v-a0e7e130]:hover{background-color:var(--gray-3)}.search_wrap .search_wrap_right[data-v-a0e7e130]{display:flex;flex-direction:column;flex:1;width:0;overflow:auto}.search_wrap .search_wrap_right.search_wrap_right_padding[data-v-a0e7e130]{padding:0 0 20px 20px}.search_wrap .search_wrap_extra[data-v-a0e7e130]{min-height:100px}.search_wrap .search_wrap_extra_item[data-v-a0e7e130]{border-top:1px solid var(--gray-4);padding-top:16px;margin-top:16px}.search_wrap .search_wrap_extra_item[data-v-a0e7e130] .el-select{width:100%}.search_wrap .search_wrap_extra_item[data-v-a0e7e130] .el-select .el-select-dropdown__item{width:100%;display:flex;align-items:baseline}.search_wrap .search_wrap_extra_item[data-v-a0e7e130] .el-select .el-select-dropdown__item .el-tooltip{width:0;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.search_wrap ul[data-v-a0e7e130]{margin:0;padding-left:0}.search_wrap .search_item[data-v-a0e7e130]{display:flex;justify-content:space-between;align-items:center;padding:8px 8px;border-radius:4px;cursor:pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:pointer}.search_wrap .search_item.active[data-v-a0e7e130]{background-color:var(--blue-2);color:var(--blue-6)}.search_wrap .search_item[data-v-a0e7e130]:hover{background-color:var(--gray-3)}.search_wrap .search_item .item_num[data-v-a0e7e130]{display:block;color:var(--gray-7);min-width:40px;text-align:right}.search_wrap .search_item .item_name[data-v-a0e7e130]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.search_wrap .search_item.disabled[data-v-a0e7e130]{cursor:unset}.search_wrap .search_item.disabled[data-v-a0e7e130]:hover{background-color:var(--gray-1)}.search_wrap .search_item.disabled .item_name[data-v-a0e7e130]{color:var(--blue-6)}.search_wrap .show-more[data-v-a0e7e130]{color:var(--blue-6);cursor:pointer;justify-content:center}.search_wrap .show-more[data-v-a0e7e130]:hover{color:var(--blue-7)}.search_summary[data-v-a0e7e130]{padding:16px 0}.search_summary .search_count[data-v-a0e7e130]{font-size:18px;font-weight:500}.search_result_list[data-v-a0e7e130]{flex:1;padding-right:20px}.result_item[data-v-a0e7e130]{min-height:22px}.result_item[data-v-a0e7e130] .el-divider--horizontal{margin:16px 0}.loading-text[data-v-a0e7e130]{color:var(--gray-7);text-align:center;padding:10px 0;white-space:pre}.search_scoll[data-v-a0e7e130]{max-height:250px;overflow-y:auto}
|
|
3
|
+
.issue_info_wrap[data-v-ce460ff0]{display:flex;flex-direction:column;gap:12px;border:1px solid var(--gray-4);border-radius:8px;padding:16px}[data-v-ce460ff0] .highlight{color:var(--red-7);font-style:normal;font-weight:700}.issue_info_top[data-v-ce460ff0]{display:flex;align-items:center;line-height:20px}.issue_title[data-v-ce460ff0]{flex:1;color:var(--gray-9);font-size:16px;font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.issue_title[data-v-ce460ff0]:hover{color:var(--blue-6)}.issue_title .issue_title_content[data-v-ce460ff0]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.issue_state[data-v-ce460ff0]{margin-right:5px}.issue_info_bottom[data-v-ce460ff0]{display:flex;align-items:center}.issue_desc[data-v-ce460ff0]{font-size:14px;line-height:20px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;line-clamp:2;-webkit-box-orient:vertical}.issue_bottom_item[data-v-ce460ff0]{display:flex;align-items:center}.issue_bottom_item[data-v-ce460ff0] .code-avatar{vertical-align:baseline}.issue_bottom_item_name[data-v-ce460ff0]{margin-right:3px}.project_name[data-v-ce460ff0]{color:var(--gray-9)}.project_name[data-v-ce460ff0]:hover{color:var(--blue-6)}.member_tag[data-v-ce460ff0]{margin-left:2px;background-color:var(--gray-4);font-size:12px;padding:0 4px;color:var(--gray-7);width:20px;height:20px;line-height:20px;border-radius:50%;text-align:center;cursor:pointer}.more_member[data-v-ce460ff0]{max-width:160px}
|
|
4
|
+
.branch-popover{padding:4px}
|
|
5
|
+
.code-location[data-v-366c0704]{position:sticky;min-height:22px;top:0;display:flex;justify-content:space-between;align-items:center;gap:20px;height:40px;background-color:var(--gray-3);border-radius:8px 8px 0 0;border:1px solid var(--gray-4);padding:0 22px}.code-location .location_left[data-v-366c0704]{flex:1}.code-location .location_left .toggle-icon[data-v-366c0704]{margin-right:12px}.code-location .location_left[data-v-366c0704] .project_img>div{margin-right:8px !important}.code-location .location_left .file_name[data-v-366c0704]{flex:1}.code-location .location_left .file_name .file_name_content[data-v-366c0704]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.code-location .iconfont-new[data-v-366c0704]{display:inline-block;margin-right:3px}.code-location .location_left[data-v-366c0704],.code-location .location_right[data-v-366c0704]{display:flex;align-items:center}.code-content[data-v-366c0704]{min-height:22px;overflow-x:auto;border-left:1px solid var(--gray-4);border-right:1px solid var(--gray-4);border-top:none;font-size:12px;line-height:20px;color:var(--gray-8);display:flex;align-items:center}.code-content .line-number[data-v-366c0704]{display:inline-block;width:60px;padding-right:12px;text-align:right}.code-content.is-last[data-v-366c0704]{border-bottom:1px solid var(--gray-4);border-bottom-left-radius:8px;border-bottom-right-radius:8px}.line-content[data-v-366c0704]{padding-left:16px;border-left:1px solid var(--gray-4);white-space:break-spaces;overflow:hidden;margin:0;width:calc(100% - 60px);min-height:22px}.expand-more[data-v-366c0704]{display:flex;align-items:center;height:40px;border-radius:0 0 8px 8px;padding:0 22px;cursor:pointer;border:1px solid var(--gray-4)}.code-meta[data-v-366c0704]{margin-top:8px}.link-dark[data-v-366c0704]{font-weight:bold;color:var(--gray-9)}.link-dark[data-v-366c0704]:hover{color:var(--blue-6)}.highlight[data-v-366c0704]{color:var(--gray-10);background-color:#ff0}.lang-label[data-v-366c0704]{background-color:var(--gray-4);font-size:12px;padding:0 6px;line-height:18px;border-radius:4px;color:var(--gray-7)}[data-v-366c0704] .highlight{color:var(--gray-10);background-color:#ff0;font-style:normal;font-weight:700}.repo_name[data-v-366c0704],.branch_name[data-v-366c0704]{cursor:pointer;color:var(--gray-9);display:block;max-width:400px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.location_branches[data-v-366c0704]{max-height:150px;overflow-y:scroll;padding-left:0;cursor:pointer}.branch_item[data-v-366c0704]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.border-radius-8[data-v-366c0704]{border-radius:8px}.file_no_show[data-v-366c0704]{width:100%;text-align:center;padding:16px;border:1px solid var(--gray-4);border-top:0}.file_no_show p[data-v-366c0704]{margin-bottom:0}.file_no_show .download[data-v-366c0704]{margin-top:12px}.el-icon-loading[data-v-366c0704]{margin-right:12px}.blue_text[data-v-366c0704]{color:var(--blue-7);cursor:pointer}
|
|
6
|
+
.export_header[data-v-6b21f248]{display:flex;justify-content:space-between;align-items:center}
|
|
7
|
+
.code_search_summary_popover .el-checkbox[data-v-351aabe4]{margin:5px 17px}.code_search_summary_popover .button_wrap[data-v-351aabe4]{display:flex;justify-content:flex-end}
|
|
8
|
+
.code_search_summary[data-v-0032fe80]{display:flex;justify-content:space-between;align-items:center;padding:5px 35px 5px 0}.code_search_summary[data-v-0032fe80] .reference{padding:0px 20px 5px;background:var(--gray-3)}.code_search_summary[data-v-0032fe80] .reference.visible{background:var(--gray-8)}.code_search_summary[data-v-0032fe80] .reference .popover_reference_header{font-weight:500;font-size:16px;line-height:32px}.code_search_summary[data-v-0032fe80] .reference .popover_reference_desc{line-height:24px}.code_search_summary[data-v-0032fe80] .popover_header_title{font-weight:600}.code_search_summary[data-v-0032fe80] .result_summary{padding:15px}
|
|
9
|
+
.code-search__entry[data-v-7a70b4e7]{min-height:100vh;min-width:320px;text-align:center;background:url(/api/plugin/static/images/583df19a86401f3bf2044c2033476fbe.jpg) no-repeat center center;background-size:cover}.code-search__entry .majiancang[data-v-7a70b4e7]{width:100%}.code-search__box[data-v-7a70b4e7]{padding-top:146px;overflow:hidden}.code-search__box .code-search__title[data-v-7a70b4e7]{font-family:Roboto;font-size:40px;font-weight:900}.code-search__box .code-search__input[data-v-7a70b4e7]{padding:0 24px}.code-search__box .code-search__input[data-v-7a70b4e7] .el-input{max-width:660px}.code-search__box .code-search__input[data-v-7a70b4e7] .el-input .el-input__inner{height:40px;padding-left:0;border-left-color:rgba(0,0,0,0)}.code-search__box .code-search__input[data-v-7a70b4e7] .el-input .el-input__inner:focus{border-color:var(--borderColor);border-left-color:rgba(0,0,0,0)}.code-search__box .code-search__input[data-v-7a70b4e7] .el-input .el-input-group__prepend{position:relative;padding:0 10px;background:var(--gray-1)}.code-search__box .code-search__input[data-v-7a70b4e7] .el-input .el-input-group__prepend .iconfont-new{font-size:16px;color:var(--gray-7);cursor:pointer;font-weight:bold}
|
|
10
|
+
.code_global_search[data-v-8426e210],.global_search_result[data-v-8426e210]{height:100%}.global_search_result[data-v-8426e210]{display:flex;flex-direction:column}.global_search_wrap[data-v-8426e210]{display:flex;justify-content:center;background-color:var(--gray-2);padding:16px;border-bottom:1px solid var(--gray-4)}.global_search_wrap .global_search_input[data-v-8426e210]{max-width:1000px}.global_search_wrap[data-v-8426e210] .el-input .el-input__inner{padding-left:0;border-left-color:rgba(0,0,0,0);border-right-color:rgba(0,0,0,0)}.global_search_wrap[data-v-8426e210] .el-input .el-input__inner:focus{border-color:var(--borderColor);border-left-color:rgba(0,0,0,0)}.global_search_wrap[data-v-8426e210] .el-input .el-input-group__prepend{position:relative;padding:0 10px;background:var(--gray-1)}.global_search_wrap[data-v-8426e210] .el-input .el-input-group__prepend .iconfont-new{font-size:16px;color:var(--gray-7);cursor:pointer;font-weight:bold}.global_search_wrap[data-v-8426e210] .el-input .el-input-group__append{position:relative;background:var(--gray-1);color:var(--gray-7);padding:0 15px;font-weight:bold}.global_search_wrap[data-v-8426e210] .el-input .el-input-group__append::before{position:absolute;content:"";left:0;top:15%;height:70%;border-right:1px solid #dededf}.icon-move[data-v-8426e210]{color:var(--gray-6);margin-left:-14px}.tab_label[data-v-8426e210]{cursor:grab;padding:0 10px}.moving[data-v-8426e210]{cursor:grabbing}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_gitee_code_plugin_search=self.webpackChunk_gitee_code_plugin_search||[]).push([[7],{7274:function(e,t){var i,s;void 0===(s="function"==typeof(i=function(){function e(e){var t=getComputedStyle(e,null).getPropertyValue("overflow");return t.indexOf("scroll")>-1||t.indexOf("auto")>-1}return function(t){if(t instanceof HTMLElement||t instanceof SVGElement){for(var i=t.parentNode;i.parentNode;){if(e(i))return i;i=i.parentNode}return document.scrollingElement||document.documentElement}}})?i.apply(t,[]):i)||(e.exports=s)},7007:(e,t,i)=>{"use strict";i.d(t,{cV:()=>A,Wk:()=>C});var s=void 0;function r(){r.init||(r.init=!0,s=-1!==function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var i=e.indexOf("rv:");return parseInt(e.substring(i+3,e.indexOf(".",i)),10)}var s=e.indexOf("Edge/");return s>0?parseInt(e.substring(s+5,e.indexOf(".",s)),10):-1}())}var n={render:function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"resize-observer",attrs:{tabindex:"-1"}})},staticRenderFns:[],_scopeId:"data-v-b329ee4c",name:"resize-observer",methods:{compareAndNotify:function(){this._w===this.$el.offsetWidth&&this._h===this.$el.offsetHeight||(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.$emit("notify"))},addResizeHandlers:function(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers:function(){this._resizeObject&&this._resizeObject.onload&&(!s&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),delete this._resizeObject.onload)}},mounted:function(){var e=this;r(),this.$nextTick((function(){e._w=e.$el.offsetWidth,e._h=e.$el.offsetHeight}));var t=document.createElement("object");this._resizeObject=t,t.setAttribute("aria-hidden","true"),t.setAttribute("tabindex",-1),t.onload=this.addResizeHandlers,t.type="text/html",s&&this.$el.appendChild(t),t.data="about:blank",s||this.$el.appendChild(t)},beforeDestroy:function(){this.removeResizeHandlers()}},o={version:"0.4.5",install:function(e){e.component("resize-observer",n),e.component("ResizeObserver",n)}},l=null;function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function c(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function d(e){return function(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t<e.length;t++)i[t]=e[t];return i}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function h(e,t){if(e===t)return!0;if("object"===a(e)){for(var i in e)if(!h(e[i],t[i]))return!1;return!0}return!1}"undefined"!=typeof window?l=window.Vue:void 0!==i.g&&(l=i.g.Vue),l&&l.use(o);var u=function(){function e(t,i,s){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.el=t,this.observer=null,this.frozen=!1,this.createObserver(i,s)}var t,i;return t=e,i=[{key:"createObserver",value:function(e,t){var i=this;if(this.observer&&this.destroyObserver(),!this.frozen){var s;if(this.options="function"==typeof(s=e)?{callback:s}:s,this.callback=function(e,t){i.options.callback(e,t),e&&i.options.once&&(i.frozen=!0,i.destroyObserver())},this.callback&&this.options.throttle){var r=(this.options.throttleOptions||{}).leading;this.callback=function(e,t){var i,s,r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=function(o){for(var l=arguments.length,a=new Array(l>1?l-1:0),c=1;c<l;c++)a[c-1]=arguments[c];if(r=a,!i||o!==s){var h=n.leading;"function"==typeof h&&(h=h(o,s)),i&&o===s||!h||e.apply(void 0,[o].concat(d(r))),s=o,clearTimeout(i),i=setTimeout((function(){e.apply(void 0,[o].concat(d(r))),i=0}),t)}};return o._clear=function(){clearTimeout(i),i=null},o}(this.callback,this.options.throttle,{leading:function(e){return"both"===r||"visible"===r&&e||"hidden"===r&&!e}})}this.oldResult=void 0,this.observer=new IntersectionObserver((function(e){var t=e[0];if(e.length>1){var s=e.find((function(e){return e.isIntersecting}));s&&(t=s)}if(i.callback){var r=t.isIntersecting&&t.intersectionRatio>=i.threshold;if(r===i.oldResult)return;i.oldResult=r,i.callback(r,t)}}),this.options.intersection),t.context.$nextTick((function(){i.observer&&i.observer.observe(i.el)}))}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&this.options.intersection.threshold||0}}],i&&c(t.prototype,i),e}();function f(e,t,i){var s=t.value;if(s)if("undefined"==typeof IntersectionObserver)console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var r=new u(e,s,i);e._vue_visibilityState=r}}function p(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var v={bind:f,update:function(e,t,i){var s=t.value;if(!h(s,t.oldValue)){var r=e._vue_visibilityState;s?r?r.createObserver(s,i):f(e,{value:s},i):p(e)}},unbind:p},m={version:"0.4.6",install:function(e){e.directive("observe-visibility",v)}},y=null;"undefined"!=typeof window?y=window.Vue:void 0!==i.g&&(y=i.g.Vue),y&&y.use(m);var b=i(7274),g=i.n(b),_={itemsLimit:1e3};const z={items:{type:Array,required:!0},keyField:{type:String,default:"id"},direction:{type:String,default:"vertical",validator:e=>["vertical","horizontal"].includes(e)},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"}};function $(){return this.items.length&&"object"!=typeof this.items[0]}let S=!1;if("undefined"!=typeof window){S=!1;try{var w=Object.defineProperty({},"passive",{get(){S=!0}});window.addEventListener("test",null,w)}catch(e){}}let T=0;function x(e,t,i,s,r,n,o,l,a,c){"boolean"!=typeof o&&(a=l,l=o,o=!1);const d="function"==typeof i?i.options:i;let h;if(e&&e.render&&(d.render=e.render,d.staticRenderFns=e.staticRenderFns,d._compiled=!0,r&&(d.functional=!0)),s&&(d._scopeId=s),n?(h=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,a(e)),e&&e._registeredComponents&&e._registeredComponents.add(n)},d._ssrRegister=h):t&&(h=o?function(e){t.call(this,c(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,l(e))}),h)if(d.functional){const e=d.render;d.render=function(t,i){return h.call(i),e(t,i)}}else{const e=d.beforeCreate;d.beforeCreate=e?[].concat(e,h):[h]}return i}const O={name:"RecycleScroller",components:{ResizeObserver:n},directives:{ObserveVisibility:v},props:{...z,itemSize:{type:Number,default:null},gridItems:{type:Number,default:void 0},itemSecondarySize:{type:Number,default:void 0},minItemSize:{type:[Number,String],default:null},sizeField:{type:String,default:"size"},typeField:{type:String,default:"type"},buffer:{type:Number,default:200},pageMode:{type:Boolean,default:!1},prerender:{type:Number,default:0},emitUpdate:{type:Boolean,default:!1},skipHover:{type:Boolean,default:!1},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"},listClass:{type:[String,Object,Array],default:""},itemClass:{type:[String,Object,Array],default:""}},data:()=>({pool:[],totalSize:0,ready:!1,hoverKey:null}),computed:{sizes(){if(null===this.itemSize){const e={"-1":{accumulator:0}},t=this.items,i=this.sizeField,s=this.minItemSize;let r,n=1e4,o=0;for(let l=0,a=t.length;l<a;l++)r=t[l][i]||s,r<n&&(n=r),o+=r,e[l]={accumulator:o,size:r};return this.$_computedMinItemSize=n,e}return[]},simpleArray:$},watch:{items(){this.updateVisibleItems(!0)},pageMode(){this.applyPageMode(),this.updateVisibleItems(!1)},sizes:{handler(){this.updateVisibleItems(!1)},deep:!0},gridItems(){this.updateVisibleItems(!0)},itemSecondarySize(){this.updateVisibleItems(!0)}},created(){this.$_startIndex=0,this.$_endIndex=0,this.$_views=new Map,this.$_unusedViews=new Map,this.$_scrollDirty=!1,this.$_lastUpdateScrollPosition=0,this.prerender&&(this.$_prerender=!0,this.updateVisibleItems(!1)),this.gridItems&&!this.itemSize&&console.error("[vue-recycle-scroller] You must provide an itemSize when using gridItems")},mounted(){this.applyPageMode(),this.$nextTick((()=>{this.$_prerender=!1,this.updateVisibleItems(!0),this.ready=!0}))},activated(){const e=this.$_lastUpdateScrollPosition;"number"==typeof e&&this.$nextTick((()=>{this.scrollToPosition(e)}))},beforeDestroy(){this.removeListeners()},methods:{addView(e,t,i,s,r){const n={item:i,position:0},o={id:T++,index:t,used:!0,key:s,type:r};return Object.defineProperty(n,"nr",{configurable:!1,value:o}),e.push(n),n},unuseView(e,t=!1){const i=this.$_unusedViews,s=e.nr.type;let r=i.get(s);r||(r=[],i.set(s,r)),r.push(e),t||(e.nr.used=!1,e.position=-9999,this.$_views.delete(e.nr.key))},handleResize(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll(e){this.$_scrollDirty||(this.$_scrollDirty=!0,requestAnimationFrame((()=>{this.$_scrollDirty=!1;const{continuous:e}=this.updateVisibleItems(!1,!0);e||(clearTimeout(this.$_refreshTimout),this.$_refreshTimout=setTimeout(this.handleScroll,100))})))},handleVisibilityChange(e,t){this.ready&&(e||0!==t.boundingClientRect.width||0!==t.boundingClientRect.height?(this.$emit("visible"),requestAnimationFrame((()=>{this.updateVisibleItems(!1)}))):this.$emit("hidden"))},updateVisibleItems(e,t=!1){const i=this.itemSize,s=this.gridItems||1,r=this.itemSecondarySize||i,n=this.$_computedMinItemSize,o=this.typeField,l=this.simpleArray?null:this.keyField,a=this.items,c=a.length,d=this.sizes,h=this.$_views,u=this.$_unusedViews,f=this.pool;let p,v,m,y,b,g;if(c)if(this.$_prerender)p=y=0,v=b=Math.min(this.prerender,a.length),m=null;else{const e=this.getScroll();if(t){let t=e.start-this.$_lastUpdateScrollPosition;if(t<0&&(t=-t),null===i&&t<n||t<i)return{continuous:!0}}this.$_lastUpdateScrollPosition=e.start;const r=this.buffer;e.start-=r,e.end+=r;let o=0;if(this.$refs.before&&(o=this.$refs.before.scrollHeight,e.start-=o),this.$refs.after){const t=this.$refs.after.scrollHeight;e.end+=t}if(null===i){let t,i,s=0,r=c-1,n=~~(c/2);do{i=n,t=d[n].accumulator,t<e.start?s=n:n<c-1&&d[n+1].accumulator>e.start&&(r=n),n=~~((s+r)/2)}while(n!==i);for(n<0&&(n=0),p=n,m=d[c-1].accumulator,v=n;v<c&&d[v].accumulator<e.end;v++);for(-1===v?v=a.length-1:(v++,v>c&&(v=c)),y=p;y<c&&o+d[y].accumulator<e.start;y++);for(b=y;b<c&&o+d[b].accumulator<e.end;b++);}else p=~~(e.start/i*s),p-=p%s,v=Math.ceil(e.end/i*s),y=Math.max(0,Math.floor((e.start-o)/i*s)),b=Math.floor((e.end-o)/i*s),p<0&&(p=0),v>c&&(v=c),y<0&&(y=0),b>c&&(b=c),m=Math.ceil(c/s)*i}else p=v=y=b=m=0;v-p>_.itemsLimit&&this.itemsLimitError(),this.totalSize=m;const z=p<=this.$_endIndex&&v>=this.$_startIndex;if(this.$_continuous!==z){if(z){h.clear(),u.clear();for(let e=0,t=f.length;e<t;e++)g=f[e],this.unuseView(g)}this.$_continuous=z}else if(z)for(let t=0,i=f.length;t<i;t++)g=f[t],g.nr.used&&(e&&(g.nr.index=a.indexOf(g.item)),(-1===g.nr.index||g.nr.index<p||g.nr.index>=v)&&this.unuseView(g));const $=z?null:new Map;let S,w,T,x;for(let e=p;e<v;e++){S=a[e];const t=l?S[l]:S;if(null==t)throw new Error(`Key is ${t} on item (keyField is '${l}')`);g=h.get(t),i||d[e].size?(g?(g.nr.used=!0,g.item=S):(e===a.length-1&&this.$emit("scroll-end"),0===e&&this.$emit("scroll-start"),w=S[o],T=u.get(w),z?T&&T.length?(g=T.pop(),g.item=S,g.nr.used=!0,g.nr.index=e,g.nr.key=t,g.nr.type=w):g=this.addView(f,e,S,t,w):(x=$.get(w)||0,(!T||x>=T.length)&&(g=this.addView(f,e,S,t,w),this.unuseView(g,!0),T=u.get(w)),g=T[x],g.item=S,g.nr.used=!0,g.nr.index=e,g.nr.key=t,g.nr.type=w,$.set(w,x+1),x++),h.set(t,g)),null===i?(g.position=d[e-1].accumulator,g.offset=0):(g.position=Math.floor(e/s)*i,g.offset=e%s*r)):g&&this.unuseView(g)}return this.$_startIndex=p,this.$_endIndex=v,this.emitUpdate&&this.$emit("update",p,v,y,b),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,300),{continuous:z}},getListenerTarget(){let e=g()(this.$el);return!window.document||e!==window.document.documentElement&&e!==window.document.body||(e=window),e},getScroll(){const{$el:e,direction:t}=this,i="vertical"===t;let s;if(this.pageMode){const t=e.getBoundingClientRect(),r=i?t.height:t.width;let n=-(i?t.top:t.left),o=i?window.innerHeight:window.innerWidth;n<0&&(o+=n,n=0),n+o>r&&(o=r-n),s={start:n,end:n+o}}else s=i?{start:e.scrollTop,end:e.scrollTop+e.clientHeight}:{start:e.scrollLeft,end:e.scrollLeft+e.clientWidth};return s},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,!!S&&{passive:!0}),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem(e){let t;t=null===this.itemSize?e>0?this.sizes[e-1].accumulator:0:Math.floor(e/this.gridItems)*this.itemSize,this.scrollToPosition(t)},scrollToPosition(e){const t="vertical"===this.direction?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"};let i,s,r;if(this.pageMode){const n=g()(this.$el),o="HTML"===n.tagName?0:n[t.scroll],l=n.getBoundingClientRect(),a=this.$el.getBoundingClientRect()[t.start]-l[t.start];i=n,s=t.scroll,r=e+o+a}else i=this.$el,s=t.scroll,r=e;i[s]=r},itemsLimitError(){throw setTimeout((()=>{console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",this.$el),console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")})),new Error("Rendered items limit reached")},sortViews(){this.pool.sort(((e,t)=>e.nr.index-t.nr.index))}}};var R=function(){var e,t,i=this,s=i.$createElement,r=i._self._c||s;return r("div",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:i.handleVisibilityChange,expression:"handleVisibilityChange"}],staticClass:"vue-recycle-scroller",class:(e={ready:i.ready,"page-mode":i.pageMode},e["direction-"+i.direction]=!0,e),on:{"&scroll":function(e){return i.handleScroll.apply(null,arguments)}}},[i.$slots.before?r("div",{ref:"before",staticClass:"vue-recycle-scroller__slot"},[i._t("before")],2):i._e(),i._v(" "),r(i.listTag,{ref:"wrapper",tag:"component",staticClass:"vue-recycle-scroller__item-wrapper",class:i.listClass,style:(t={},t["vertical"===i.direction?"minHeight":"minWidth"]=i.totalSize+"px",t)},[i._l(i.pool,(function(e){return r(i.itemTag,i._g({key:e.nr.id,tag:"component",staticClass:"vue-recycle-scroller__item-view",class:[i.itemClass,{hover:!i.skipHover&&i.hoverKey===e.nr.key}],style:i.ready?{transform:"translate"+("vertical"===i.direction?"Y":"X")+"("+e.position+"px) translate"+("vertical"===i.direction?"X":"Y")+"("+e.offset+"px)",width:i.gridItems?("vertical"===i.direction&&i.itemSecondarySize||i.itemSize)+"px":void 0,height:i.gridItems?("horizontal"===i.direction&&i.itemSecondarySize||i.itemSize)+"px":void 0}:null},i.skipHover?{}:{mouseenter:function(){i.hoverKey=e.nr.key},mouseleave:function(){i.hoverKey=null}}),[i._t("default",null,{item:e.item,index:e.nr.index,active:e.nr.used})],2)})),i._v(" "),i._t("empty")],2),i._v(" "),i.$slots.after?r("div",{ref:"after",staticClass:"vue-recycle-scroller__slot"},[i._t("after")],2):i._e(),i._v(" "),r("ResizeObserver",{on:{notify:i.handleResize}})],1)};R._withStripped=!0;const V=x({render:R,staticRenderFns:[]},void 0,O,void 0,!1,void 0,!1,void 0,void 0,void 0);var I={name:"DynamicScroller",components:{RecycleScroller:V},provide(){return"undefined"!=typeof ResizeObserver&&(this.$_resizeObserver=new ResizeObserver((e=>{requestAnimationFrame((()=>{if(Array.isArray(e))for(const t of e)if(t.target){const e=new CustomEvent("resize",{detail:{contentRect:t.contentRect}});t.target.dispatchEvent(e)}}))}))),{vscrollData:this.vscrollData,vscrollParent:this,vscrollResizeObserver:this.$_resizeObserver}},inheritAttrs:!1,props:{...z,minItemSize:{type:[Number,String],required:!0}},data(){return{vscrollData:{active:!0,sizes:{},validSizes:{},keyField:this.keyField,simpleArray:!1}}},computed:{simpleArray:$,itemsWithSize(){const e=[],{items:t,keyField:i,simpleArray:s}=this,r=this.vscrollData.sizes,n=t.length;for(let o=0;o<n;o++){const n=t[o],l=s?o:n[i];let a=r[l];void 0!==a||this.$_undefinedMap[l]||(a=0),e.push({item:n,id:l,size:a})}return e},listeners(){const e={};for(const t in this.$listeners)"resize"!==t&&"visible"!==t&&(e[t]=this.$listeners[t]);return e}},watch:{items(){this.forceUpdate(!1)},simpleArray:{handler(e){this.vscrollData.simpleArray=e},immediate:!0},direction(e){this.forceUpdate(!0)},itemsWithSize(e,t){const i=this.$el.scrollTop;let s=0,r=0;const n=Math.min(e.length,t.length);for(let o=0;o<n&&!(s>=i);o++)s+=t[o].size||this.minItemSize,r+=e[o].size||this.minItemSize;const o=r-s;0!==o&&(this.$el.scrollTop+=o)}},beforeCreate(){this.$_updates=[],this.$_undefinedSizes=0,this.$_undefinedMap={}},activated(){this.vscrollData.active=!0},deactivated(){this.vscrollData.active=!1},methods:{onScrollerResize(){this.$refs.scroller&&this.forceUpdate(),this.$emit("resize")},onScrollerVisible(){this.$emit("vscroll:update",{force:!1}),this.$emit("visible")},forceUpdate(e=!0){(e||this.simpleArray)&&(this.vscrollData.validSizes={}),this.$emit("vscroll:update",{force:!0})},scrollToItem(e){const t=this.$refs.scroller;t&&t.scrollToItem(e)},getItemSize(e,t=void 0){const i=this.simpleArray?null!=t?t:this.items.indexOf(e):e[this.keyField];return this.vscrollData.sizes[i]||0},scrollToBottom(){if(this.$_scrollingToBottom)return;this.$_scrollingToBottom=!0;const e=this.$el;this.$nextTick((()=>{e.scrollTop=e.scrollHeight+5e3;const t=()=>{e.scrollTop=e.scrollHeight+5e3,requestAnimationFrame((()=>{e.scrollTop=e.scrollHeight+5e3,0===this.$_undefinedSizes?this.$_scrollingToBottom=!1:requestAnimationFrame(t)}))};requestAnimationFrame(t)}))}}};const k=I;var D=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("RecycleScroller",e._g(e._b({ref:"scroller",attrs:{items:e.itemsWithSize,"min-item-size":e.minItemSize,direction:e.direction,"key-field":"id","list-tag":e.listTag,"item-tag":e.itemTag},on:{resize:e.onScrollerResize,visible:e.onScrollerVisible},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.item,s=t.index,r=t.active;return[e._t("default",null,null,{item:i.item,index:s,active:r,itemWithSize:i})]}}],null,!0)},"RecycleScroller",e.$attrs,!1),e.listeners),[e._v(" "),i("template",{slot:"before"},[e._t("before")],2),e._v(" "),i("template",{slot:"after"},[e._t("after")],2),e._v(" "),i("template",{slot:"empty"},[e._t("empty")],2)],2)};D._withStripped=!0;const A=x({render:D,staticRenderFns:[]},void 0,k,void 0,!1,void 0,!1,void 0,void 0,void 0),C=x({},void 0,{name:"DynamicScrollerItem",inject:["vscrollData","vscrollParent","vscrollResizeObserver"],props:{item:{required:!0},watchData:{type:Boolean,default:!1},active:{type:Boolean,required:!0},index:{type:Number,default:void 0},sizeDependencies:{type:[Array,Object],default:null},emitResize:{type:Boolean,default:!1},tag:{type:String,default:"div"}},computed:{id(){if(this.vscrollData.simpleArray)return this.index;if(this.item.hasOwnProperty(this.vscrollData.keyField))return this.item[this.vscrollData.keyField];throw new Error(`keyField '${this.vscrollData.keyField}' not found in your item. You should set a valid keyField prop on your Scroller`)},size(){return this.vscrollData.validSizes[this.id]&&this.vscrollData.sizes[this.id]||0},finalActive(){return this.active&&this.vscrollData.active}},watch:{watchData:"updateWatchData",id(){this.size||this.onDataUpdate()},finalActive(e){this.size||(e?this.vscrollParent.$_undefinedMap[this.id]||(this.vscrollParent.$_undefinedSizes++,this.vscrollParent.$_undefinedMap[this.id]=!0):this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=!1)),this.vscrollResizeObserver?e?this.observeSize():this.unobserveSize():e&&this.$_pendingVScrollUpdate===this.id&&this.updateSize()}},created(){if(!this.$isServer&&(this.$_forceNextVScrollUpdate=null,this.updateWatchData(),!this.vscrollResizeObserver)){for(const e in this.sizeDependencies)this.$watch((()=>this.sizeDependencies[e]),this.onDataUpdate);this.vscrollParent.$on("vscroll:update",this.onVscrollUpdate),this.vscrollParent.$on("vscroll:update-size",this.onVscrollUpdateSize)}},mounted(){this.vscrollData.active&&(this.updateSize(),this.observeSize())},beforeDestroy(){this.vscrollParent.$off("vscroll:update",this.onVscrollUpdate),this.vscrollParent.$off("vscroll:update-size",this.onVscrollUpdateSize),this.unobserveSize()},methods:{updateSize(){this.finalActive?this.$_pendingSizeUpdate!==this.id&&(this.$_pendingSizeUpdate=this.id,this.$_forceNextVScrollUpdate=null,this.$_pendingVScrollUpdate=null,this.computeSize(this.id)):this.$_forceNextVScrollUpdate=this.id},updateWatchData(){this.watchData&&!this.vscrollResizeObserver?this.$_watchData=this.$watch("item",(()=>{this.onDataUpdate()}),{deep:!0}):this.$_watchData&&(this.$_watchData(),this.$_watchData=null)},onVscrollUpdate({force:e}){!this.finalActive&&e&&(this.$_pendingVScrollUpdate=this.id),this.$_forceNextVScrollUpdate!==this.id&&!e&&this.size||this.updateSize()},onDataUpdate(){this.updateSize()},computeSize(e){this.$nextTick((()=>{if(this.id===e){const e=this.$el.offsetWidth,t=this.$el.offsetHeight;this.applySize(e,t)}this.$_pendingSizeUpdate=null}))},applySize(e,t){const i=~~("vertical"===this.vscrollParent.direction?t:e);i&&this.size!==i&&(this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=void 0),this.$set(this.vscrollData.sizes,this.id,i),this.$set(this.vscrollData.validSizes,this.id,!0),this.emitResize&&this.$emit("resize",this.id))},observeSize(){this.vscrollResizeObserver&&this.$el.parentNode&&(this.vscrollResizeObserver.observe(this.$el.parentNode),this.$el.parentNode.addEventListener("resize",this.onResize))},unobserveSize(){this.vscrollResizeObserver&&(this.vscrollResizeObserver.unobserve(this.$el.parentNode),this.$el.parentNode.removeEventListener("resize",this.onResize))},onResize(e){const{width:t,height:i}=e.detail.contentRect;this.applySize(t,i)}},render(e){return e(this.tag,this.$slots.default)}},void 0,void 0,void 0,!1,void 0,void 0,void 0),M={version:"1.1.2",install(e,t){const i=Object.assign({},{installComponents:!0,componentsPrefix:""},t);for(const e in i)void 0!==i[e]&&(_[e]=i[e]);i.installComponents&&function(e,t){e.component(`${t}recycle-scroller`,V),e.component(`${t}RecycleScroller`,V),e.component(`${t}dynamic-scroller`,A),e.component(`${t}DynamicScroller`,A),e.component(`${t}dynamic-scroller-item`,C),e.component(`${t}DynamicScrollerItem`,C)}(e,i.componentsPrefix)}};let P=null;"undefined"!=typeof window?P=window.Vue:void 0!==i.g&&(P=i.g.Vue),P&&P.use(M)}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_gitee_code_plugin_search=self.webpackChunk_gitee_code_plugin_search||[]).push([[7],{7274:function(e,t){var i,s;void 0===(s="function"==typeof(i=function(){function e(e){var t=getComputedStyle(e,null).getPropertyValue("overflow");return t.indexOf("scroll")>-1||t.indexOf("auto")>-1}return function(t){if(t instanceof HTMLElement||t instanceof SVGElement){for(var i=t.parentNode;i.parentNode;){if(e(i))return i;i=i.parentNode}return document.scrollingElement||document.documentElement}}})?i.apply(t,[]):i)||(e.exports=s)},7007:(e,t,i)=>{"use strict";i.d(t,{cV:()=>A,Wk:()=>C});var s=void 0;function r(){r.init||(r.init=!0,s=-1!==function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var i=e.indexOf("rv:");return parseInt(e.substring(i+3,e.indexOf(".",i)),10)}var s=e.indexOf("Edge/");return s>0?parseInt(e.substring(s+5,e.indexOf(".",s)),10):-1}())}var n={render:function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"resize-observer",attrs:{tabindex:"-1"}})},staticRenderFns:[],_scopeId:"data-v-b329ee4c",name:"resize-observer",methods:{compareAndNotify:function(){this._w===this.$el.offsetWidth&&this._h===this.$el.offsetHeight||(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.$emit("notify"))},addResizeHandlers:function(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers:function(){this._resizeObject&&this._resizeObject.onload&&(!s&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),delete this._resizeObject.onload)}},mounted:function(){var e=this;r(),this.$nextTick((function(){e._w=e.$el.offsetWidth,e._h=e.$el.offsetHeight}));var t=document.createElement("object");this._resizeObject=t,t.setAttribute("aria-hidden","true"),t.setAttribute("tabindex",-1),t.onload=this.addResizeHandlers,t.type="text/html",s&&this.$el.appendChild(t),t.data="about:blank",s||this.$el.appendChild(t)},beforeDestroy:function(){this.removeResizeHandlers()}},o={version:"0.4.5",install:function(e){e.component("resize-observer",n),e.component("ResizeObserver",n)}},l=null;function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function c(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function d(e){return function(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t<e.length;t++)i[t]=e[t];return i}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function h(e,t){if(e===t)return!0;if("object"===a(e)){for(var i in e)if(!h(e[i],t[i]))return!1;return!0}return!1}"undefined"!=typeof window?l=window.Vue:void 0!==i.g&&(l=i.g.Vue),l&&l.use(o);var u=function(){function e(t,i,s){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.el=t,this.observer=null,this.frozen=!1,this.createObserver(i,s)}var t,i;return t=e,i=[{key:"createObserver",value:function(e,t){var i=this;if(this.observer&&this.destroyObserver(),!this.frozen){var s;if(this.options="function"==typeof(s=e)?{callback:s}:s,this.callback=function(e,t){i.options.callback(e,t),e&&i.options.once&&(i.frozen=!0,i.destroyObserver())},this.callback&&this.options.throttle){var r=(this.options.throttleOptions||{}).leading;this.callback=function(e,t){var i,s,r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=function(o){for(var l=arguments.length,a=new Array(l>1?l-1:0),c=1;c<l;c++)a[c-1]=arguments[c];if(r=a,!i||o!==s){var h=n.leading;"function"==typeof h&&(h=h(o,s)),i&&o===s||!h||e.apply(void 0,[o].concat(d(r))),s=o,clearTimeout(i),i=setTimeout((function(){e.apply(void 0,[o].concat(d(r))),i=0}),t)}};return o._clear=function(){clearTimeout(i),i=null},o}(this.callback,this.options.throttle,{leading:function(e){return"both"===r||"visible"===r&&e||"hidden"===r&&!e}})}this.oldResult=void 0,this.observer=new IntersectionObserver((function(e){var t=e[0];if(e.length>1){var s=e.find((function(e){return e.isIntersecting}));s&&(t=s)}if(i.callback){var r=t.isIntersecting&&t.intersectionRatio>=i.threshold;if(r===i.oldResult)return;i.oldResult=r,i.callback(r,t)}}),this.options.intersection),t.context.$nextTick((function(){i.observer&&i.observer.observe(i.el)}))}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&this.options.intersection.threshold||0}}],i&&c(t.prototype,i),e}();function f(e,t,i){var s=t.value;if(s)if("undefined"==typeof IntersectionObserver)console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var r=new u(e,s,i);e._vue_visibilityState=r}}function p(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var v={bind:f,update:function(e,t,i){var s=t.value;if(!h(s,t.oldValue)){var r=e._vue_visibilityState;s?r?r.createObserver(s,i):f(e,{value:s},i):p(e)}},unbind:p},m={version:"0.4.6",install:function(e){e.directive("observe-visibility",v)}},y=null;"undefined"!=typeof window?y=window.Vue:void 0!==i.g&&(y=i.g.Vue),y&&y.use(m);var b=i(7274),g=i.n(b),_={itemsLimit:1e3};const z={items:{type:Array,required:!0},keyField:{type:String,default:"id"},direction:{type:String,default:"vertical",validator:e=>["vertical","horizontal"].includes(e)},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"}};function $(){return this.items.length&&"object"!=typeof this.items[0]}let S=!1;if("undefined"!=typeof window){S=!1;try{var w=Object.defineProperty({},"passive",{get(){S=!0}});window.addEventListener("test",null,w)}catch(e){}}let T=0;function x(e,t,i,s,r,n,o,l,a,c){"boolean"!=typeof o&&(a=l,l=o,o=!1);const d="function"==typeof i?i.options:i;let h;if(e&&e.render&&(d.render=e.render,d.staticRenderFns=e.staticRenderFns,d._compiled=!0,r&&(d.functional=!0)),s&&(d._scopeId=s),n?(h=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,a(e)),e&&e._registeredComponents&&e._registeredComponents.add(n)},d._ssrRegister=h):t&&(h=o?function(e){t.call(this,c(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,l(e))}),h)if(d.functional){const e=d.render;d.render=function(t,i){return h.call(i),e(t,i)}}else{const e=d.beforeCreate;d.beforeCreate=e?[].concat(e,h):[h]}return i}const O={name:"RecycleScroller",components:{ResizeObserver:n},directives:{ObserveVisibility:v},props:{...z,itemSize:{type:Number,default:null},gridItems:{type:Number,default:void 0},itemSecondarySize:{type:Number,default:void 0},minItemSize:{type:[Number,String],default:null},sizeField:{type:String,default:"size"},typeField:{type:String,default:"type"},buffer:{type:Number,default:200},pageMode:{type:Boolean,default:!1},prerender:{type:Number,default:0},emitUpdate:{type:Boolean,default:!1},skipHover:{type:Boolean,default:!1},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"},listClass:{type:[String,Object,Array],default:""},itemClass:{type:[String,Object,Array],default:""}},data:()=>({pool:[],totalSize:0,ready:!1,hoverKey:null}),computed:{sizes(){if(null===this.itemSize){const e={"-1":{accumulator:0}},t=this.items,i=this.sizeField,s=this.minItemSize;let r,n=1e4,o=0;for(let l=0,a=t.length;l<a;l++)r=t[l][i]||s,r<n&&(n=r),o+=r,e[l]={accumulator:o,size:r};return this.$_computedMinItemSize=n,e}return[]},simpleArray:$},watch:{items(){this.updateVisibleItems(!0)},pageMode(){this.applyPageMode(),this.updateVisibleItems(!1)},sizes:{handler(){this.updateVisibleItems(!1)},deep:!0},gridItems(){this.updateVisibleItems(!0)},itemSecondarySize(){this.updateVisibleItems(!0)}},created(){this.$_startIndex=0,this.$_endIndex=0,this.$_views=new Map,this.$_unusedViews=new Map,this.$_scrollDirty=!1,this.$_lastUpdateScrollPosition=0,this.prerender&&(this.$_prerender=!0,this.updateVisibleItems(!1)),this.gridItems&&!this.itemSize&&console.error("[vue-recycle-scroller] You must provide an itemSize when using gridItems")},mounted(){this.applyPageMode(),this.$nextTick((()=>{this.$_prerender=!1,this.updateVisibleItems(!0),this.ready=!0}))},activated(){const e=this.$_lastUpdateScrollPosition;"number"==typeof e&&this.$nextTick((()=>{this.scrollToPosition(e)}))},beforeDestroy(){this.removeListeners()},methods:{addView(e,t,i,s,r){const n={item:i,position:0},o={id:T++,index:t,used:!0,key:s,type:r};return Object.defineProperty(n,"nr",{configurable:!1,value:o}),e.push(n),n},unuseView(e,t=!1){const i=this.$_unusedViews,s=e.nr.type;let r=i.get(s);r||(r=[],i.set(s,r)),r.push(e),t||(e.nr.used=!1,e.position=-9999,this.$_views.delete(e.nr.key))},handleResize(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll(e){this.$_scrollDirty||(this.$_scrollDirty=!0,requestAnimationFrame((()=>{this.$_scrollDirty=!1;const{continuous:e}=this.updateVisibleItems(!1,!0);e||(clearTimeout(this.$_refreshTimout),this.$_refreshTimout=setTimeout(this.handleScroll,100))})))},handleVisibilityChange(e,t){this.ready&&(e||0!==t.boundingClientRect.width||0!==t.boundingClientRect.height?(this.$emit("visible"),requestAnimationFrame((()=>{this.updateVisibleItems(!1)}))):this.$emit("hidden"))},updateVisibleItems(e,t=!1){const i=this.itemSize,s=this.gridItems||1,r=this.itemSecondarySize||i,n=this.$_computedMinItemSize,o=this.typeField,l=this.simpleArray?null:this.keyField,a=this.items,c=a.length,d=this.sizes,h=this.$_views,u=this.$_unusedViews,f=this.pool;let p,v,m,y,b,g;if(c)if(this.$_prerender)p=y=0,v=b=Math.min(this.prerender,a.length),m=null;else{const e=this.getScroll();if(t){let t=e.start-this.$_lastUpdateScrollPosition;if(t<0&&(t=-t),null===i&&t<n||t<i)return{continuous:!0}}this.$_lastUpdateScrollPosition=e.start;const r=this.buffer;e.start-=r,e.end+=r;let o=0;if(this.$refs.before&&(o=this.$refs.before.scrollHeight,e.start-=o),this.$refs.after){const t=this.$refs.after.scrollHeight;e.end+=t}if(null===i){let t,i,s=0,r=c-1,n=~~(c/2);do{i=n,t=d[n].accumulator,t<e.start?s=n:n<c-1&&d[n+1].accumulator>e.start&&(r=n),n=~~((s+r)/2)}while(n!==i);for(n<0&&(n=0),p=n,m=d[c-1].accumulator,v=n;v<c&&d[v].accumulator<e.end;v++);for(-1===v?v=a.length-1:(v++,v>c&&(v=c)),y=p;y<c&&o+d[y].accumulator<e.start;y++);for(b=y;b<c&&o+d[b].accumulator<e.end;b++);}else p=~~(e.start/i*s),p-=p%s,v=Math.ceil(e.end/i*s),y=Math.max(0,Math.floor((e.start-o)/i*s)),b=Math.floor((e.end-o)/i*s),p<0&&(p=0),v>c&&(v=c),y<0&&(y=0),b>c&&(b=c),m=Math.ceil(c/s)*i}else p=v=y=b=m=0;v-p>_.itemsLimit&&this.itemsLimitError(),this.totalSize=m;const z=p<=this.$_endIndex&&v>=this.$_startIndex;if(this.$_continuous!==z){if(z){h.clear(),u.clear();for(let e=0,t=f.length;e<t;e++)g=f[e],this.unuseView(g)}this.$_continuous=z}else if(z)for(let t=0,i=f.length;t<i;t++)g=f[t],g.nr.used&&(e&&(g.nr.index=a.indexOf(g.item)),(-1===g.nr.index||g.nr.index<p||g.nr.index>=v)&&this.unuseView(g));const $=z?null:new Map;let S,w,T,x;for(let e=p;e<v;e++){S=a[e];const t=l?S[l]:S;if(null==t)throw new Error(`Key is ${t} on item (keyField is '${l}')`);g=h.get(t),i||d[e].size?(g?(g.nr.used=!0,g.item=S):(e===a.length-1&&this.$emit("scroll-end"),0===e&&this.$emit("scroll-start"),w=S[o],T=u.get(w),z?T&&T.length?(g=T.pop(),g.item=S,g.nr.used=!0,g.nr.index=e,g.nr.key=t,g.nr.type=w):g=this.addView(f,e,S,t,w):(x=$.get(w)||0,(!T||x>=T.length)&&(g=this.addView(f,e,S,t,w),this.unuseView(g,!0),T=u.get(w)),g=T[x],g.item=S,g.nr.used=!0,g.nr.index=e,g.nr.key=t,g.nr.type=w,$.set(w,x+1),x++),h.set(t,g)),null===i?(g.position=d[e-1].accumulator,g.offset=0):(g.position=Math.floor(e/s)*i,g.offset=e%s*r)):g&&this.unuseView(g)}return this.$_startIndex=p,this.$_endIndex=v,this.emitUpdate&&this.$emit("update",p,v,y,b),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,300),{continuous:z}},getListenerTarget(){let e=g()(this.$el);return!window.document||e!==window.document.documentElement&&e!==window.document.body||(e=window),e},getScroll(){const{$el:e,direction:t}=this,i="vertical"===t;let s;if(this.pageMode){const t=e.getBoundingClientRect(),r=i?t.height:t.width;let n=-(i?t.top:t.left),o=i?window.innerHeight:window.innerWidth;n<0&&(o+=n,n=0),n+o>r&&(o=r-n),s={start:n,end:n+o}}else s=i?{start:e.scrollTop,end:e.scrollTop+e.clientHeight}:{start:e.scrollLeft,end:e.scrollLeft+e.clientWidth};return s},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,!!S&&{passive:!0}),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem(e){let t;t=null===this.itemSize?e>0?this.sizes[e-1].accumulator:0:Math.floor(e/this.gridItems)*this.itemSize,this.scrollToPosition(t)},scrollToPosition(e){const t="vertical"===this.direction?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"};let i,s,r;if(this.pageMode){const n=g()(this.$el),o="HTML"===n.tagName?0:n[t.scroll],l=n.getBoundingClientRect(),a=this.$el.getBoundingClientRect()[t.start]-l[t.start];i=n,s=t.scroll,r=e+o+a}else i=this.$el,s=t.scroll,r=e;i[s]=r},itemsLimitError(){throw setTimeout((()=>{console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",this.$el),console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")})),new Error("Rendered items limit reached")},sortViews(){this.pool.sort(((e,t)=>e.nr.index-t.nr.index))}}};var R=function(){var e,t,i=this,s=i.$createElement,r=i._self._c||s;return r("div",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:i.handleVisibilityChange,expression:"handleVisibilityChange"}],staticClass:"vue-recycle-scroller",class:(e={ready:i.ready,"page-mode":i.pageMode},e["direction-"+i.direction]=!0,e),on:{"&scroll":function(e){return i.handleScroll.apply(null,arguments)}}},[i.$slots.before?r("div",{ref:"before",staticClass:"vue-recycle-scroller__slot"},[i._t("before")],2):i._e(),i._v(" "),r(i.listTag,{ref:"wrapper",tag:"component",staticClass:"vue-recycle-scroller__item-wrapper",class:i.listClass,style:(t={},t["vertical"===i.direction?"minHeight":"minWidth"]=i.totalSize+"px",t)},[i._l(i.pool,(function(e){return r(i.itemTag,i._g({key:e.nr.id,tag:"component",staticClass:"vue-recycle-scroller__item-view",class:[i.itemClass,{hover:!i.skipHover&&i.hoverKey===e.nr.key}],style:i.ready?{transform:"translate"+("vertical"===i.direction?"Y":"X")+"("+e.position+"px) translate"+("vertical"===i.direction?"X":"Y")+"("+e.offset+"px)",width:i.gridItems?("vertical"===i.direction&&i.itemSecondarySize||i.itemSize)+"px":void 0,height:i.gridItems?("horizontal"===i.direction&&i.itemSecondarySize||i.itemSize)+"px":void 0}:null},i.skipHover?{}:{mouseenter:function(){i.hoverKey=e.nr.key},mouseleave:function(){i.hoverKey=null}}),[i._t("default",null,{item:e.item,index:e.nr.index,active:e.nr.used})],2)})),i._v(" "),i._t("empty")],2),i._v(" "),i.$slots.after?r("div",{ref:"after",staticClass:"vue-recycle-scroller__slot"},[i._t("after")],2):i._e(),i._v(" "),r("ResizeObserver",{on:{notify:i.handleResize}})],1)};R._withStripped=!0;const V=x({render:R,staticRenderFns:[]},void 0,O,void 0,!1,void 0,!1,void 0,void 0,void 0);var I={name:"DynamicScroller",components:{RecycleScroller:V},provide(){return"undefined"!=typeof ResizeObserver&&(this.$_resizeObserver=new ResizeObserver((e=>{requestAnimationFrame((()=>{if(Array.isArray(e))for(const t of e)if(t.target){const e=new CustomEvent("resize",{detail:{contentRect:t.contentRect}});t.target.dispatchEvent(e)}}))}))),{vscrollData:this.vscrollData,vscrollParent:this,vscrollResizeObserver:this.$_resizeObserver}},inheritAttrs:!1,props:{...z,minItemSize:{type:[Number,String],required:!0}},data(){return{vscrollData:{active:!0,sizes:{},validSizes:{},keyField:this.keyField,simpleArray:!1}}},computed:{simpleArray:$,itemsWithSize(){const e=[],{items:t,keyField:i,simpleArray:s}=this,r=this.vscrollData.sizes,n=t.length;for(let o=0;o<n;o++){const n=t[o],l=s?o:n[i];let a=r[l];void 0!==a||this.$_undefinedMap[l]||(a=0),e.push({item:n,id:l,size:a})}return e},listeners(){const e={};for(const t in this.$listeners)"resize"!==t&&"visible"!==t&&(e[t]=this.$listeners[t]);return e}},watch:{items(){this.forceUpdate(!1)},simpleArray:{handler(e){this.vscrollData.simpleArray=e},immediate:!0},direction(e){this.forceUpdate(!0)},itemsWithSize(e,t){const i=this.$el.scrollTop;let s=0,r=0;const n=Math.min(e.length,t.length);for(let o=0;o<n&&!(s>=i);o++)s+=t[o].size||this.minItemSize,r+=e[o].size||this.minItemSize;const o=r-s;0!==o&&(this.$el.scrollTop+=o)}},beforeCreate(){this.$_updates=[],this.$_undefinedSizes=0,this.$_undefinedMap={}},activated(){this.vscrollData.active=!0},deactivated(){this.vscrollData.active=!1},methods:{onScrollerResize(){this.$refs.scroller&&this.forceUpdate(),this.$emit("resize")},onScrollerVisible(){this.$emit("vscroll:update",{force:!1}),this.$emit("visible")},forceUpdate(e=!0){(e||this.simpleArray)&&(this.vscrollData.validSizes={}),this.$emit("vscroll:update",{force:!0})},scrollToItem(e){const t=this.$refs.scroller;t&&t.scrollToItem(e)},getItemSize(e,t=void 0){const i=this.simpleArray?null!=t?t:this.items.indexOf(e):e[this.keyField];return this.vscrollData.sizes[i]||0},scrollToBottom(){if(this.$_scrollingToBottom)return;this.$_scrollingToBottom=!0;const e=this.$el;this.$nextTick((()=>{e.scrollTop=e.scrollHeight+5e3;const t=()=>{e.scrollTop=e.scrollHeight+5e3,requestAnimationFrame((()=>{e.scrollTop=e.scrollHeight+5e3,0===this.$_undefinedSizes?this.$_scrollingToBottom=!1:requestAnimationFrame(t)}))};requestAnimationFrame(t)}))}}};const k=I;var D=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("RecycleScroller",e._g(e._b({ref:"scroller",attrs:{items:e.itemsWithSize,"min-item-size":e.minItemSize,direction:e.direction,"key-field":"id","list-tag":e.listTag,"item-tag":e.itemTag},on:{resize:e.onScrollerResize,visible:e.onScrollerVisible},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.item,s=t.index,r=t.active;return[e._t("default",null,null,{item:i.item,index:s,active:r,itemWithSize:i})]}}],null,!0)},"RecycleScroller",e.$attrs,!1),e.listeners),[e._v(" "),i("template",{slot:"before"},[e._t("before")],2),e._v(" "),i("template",{slot:"after"},[e._t("after")],2),e._v(" "),i("template",{slot:"empty"},[e._t("empty")],2)],2)};D._withStripped=!0;const A=x({render:D,staticRenderFns:[]},void 0,k,void 0,!1,void 0,!1,void 0,void 0,void 0),C=x({},void 0,{name:"DynamicScrollerItem",inject:["vscrollData","vscrollParent","vscrollResizeObserver"],props:{item:{required:!0},watchData:{type:Boolean,default:!1},active:{type:Boolean,required:!0},index:{type:Number,default:void 0},sizeDependencies:{type:[Array,Object],default:null},emitResize:{type:Boolean,default:!1},tag:{type:String,default:"div"}},computed:{id(){if(this.vscrollData.simpleArray)return this.index;if(this.item.hasOwnProperty(this.vscrollData.keyField))return this.item[this.vscrollData.keyField];throw new Error(`keyField '${this.vscrollData.keyField}' not found in your item. You should set a valid keyField prop on your Scroller`)},size(){return this.vscrollData.validSizes[this.id]&&this.vscrollData.sizes[this.id]||0},finalActive(){return this.active&&this.vscrollData.active}},watch:{watchData:"updateWatchData",id(){this.size||this.onDataUpdate()},finalActive(e){this.size||(e?this.vscrollParent.$_undefinedMap[this.id]||(this.vscrollParent.$_undefinedSizes++,this.vscrollParent.$_undefinedMap[this.id]=!0):this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=!1)),this.vscrollResizeObserver?e?this.observeSize():this.unobserveSize():e&&this.$_pendingVScrollUpdate===this.id&&this.updateSize()}},created(){if(!this.$isServer&&(this.$_forceNextVScrollUpdate=null,this.updateWatchData(),!this.vscrollResizeObserver)){for(const e in this.sizeDependencies)this.$watch((()=>this.sizeDependencies[e]),this.onDataUpdate);this.vscrollParent.$on("vscroll:update",this.onVscrollUpdate),this.vscrollParent.$on("vscroll:update-size",this.onVscrollUpdateSize)}},mounted(){this.vscrollData.active&&(this.updateSize(),this.observeSize())},beforeDestroy(){this.vscrollParent.$off("vscroll:update",this.onVscrollUpdate),this.vscrollParent.$off("vscroll:update-size",this.onVscrollUpdateSize),this.unobserveSize()},methods:{updateSize(){this.finalActive?this.$_pendingSizeUpdate!==this.id&&(this.$_pendingSizeUpdate=this.id,this.$_forceNextVScrollUpdate=null,this.$_pendingVScrollUpdate=null,this.computeSize(this.id)):this.$_forceNextVScrollUpdate=this.id},updateWatchData(){this.watchData&&!this.vscrollResizeObserver?this.$_watchData=this.$watch("item",(()=>{this.onDataUpdate()}),{deep:!0}):this.$_watchData&&(this.$_watchData(),this.$_watchData=null)},onVscrollUpdate({force:e}){!this.finalActive&&e&&(this.$_pendingVScrollUpdate=this.id),this.$_forceNextVScrollUpdate!==this.id&&!e&&this.size||this.updateSize()},onDataUpdate(){this.updateSize()},computeSize(e){this.$nextTick((()=>{if(this.id===e){const e=this.$el.offsetWidth,t=this.$el.offsetHeight;this.applySize(e,t)}this.$_pendingSizeUpdate=null}))},applySize(e,t){const i=~~("vertical"===this.vscrollParent.direction?t:e);i&&this.size!==i&&(this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=void 0),this.$set(this.vscrollData.sizes,this.id,i),this.$set(this.vscrollData.validSizes,this.id,!0),this.emitResize&&this.$emit("resize",this.id))},observeSize(){this.vscrollResizeObserver&&this.$el.parentNode&&(this.vscrollResizeObserver.observe(this.$el.parentNode),this.$el.parentNode.addEventListener("resize",this.onResize))},unobserveSize(){this.vscrollResizeObserver&&(this.vscrollResizeObserver.unobserve(this.$el.parentNode),this.$el.parentNode.removeEventListener("resize",this.onResize))},onResize(e){const{width:t,height:i}=e.detail.contentRect;this.applySize(t,i)}},render(e){return e(this.tag,this.$slots.default)}},void 0,void 0,void 0,!1,void 0,void 0,void 0),M={version:"1.1.2",install(e,t){const i=Object.assign({},{installComponents:!0,componentsPrefix:""},t);for(const e in i)void 0!==i[e]&&(_[e]=i[e]);i.installComponents&&function(e,t){e.component(`${t}recycle-scroller`,V),e.component(`${t}RecycleScroller`,V),e.component(`${t}dynamic-scroller`,A),e.component(`${t}DynamicScroller`,A),e.component(`${t}dynamic-scroller-item`,C),e.component(`${t}DynamicScrollerItem`,C)}(e,i.componentsPrefix)}};let P=null;"undefined"!=typeof window?P=window.Vue:void 0!==i.g&&(P=i.g.Vue),P&&P.use(M)}}]);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
.vue-recycle-scroller{position:relative}.vue-recycle-scroller.direction-vertical:not(.page-mode){overflow-y:auto}.vue-recycle-scroller.direction-horizontal:not(.page-mode){overflow-x:auto}.vue-recycle-scroller.direction-horizontal{display:-webkit-box;display:-ms-flexbox;display:flex}.vue-recycle-scroller__slot{-webkit-box-flex:1;-ms-flex:auto 0 0px;flex:auto 0 0}.vue-recycle-scroller__item-wrapper{-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;position:relative}.vue-recycle-scroller.ready .vue-recycle-scroller__item-view{position:absolute;top:0;left:0;will-change:transform}.vue-recycle-scroller.direction-vertical .vue-recycle-scroller__item-wrapper{width:100%}.vue-recycle-scroller.direction-horizontal .vue-recycle-scroller__item-wrapper{height:100%}.vue-recycle-scroller.ready.direction-vertical .vue-recycle-scroller__item-view{width:100%}.vue-recycle-scroller.ready.direction-horizontal .vue-recycle-scroller__item-view{height:100%}.resize-observer[data-v-b329ee4c]{position:absolute;top:0;left:0;z-index:-1;width:100%;height:100%;border:none;background-color:transparent;pointer-events:none;display:block;overflow:hidden;opacity:0}.resize-observer[data-v-b329ee4c] object{display:block;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1}
|
|
2
|
+
.search_wrap[data-v-e3b1f382]{flex:1;display:flex;min-height:120px}.search_wrap .search_result_tab[data-v-e3b1f382]{width:260px;border-right:1px solid var(--gray-4);padding:0 20px;position:sticky;top:0;overflow-y:auto;height:100%}.search_wrap .search_result_tab .search_result_tab__sticky[data-v-e3b1f382]{padding-top:16px;padding-bottom:67px}.search_wrap .search_result_tab .search_result_tab_item[data-v-e3b1f382]{display:flex;align-items:center;justify-content:space-between;padding:8px 8px;border-radius:4px;cursor:pointer}.search_wrap .search_result_tab .search_result_tab_item i[data-v-e3b1f382]{margin-right:6px}.search_wrap .search_result_tab .search_result_tab_item .custom-round-number[data-v-e3b1f382]{background-color:var(--gray-4)}.search_wrap .search_result_tab .search_result_tab_item.active[data-v-e3b1f382]{background-color:var(--blue-2);color:var(--blue-6);position:relative}.search_wrap .search_result_tab .search_result_tab_item[data-v-e3b1f382]:hover{background-color:var(--gray-3)}.search_wrap .search_wrap_right[data-v-e3b1f382]{display:flex;flex-direction:column;flex:1;width:0;overflow:auto}.search_wrap .search_wrap_right.search_wrap_right_padding[data-v-e3b1f382]{padding:0 0 20px 20px}.search_wrap .search_wrap_extra[data-v-e3b1f382]{min-height:100px}.search_wrap .search_wrap_extra_item[data-v-e3b1f382]{border-top:1px solid var(--gray-4);padding-top:16px;margin-top:16px}.search_wrap .search_wrap_extra_item[data-v-e3b1f382] .el-select{width:100%}.search_wrap .search_wrap_extra_item[data-v-e3b1f382] .el-select .el-select-dropdown__item{width:100%;display:flex;align-items:baseline}.search_wrap .search_wrap_extra_item[data-v-e3b1f382] .el-select .el-select-dropdown__item .el-tooltip{width:0;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.search_wrap ul[data-v-e3b1f382]{margin:0;padding-left:0}.search_wrap .search_item[data-v-e3b1f382]{display:flex;justify-content:space-between;align-items:center;padding:8px 8px;border-radius:4px;cursor:pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:pointer}.search_wrap .search_item.active[data-v-e3b1f382]{background-color:var(--blue-2);color:var(--blue-6)}.search_wrap .search_item[data-v-e3b1f382]:hover{background-color:var(--gray-3)}.search_wrap .search_item .item_num[data-v-e3b1f382]{display:block;color:var(--gray-7);min-width:40px;text-align:right}.search_wrap .search_item .item_name[data-v-e3b1f382]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.search_wrap .search_item.disabled[data-v-e3b1f382]{cursor:unset}.search_wrap .search_item.disabled[data-v-e3b1f382]:hover{background-color:var(--gray-1)}.search_wrap .search_item.disabled .item_name[data-v-e3b1f382]{color:var(--blue-6)}.search_wrap .show-more[data-v-e3b1f382]{color:var(--blue-6);cursor:pointer;justify-content:center}.search_wrap .show-more[data-v-e3b1f382]:hover{color:var(--blue-7)}.search_summary[data-v-e3b1f382]{padding:16px 0}.search_summary .search_count[data-v-e3b1f382]{font-size:18px;font-weight:500}.search_result_list[data-v-e3b1f382]{flex:1;padding-right:20px}.result_item[data-v-e3b1f382]{min-height:22px}.result_item[data-v-e3b1f382] .el-divider--horizontal{margin:16px 0}.loading-text[data-v-e3b1f382]{color:var(--gray-7);text-align:center;padding:10px 0;white-space:pre}.search_scoll[data-v-e3b1f382]{max-height:250px;overflow-y:auto}
|
|
3
|
+
.issue_info_wrap[data-v-ce460ff0]{display:flex;flex-direction:column;gap:12px;border:1px solid var(--gray-4);border-radius:8px;padding:16px}[data-v-ce460ff0] .highlight{color:var(--red-7);font-style:normal;font-weight:700}.issue_info_top[data-v-ce460ff0]{display:flex;align-items:center;line-height:20px}.issue_title[data-v-ce460ff0]{flex:1;color:var(--gray-9);font-size:16px;font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.issue_title[data-v-ce460ff0]:hover{color:var(--blue-6)}.issue_title .issue_title_content[data-v-ce460ff0]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.issue_state[data-v-ce460ff0]{margin-right:5px}.issue_info_bottom[data-v-ce460ff0]{display:flex;align-items:center}.issue_desc[data-v-ce460ff0]{font-size:14px;line-height:20px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;line-clamp:2;-webkit-box-orient:vertical}.issue_bottom_item[data-v-ce460ff0]{display:flex;align-items:center}.issue_bottom_item[data-v-ce460ff0] .code-avatar{vertical-align:baseline}.issue_bottom_item_name[data-v-ce460ff0]{margin-right:3px}.project_name[data-v-ce460ff0]{color:var(--gray-9)}.project_name[data-v-ce460ff0]:hover{color:var(--blue-6)}.member_tag[data-v-ce460ff0]{margin-left:2px;background-color:var(--gray-4);font-size:12px;padding:0 4px;color:var(--gray-7);width:20px;height:20px;line-height:20px;border-radius:50%;text-align:center;cursor:pointer}.more_member[data-v-ce460ff0]{max-width:160px}
|
|
4
|
+
.branch-popover{padding:4px}
|
|
5
|
+
.code-location[data-v-366c0704]{position:sticky;min-height:22px;top:0;display:flex;justify-content:space-between;align-items:center;gap:20px;height:40px;background-color:var(--gray-3);border-radius:8px 8px 0 0;border:1px solid var(--gray-4);padding:0 22px}.code-location .location_left[data-v-366c0704]{flex:1}.code-location .location_left .toggle-icon[data-v-366c0704]{margin-right:12px}.code-location .location_left[data-v-366c0704] .project_img>div{margin-right:8px !important}.code-location .location_left .file_name[data-v-366c0704]{flex:1}.code-location .location_left .file_name .file_name_content[data-v-366c0704]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.code-location .iconfont-new[data-v-366c0704]{display:inline-block;margin-right:3px}.code-location .location_left[data-v-366c0704],.code-location .location_right[data-v-366c0704]{display:flex;align-items:center}.code-content[data-v-366c0704]{min-height:22px;overflow-x:auto;border-left:1px solid var(--gray-4);border-right:1px solid var(--gray-4);border-top:none;font-size:12px;line-height:20px;color:var(--gray-8);display:flex;align-items:center}.code-content .line-number[data-v-366c0704]{display:inline-block;width:60px;padding-right:12px;text-align:right}.code-content.is-last[data-v-366c0704]{border-bottom:1px solid var(--gray-4);border-bottom-left-radius:8px;border-bottom-right-radius:8px}.line-content[data-v-366c0704]{padding-left:16px;border-left:1px solid var(--gray-4);white-space:break-spaces;overflow:hidden;margin:0;width:calc(100% - 60px);min-height:22px}.expand-more[data-v-366c0704]{display:flex;align-items:center;height:40px;border-radius:0 0 8px 8px;padding:0 22px;cursor:pointer;border:1px solid var(--gray-4)}.code-meta[data-v-366c0704]{margin-top:8px}.link-dark[data-v-366c0704]{font-weight:bold;color:var(--gray-9)}.link-dark[data-v-366c0704]:hover{color:var(--blue-6)}.highlight[data-v-366c0704]{color:var(--gray-10);background-color:#ff0}.lang-label[data-v-366c0704]{background-color:var(--gray-4);font-size:12px;padding:0 6px;line-height:18px;border-radius:4px;color:var(--gray-7)}[data-v-366c0704] .highlight{color:var(--gray-10);background-color:#ff0;font-style:normal;font-weight:700}.repo_name[data-v-366c0704],.branch_name[data-v-366c0704]{cursor:pointer;color:var(--gray-9);display:block;max-width:400px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.location_branches[data-v-366c0704]{max-height:150px;overflow-y:scroll;padding-left:0;cursor:pointer}.branch_item[data-v-366c0704]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.border-radius-8[data-v-366c0704]{border-radius:8px}.file_no_show[data-v-366c0704]{width:100%;text-align:center;padding:16px;border:1px solid var(--gray-4);border-top:0}.file_no_show p[data-v-366c0704]{margin-bottom:0}.file_no_show .download[data-v-366c0704]{margin-top:12px}.el-icon-loading[data-v-366c0704]{margin-right:12px}.blue_text[data-v-366c0704]{color:var(--blue-7);cursor:pointer}
|
|
6
|
+
.code-search__entry[data-v-7a70b4e7]{min-height:100vh;min-width:320px;text-align:center;background:url({{WEBPACK_PUBLIC_PATH_PLACEHOLDER}}images/583df19a86401f3bf2044c2033476fbe.jpg) no-repeat center center;background-size:cover}.code-search__entry .majiancang[data-v-7a70b4e7]{width:100%}.code-search__box[data-v-7a70b4e7]{padding-top:146px;overflow:hidden}.code-search__box .code-search__title[data-v-7a70b4e7]{font-family:Roboto;font-size:40px;font-weight:900}.code-search__box .code-search__input[data-v-7a70b4e7]{padding:0 24px}.code-search__box .code-search__input[data-v-7a70b4e7] .el-input{max-width:660px}.code-search__box .code-search__input[data-v-7a70b4e7] .el-input .el-input__inner{height:40px;padding-left:0;border-left-color:rgba(0,0,0,0)}.code-search__box .code-search__input[data-v-7a70b4e7] .el-input .el-input__inner:focus{border-color:var(--borderColor);border-left-color:rgba(0,0,0,0)}.code-search__box .code-search__input[data-v-7a70b4e7] .el-input .el-input-group__prepend{position:relative;padding:0 10px;background:var(--gray-1)}.code-search__box .code-search__input[data-v-7a70b4e7] .el-input .el-input-group__prepend .iconfont-new{font-size:16px;color:var(--gray-7);cursor:pointer;font-weight:bold}
|
|
7
|
+
.code_global_search[data-v-8426e210],.global_search_result[data-v-8426e210]{height:100%}.global_search_result[data-v-8426e210]{display:flex;flex-direction:column}.global_search_wrap[data-v-8426e210]{display:flex;justify-content:center;background-color:var(--gray-2);padding:16px;border-bottom:1px solid var(--gray-4)}.global_search_wrap .global_search_input[data-v-8426e210]{max-width:1000px}.global_search_wrap[data-v-8426e210] .el-input .el-input__inner{padding-left:0;border-left-color:rgba(0,0,0,0);border-right-color:rgba(0,0,0,0)}.global_search_wrap[data-v-8426e210] .el-input .el-input__inner:focus{border-color:var(--borderColor);border-left-color:rgba(0,0,0,0)}.global_search_wrap[data-v-8426e210] .el-input .el-input-group__prepend{position:relative;padding:0 10px;background:var(--gray-1)}.global_search_wrap[data-v-8426e210] .el-input .el-input-group__prepend .iconfont-new{font-size:16px;color:var(--gray-7);cursor:pointer;font-weight:bold}.global_search_wrap[data-v-8426e210] .el-input .el-input-group__append{position:relative;background:var(--gray-1);color:var(--gray-7);padding:0 15px;font-weight:bold}.global_search_wrap[data-v-8426e210] .el-input .el-input-group__append::before{position:absolute;content:"";left:0;top:15%;height:70%;border-right:1px solid #dededf}.icon-move[data-v-8426e210]{color:var(--gray-6);margin-left:-14px}.tab_label[data-v-8426e210]{cursor:grab;padding:0 10px}.moving[data-v-8426e210]{cursor:grabbing}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_gitee_code_plugin_search=self.webpackChunk_gitee_code_plugin_search||[]).push([[819],{8819:(e,t,a)=>{a.r(t),a.d(t,{default:()=>N});var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"code_global_search"},[e.hasKeywords?a("div",{staticClass:"global_search_result"},[a("div",{staticClass:"global_search_wrap"},[a("el-input",{staticClass:"global_search_input",attrs:{placeholder:e.$t("common.search"),value:e.$route.query.wd},on:{focus:e.handleTrigger}},[a("i",{staticClass:"iconfont-new iconsearch",attrs:{slot:"prepend"},slot:"prepend"}),e._v(" "),a("template",{slot:"append"},[e._v(">_")])],2)],1),e._v(" "),a("keep-alive",[a(e.searchComponent,{ref:e.activeName+"SearchComponent",tag:"component",class:e.activeName+"_comp",attrs:{keywords:e.keywords},on:{search:e.handleSearch}})],1)],1):a("div",[a("GlobalSearchEntry")],1)])};s._withStripped=!0;var i=function(){var e=this,t=e.$createElement;return(e._self._c||t)("CommonSearch",{attrs:{keywords:e.keywords,"total-count":e.totalCount,"spend-time":e.spendTime,"search-array":e.searchArray,"item-component":e.itemComponent,"table-data":e.tableData,loading:e.loading,"load-end":!0,params:e.params,page:e.page,pagination:e.pagination},on:{search:e.handleSearch,action:e.handleRowAction}})};i._withStripped=!0;var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"search_wrap"},[e.isGlobalSearch?a("div",{staticClass:"search_result_tab"},[a("div",{staticClass:"search_result_tab__sticky"},[a("div",[a("CommonTitle",{attrs:{"font-size":14}},[e._v(e._s(e.$t("dashboard.filter_result")))]),e._v(" "),e._l(e.tabArr,(function(t){return a("div",{key:t.code,staticClass:"search_result_tab_item",class:{active:e.activeName===t.code},on:{click:function(a){e.activeName=t.code}}},[a("span",[t.showMove?a("i",{staticClass:"iconfont-new icon-move"}):e._e(),e._v(" "),a("i",{class:t.icon}),e._v("\n "+e._s(t.name)+"\n ")])])}))],2),e._v(" "),e.searchArray.length?a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.searchArrayLoading,expression:"searchArrayLoading"}],staticClass:"search_wrap_extra"},[e._l(e.searchArray,(function(t){return[t.onlyInput&&t.visible||t.defaultChildren&&t.defaultChildren.length>0?a("div",{key:t.value,staticClass:"search_wrap_extra_item mt-2 pt-2"},[a("CommonTitle",{attrs:{"font-size":14}},[a("div",[e._v("\n "+e._s(t.name)+"\n "),t.tips?a("el-tooltip",{attrs:{placement:"top",content:t.tips}},[a("i",{staticClass:"iconfont-new iconremark cursor-pointer ml-1"})]):e._e()],1)]),e._v(" "),t.filter?a("el-input",{staticClass:"mb-1",attrs:{disabled:!e.loadEnd,size:"medium",clearable:"","suffix-icon":"el-icon-search",placeholder:t.filterPlaceholder},on:{input:function(e){return t.handleInput(e,t)}},model:{value:t.filterWord,callback:function(a){e.$set(t,"filterWord",a)},expression:"item.filterWord"}}):e._e(),e._v(" "),"select"===t.type?a("el-select",{staticStyle:{width:"240px"},attrs:{multiple:"",filterable:"","collapse-tags":"",placeholder:e.$t("please_select"),"filter-method":e.filterRepoCode,"popper-append-to-body":!1},on:{"visible-change":e.changeSelect,"remove-tag":e.repoChange},model:{value:e.repoCode,callback:function(t){e.repoCode=t},expression:"repoCode"}},e._l(t.children,(function(t){return a("el-option",{key:t.identity,attrs:{label:t.name,value:t.identity}},[a("el-tooltip",{attrs:{content:t.name}},[a("div",[e._v(e._s(t.name))])])],1)})),1):a("ul",{staticClass:"search_list",class:{search_scoll:t.childrenScroller},on:{scroll:function(a){return e.handleSearchScroll(a,t)}}},[e._l(t.children,(function(s,i){return a("li",{key:i,staticClass:"search_item",class:{active:s.active,disabled:t.disabled},on:{click:function(a){return e.handleSearch(t,s)}}},[a("el-tooltip",{attrs:{"show-overflow-tooltip":t.showOverflowTooltip,content:s.tooltipName||s.name,placement:"top"}},[a("span",{staticClass:"item_name"},["languages"===t.value?a("LanguageColorDot",{attrs:{name:s.name}}):[e._v(e._s(s.name))]],2)]),e._v(" "),s.active?a("i",{staticClass:"iconfont-new icondelete-"}):[a("span",{directives:[{name:"show",rawName:"v-show",value:e.loadEnd,expression:"loadEnd"}],staticClass:"item_num"},[e._v(e._s(s.num))]),e._v(" "),a("i",{directives:[{name:"show",rawName:"v-show",value:!e.loadEnd&&t.hasNumLoading,expression:"!loadEnd && item.hasNumLoading"}],staticClass:"el-icon-loading"})]],2)})),e._v(" "),t.hasMore&&!t.childrenScroller?a("li",{staticClass:"search_item show-more",on:{click:function(a){return e.handleShowMore(t)}}},[e._v(e._s(e.$t("dashboard.show_more")))]):e._e()],2),e._v(" "),a(t.listBottomComp&&t.listBottomComp(),{tag:"component",staticClass:"search_item show-more"})],1):e._e()]}))],2):e._e()])]):e._e(),e._v(" "),a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading&&(e.page<=1&&!e.pagination||e.pagination),expression:"loading && (page <= 1 && !pagination || pagination)"}],staticClass:"search_wrap_right",class:{search_wrap_right_padding:e.isGlobalSearch}},[e.showResultNoData?a("NoData"):[e.tableData.length>0?a("div",{staticClass:"search_summary"},[e.totalCount?a("span",{staticClass:"search_count"},[e._v("\n "+e._s(e.$t("dashboard.search_result",{totalCount:e.totalCount}))+"\n ")]):e._e()]):e._e(),e._v(" "),e.dynamicScroll?a("DynamicScroller",{ref:"dynamicScroller",staticClass:"search_result_list",attrs:{items:e.tableData,"min-item-size":e.minItemSize,"key-field":e.keyField},nativeOn:{scroll:function(t){return e.handleScroll.apply(null,arguments)}},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.item,i=t.index,n=t.active;return[a("DynamicScrollerItem",{staticClass:"result_item",attrs:{item:s,active:n,"data-index":i,"size-dependencies":e.getSizeDependencies(s)}},[e.itemComponent?[a(e.itemComponent,{tag:"component",attrs:{"row-data":s,keywords:e.keywords},on:{action:e.handleAction,"dependenc-change":e.handleDependencChange}})]:e._e()],2)]}}],null,!1,1522311884)}):a("ul",{staticClass:"search_result_list"},e._l(e.tableData,(function(t){return a("li",{key:t.id||t.key,staticClass:"result_item"},[e.itemComponent?[a(e.itemComponent,{tag:"component",attrs:{"row-data":t,keywords:e.keywords},on:{action:e.handleAction,"dependenc-change":e.handleDependencChange}})]:e._e()],2)})),0),e._v(" "),e.pagination?a("el-pagination",{attrs:{"hide-on-single-page":!1,"current-page":e.pagination.page,"page-size":e.pagination.per_page,"page-sizes":[10,20,30,40],layout:e.pagination.layout||"prev, adaption, next, jumper, sizes",total:e.pagination.count},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}}):e._e(),e._v(" "),e.moreLoading&&!e.pagination?a("li",{staticClass:"loading-text"},[e._v("\n "+e._s(e.$t("loading"))),a("i",{staticClass:"el-icon-loading"})]):e._e()]],2)])};n._withStripped=!0;var r=a(7007),o=a(8140);const l={name:"CommonSearch",mixins:[o.Z],components:{LanguageColorDot:window.comps.LanguageColorDot,DynamicScroller:r.cV,DynamicScrollerItem:r.Wk},props:{itemComponent:{type:Object},tableData:{type:Array,default:()=>[]},totalCount:{type:Number,default:0},spendTime:{type:Number,default:0},searchArray:{type:Array,default:()=>[]},searchArrayLoading:{type:Boolean,default:!1},keywords:{type:String,default:""},loading:{type:Boolean,default:!1},loadEnd:{type:Boolean,default:!1},moreLoading:{type:Boolean,default:!1},params:{type:Object,default:()=>({})},type:{type:String,default:""},pagination:{type:Object,default:null},page:{type:Number,default:1},dynamicScroll:{type:Boolean,default:!1},minItemSize:{type:Number},getSizeDependencies:{type:Function,default:()=>[]},keyField:{type:String,default:"id"}},data:()=>({leftSideHeight:0,repoCode:"",activeName:"",listHeight:1e3}),computed:{isGlobalSearch(){return"company#search"===this.$route.name},usedTime(){return this.spendTime<1e3?`${this.spendTime}ms`:`${(this.spendTime/1e3).toFixed(2)}s`},hasSearchParams(){return Object.values(this.params).filter((e=>e)).length>0},showPageNoData(){return!this.loading&&0===this.tableData.length&&!this.hasSearchParams},showResultNoData(){return!this.loading&&0===this.tableData.length},leftSideStyle(){return{height:`${this.leftSideHeight}px`}}},watch:{params:{handler(e){e&&!e.project_ids&&(this.repoCode="")}},activeName(e){this.$store.commit("dashboard/setActiveTab",e)}},activated(){this.activeName=this.$store.getters["dashboard/getActiveTab"]},mounted(){this.isGlobalSearch&&(window.addEventListener("resize",this.getLeftSideStyle),this.getLeftSideStyle())},beforeDestroy(){this.isGlobalSearch&&window.removeEventListener("resize",this.getLeftSideStyle)},methods:{getLeftSideStyle(){const{top:e}=document.querySelector(".code-app .code-app-layout").getBoundingClientRect();this.leftSideHeight=document.documentElement.clientHeight-e},handleAction(...e){this.$emit("action",...e)},handleSearch(e,t){if(e.disabled||!this.loadEnd)return;const a={...this.getParams()};e.multiple?t.active?a[e.paramsKey]=a[e.paramsKey].filter((e=>e!==t.identity)):(a[e.paramsKey]||(a[e.paramsKey]=[]),a[e.paramsKey].push(t.identity)):a[e.paramsKey]=t.active?"":t.identity,this.$emit("search",a,e),this.$root.$el.querySelector(".ent-resource-body").scrollTop=0},handleShowMore(e){!e.disabled&&this.loadEnd&&e.handleShowMore(e)},getParams(){const e={};return this.searchArray.forEach((t=>{if(t.multiple){const a=t.children.filter((e=>e.active));e[t.paramsKey]=a.map((e=>e.identity))}else if(t.onlyInput)e[t.paramsKey]=t.filterWord;else{const a=t.children.find((e=>e.active));e[t.paramsKey]=a?.identity||""}})),e},filterRepoCode(e){this.$emit("update:repoSearchWord",e)},changeSelect(e){e||this.repoChange()},repoChange(){const e={...this.getParams(),project_ids:this.repoCode.join(",")};this.$emit("search",e)},handleSizeChange(e){this.$emit("action","changeSize",e,this.pagination.page>Math.ceil(this.pagination.count/e))},handleCurrentChange(e){this.$emit("action","changeCurrent",e)},handleToggle(e,t){this.$emit("action","handleToggle",e,t)},handleDependencChange(e,t){this.$emit("dependenc-change",e,t)},handleScroll:window.GITEE.tools.debounce((function(e){const{scrollTop:t,clientHeight:a,scrollHeight:s}=e.target;s-(t+a)<50&&this.$emit("action","loadMore")}),300),handleSearchScroll:window.GITEE.tools.debounce((function(e,t){if(!t.childrenScroller||!t.hasMore)return;const{scrollTop:a,clientHeight:s,scrollHeight:i}=e.target;i-(a+s)<50&&this.handleShowMore(t)}),300)}};var h=a(1900);const c=(0,h.Z)(l,n,[],!1,null,"e3b1f382",null).exports,d={name:"SearchProjects",components:{CommonSearch:c},mixins:[o.Z],props:{keywords:{type:String,default:""}},data(){return{page:1,per_page:20,totalCount:0,totalPage:0,tableData:[],spendTime:0,itemComponent:GITEE.components.ProjectItem,searchArray:[{name:this.$t("type"),value:"project_types",paramsKey:"type",showOverflowTooltip:!0,children:[],defaultChildren:[]},{name:this.$t("common.language"),value:"languages",paramsKey:"lang_id",showOverflowTooltip:!0,children:[],defaultChildren:[]},{name:this.$t("groups.repo_groups"),value:"top_groups",paramsKey:"top_group_path",showOverflowTooltip:!0,children:[],defaultChildren:[]}],params:{type:null,lang_id:null,top_group_path:null},loading:!1}},computed:{pagination(){return{page:this.page,per_page:this.per_page,count:this.totalCount,layout:"prev, adaption, next, sizes"}}},methods:{handleSearch(e){this.assignParams(e,this.searchArray),this.tableData=[],this.page=1,this.getProjectList()},getProjectList(){this.loading=!0,this.api.dashboard.getProjects({params:{page:this.page,per_page:this.per_page,keyword:this.keywords,...this.params},noCancel:!0}).then((({data:e})=>{this.spendTime=e.data.total_time,this.totalCount=e.meta.total_count,this.totalPage=e.meta.total_pages;const t=e.data.list?.map((e=>({...e,full_name:this.deleteEnterpriseLevel(e.full_name)})))||[];this.tableData=t,this.keywords&&["project_types","languages","top_groups"].forEach((t=>{const a=this.searchArray.findIndex((e=>e.value===t)),s=[];e.data[t]?.forEach((e=>{s.push({...e,active:e.identity===this.params[this.searchArray[a].paramsKey]})})),this.$set(this.searchArray[a],"children",s),this.$set(this.searchArray[a],"defaultChildren",s)})),1===this.page&&window.eventHub.$emit(this.EVENT_HUB_NAME.SEARCH_WORD)})).finally((()=>{this.loading=!1}))},hasMore(){return this.page<this.totalPage},handleFavorite(e){const t=this.tableData.find((t=>t.id===e.id));t&&Object.assign(t,e)},changeSize(e,t){this.per_page=e,t||this.getProjectList()},changeCurrent(e){this.page=e,this.getProjectList()},getSizeDependencies:e=>[e.descHtml],handleDependencChange(e,t){const a=this.tableData.findIndex((t=>t.id===e.id));a>-1&&this.$set(this.tableData[a],"descHtml",t)}}},p=(0,h.Z)(d,i,[],!1,null,null,null).exports;var u=function(){var e=this,t=e.$createElement;return(e._self._c||t)("CommonSearch",{attrs:{keywords:e.keywords,"total-count":e.totalCount,"spend-time":e.spendTime,"search-array":e.searchArray,"item-component":e.itemComponent,"table-data":e.tableData,loading:e.loading,"load-end":!0,params:e.params,page:e.page,pagination:e.pagination},on:{search:e.handleSearch,action:e.handleRowAction}})};u._withStripped=!0;var m=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"issue_info_wrap mb-2"},[a("router-link",{staticClass:"project_name fs-12 fw-500",attrs:{target:"_blank",to:{name:"project#code",params:{0:e.rowData.project.full_path}}}},[a("el-tooltip",{attrs:{"show-overflow-tooltip":"",content:e.displayFullPath}},[a("div",{staticClass:"truncate"},[e._v(e._s(e.displayFullPath))])])],1),e._v(" "),a("div",{staticClass:"issue_info_top"},[a("IssueStateIcon",{staticClass:"issue_state",attrs:{size:14,state:e.rowData.state}}),e._v(" "),a("router-link",{staticClass:"issue_title",attrs:{target:"_blank",to:{name:"project#issues#detail",params:e.issueDetailParams}}},[a("el-tooltip",{attrs:{"show-overflow-tooltip":""}},[a("div",{attrs:{slot:"content"},domProps:{innerHTML:e._s(e.rowData.highlight_title)},slot:"content"}),e._v(" "),a("div",{staticClass:"issue_title_content",domProps:{innerHTML:e._s(e.rowData.highlight_title)}})])],1)],1),e._v(" "),e.descHtml?a("div",{staticClass:"issue_desc",domProps:{innerHTML:e._s(e.descHtml)}}):e._e(),e._v(" "),a("div",{staticClass:"issue_info_bottom text-muted fs-12"},[e.rowData.author?a("span",{staticClass:"issue_bottom_item"},[a("Avatar",{attrs:{url:e.rowData.author.avatar_url,name:e.rowData.author.name,"show-name":!0}}),e._v(" "),a("span",{staticClass:"ml-1 mr-1"},[e._v("·")])],1):e._e(),e._v(" "),a("span",[a("i",{staticClass:"iconfont-new icon-comment"}),e._v("\n "+e._s(e.rowData.noteable_count||0)+"\n "),a("span",{staticClass:"ml-1 mr-1"},[e._v("·")])]),e._v(" "),e.rowData.created_at?a("span",{staticClass:"issue_create_time"},[e._v("\n "+e._s(e.$t("pulls.created_at"))+"\n "),a("timeago",{attrs:{tooltip:"",since:e.rowData.created_at}}),e._v(" "),a("span",{staticClass:"ml-1 mr-1"},[e._v("·")])],1):e._e(),e._v(" "),a("span",[e._v("\n "+e._s("#"+e.rowData.ident)+"\n ")])])],1)};m._withStripped=!0;const g={name:"IssueItem",props:{rowData:{type:Object}},data:()=>({descHtml:""}),computed:{issueDetailParams(){return{...this.params0,0:this.rowData.project.full_path,issue_ident:this.rowData.ident}},showCollaborators(){return this.rowData.collaborators.slice(0,3)},moreCollaborators(){return this.rowData.collaborators.slice(3)},displayFullPath(){return this.deleteEnterpriseLevel(this.rowData.project.full_path)}},created(){this.getIssueDesc()},methods:{getIssueDesc(){this.descHtml=Array.isArray(this.rowData.description)?this.rowData.description.join("..."):res,this.$emit("dependenc-change",this.rowData,this.descHtml)}}},_=(0,h.Z)(g,m,[],!1,null,"ce460ff0",null).exports,f={name:"SearchIssues",components:{CommonSearch:c},mixins:[o.Z],props:{keywords:{type:String,default:""}},data(){return{page:1,per_page:20,totalCount:0,totalPage:0,tableData:[],spendTime:0,itemComponent:_,searchArray:[{name:this.$t("repo"),value:"projects",paramsKey:"project_id",showOverflowTooltip:!0,children:[],defaultChildren:[]}],params:{project_id:""},loading:!1}},computed:{pagination(){return{page:this.page,per_page:this.per_page,count:this.totalCount,layout:"prev, adaption, next, sizes"}}},methods:{handleSearch(e){this.assignParams(e,this.searchArray),this.tableData=[],this.page=1,this.getIssueList()},getIssueList(){this.loading=!0,this.api.dashboard.getIssues({params:{page:this.page,per_page:this.per_page,keyword:this.keywords,...this.params},noCancel:!0}).then((({data:e})=>{this.spendTime=e.data.total_time,this.totalCount=e.meta.total_count,this.totalPage=e.meta.total_pages;const t=e.data.list?.map((e=>({...e,project:{...e.project,full_name:this.deleteEnterpriseLevel(e.project.full_name)}})))||[];if(this.tableData=t,this.keywords){const t=[];e.data.projects?.forEach((e=>{t.push({...e,active:e.identity===this.params.project_id})})),this.$set(this.searchArray[0],"children",t),this.$set(this.searchArray[0],"defaultChildren",t)}1===this.page&&window.eventHub.$emit(this.EVENT_HUB_NAME.SEARCH_WORD)})).finally((()=>{this.loading=!1}))},hasMore(){return this.page<this.totalPage},changeSize(e,t){this.per_page=e,t||this.getIssueList()},changeCurrent(e){this.page=e,this.getIssueList()},getSizeDependencies:e=>[e.descHtml],handleDependencChange(e,t){const a=this.tableData.findIndex((t=>t.ident===e.ident));a>-1&&this.$set(this.tableData[a],"descHtml",t)}}},w=(0,h.Z)(f,u,[],!1,null,null,null).exports;var y=function(){var e=this,t=e.$createElement;return(e._self._c||t)("CommonSearch",{ref:"commonSearch",attrs:{type:"code",keywords:e.keywords,"total-count":e.totalCount,"spend-time":e.spendTime,"search-array":e.searchArray,"search-array-loading":e.searchArrayLoading,"item-component":e.itemComponent,"table-data":e.tableData,loading:e.loading,"load-end":e.loadEnd,"more-loading":e.moreLoading,"repo-search-word":e.repoSearchWord,params:e.params,page:e.page,"min-item-size":22,"dynamic-scroll":!0,"key-field":"key"},on:{"update:repoSearchWord":function(t){e.repoSearchWord=t},"update:repo-search-word":function(t){e.repoSearchWord=t},search:e.handleSearch,action:e.handleRowAction}})};y._withStripped=!0;var v=function(){var e=this,t=e.$createElement,a=e._self._c||t;return"file-header"===e.rowData.type?a("div",{staticClass:"code-location",class:{"border-radius-8":!e.rowData.visible||e.rowData.noContent}},[a("span",{staticClass:"location_left truncate"},[a("i",{staticClass:"iconfont-new toggle-icon cursor-pointer",class:[e.rowData.visible?"icondown":"iconright"],on:{click:e.handleToggle}}),e._v(" "),e.rowData.contentLoading?a("i",{staticClass:"el-icon-loading"}):e._e(),e._v(" "),e.isProjectPage?e._e():[a("ProjectListItemImg",{staticClass:"project_img",attrs:{"font-size":14,size:24,"row-data":e.repoAvatarData}}),e._v(" "),a("el-tooltip",{attrs:{"show-overflow-tooltip":"",content:e.rowData.data.project.full_name}},[a("router-link",{staticClass:"repo_name link-dark",attrs:{target:"_blank",to:{name:"project#code",params:{0:e.rowData.data.project.full_path}}}},[e._v("\n "+e._s(e.deleteEnterpriseLevel(e.rowData.data.project.full_path))+"\n ")])],1),e._v(" "),a("span",{staticClass:"ml-half mr-half"},[e._v("·")])],e._v(" "),a("router-link",{staticClass:"file_name text-black truncate",attrs:{target:e.target,to:{name:"project#blob",params:Object.assign({},{branch:e.branch},e.params)}},nativeOn:{click:function(t){return e.resetSearchKeyword.apply(null,arguments)}}},[a("el-tooltip",{attrs:{"show-overflow-tooltip":""}},[a("div",{attrs:{slot:"content"},domProps:{innerHTML:e._s(e.rowData.data.html_content)},slot:"content"}),e._v(" "),a("div",{staticClass:"file_name_content",domProps:{innerHTML:e._s(e.rowData.data.html_content)}})])],1)],2),e._v(" "),a("span",{staticClass:"location_right"},[e.rowData.data.language?[a("LanguageColorDot",{attrs:{name:e.rowData.data.language}}),e._v(" "),a("span",{staticClass:"ml-1 mr-1"},[e._v("·")])]:e._e(),e._v(" "),a("el-popover",{attrs:{width:"100",trigger:"hover","popper-class":"branch-popover",placement:"bottom-end","append-to-body":!0,"close-delay":300,disabled:e.rowData.data.branches.length<=1}},[a("ul",{staticClass:"location_branches"},e._l(e.rowData.data.branches,(function(t){return a("li",{key:t},[a("router-link",{attrs:{target:"_blank",to:{name:"project#blob",params:Object.assign({},{branch:t},e.params)}}},[a("el-tooltip",{staticClass:"branch_item",attrs:{effect:"dark",content:t,"show-overflow-tooltip":""}},[a("div",{staticClass:"item"},[a("i",{staticClass:"iconfont-new iconbranch"}),e._v("\n "+e._s(t)+"\n ")])])],1)],1)})),0),e._v(" "),a("router-link",{staticClass:"branch_name",attrs:{slot:"reference",target:"_blank",to:{name:"project#blob",params:Object.assign({},{branch:e.branch},e.params)}},slot:"reference"},[a("el-tooltip",{attrs:{content:e.branch,"show-overflow-tooltip":""}},[a("span",[a("i",{staticClass:"iconfont-new iconbranch"}),e._v("\n "+e._s(e.branch)+"\n ")])])],1)],1)],2)]):"code-line"===e.rowData.type?a("div",{staticClass:"code-content",class:{"is-last":e.rowData.data.isLast}},[a("code",{staticClass:"line-number"},[e._v(e._s(e.rowData.data.line.line_num))]),e._v(" "),a("pre",{staticClass:"line-content"},[a("code",{domProps:{innerHTML:e._s(e.rowData.data.html_content)}})])]):"toggle-line"===e.rowData.type?a("div",{staticClass:"expand-more",on:{click:e.handleShowMore}},[a("i",{staticClass:"iconfont-new font14 mr-2",class:[e.rowData.showMore?"icondoubletop-top":"icondouble-bottom"]}),e._v("\n "+e._s(e.showMoreBtnText)+"\n")]):"abnormal-file"===e.rowData.type&&e.contentMessage.text&&!e.rowData.showMore?a("div",{staticClass:"file_no_show"},[a("p",[e._v(e._s(e.contentMessage.text))]),e._v(" "),e.isMarkDownTooBig?[e._v("\n "+e._s(e.$t("code.click"))+"\n "),a("strong",{staticClass:"blue_text",on:{click:e.handleLoadBigMarkDown}},[e._v(e._s(e.$t("code.continue_loading")))]),e._v("\n "+e._s(e.$t("code.or"))+"\n ")]:e._e(),e._v(" "),e.contentMessage.showDownload?a("a",{staticClass:"download",attrs:{href:e.contentMessage.href,target:e.contentMessage.target,download:e.fileContent.path},on:{click:e.downloadLFSFile}},[a("strong",[e._v(e._s(e.$t("download"))+" ("+e._s(e._f("fileSize")(e.contentMessage.size))+")")])]):e._e()],2):"empty-line"===e.rowData.type?a("div",{staticStyle:{height:"16px"}}):e._e()};v._withStripped=!0;const C={name:"CodeItem",filters:{fileSize:window.GITEE.tools.fileSizeFilter},components:{LanguageColorDot:window.comps.LanguageColorDot},props:{rowData:{type:Object}},data:()=>({showMoreCount:15}),computed:{branch(){return this.rowData.data.branches[0]},fileContent(){return this.rowData.data.fileContent||{}},target:()=>window.GITEE.tools.inProjectPage()?"_self":"_blank",rowMatches(){return this.rowData.contents?.filter((e=>0!==e.line_num))},showRowMatches(){return this.rowData.showMore?this.rowMatches:this.rowMatches.slice(0,this.showMoreCount)},repoName(){const e=this.rowData.data.project.full_name.split("/");return e[e.length-1]},params(){return window.GITEE.tools.inOneProgramPage()?{...this.params0,0:this.rowData.data.file_path}:{...this.params0,0:this.rowData.data.project.full_path,1:this.rowData.data.file_path}},showMoreBtnText(){return this.rowData.showMore?this.$t("code.code_search.collapse_all"):this.$t("code.code_search.expand_all")},repoAvatarData(){return{icon_url:this.rowData.data.project.icon_url,icon_color:this.rowData.data.project.icon_color,name:this.repoName}},isMarkDownTooBig(){return this.fileContent&&this.fileContent.is_markdown&&this.fileContent.size>102400&&this.fileContent.size<=1048576},tooBigText(){return this.fileContent&&this.fileContent.too_big_text},fileRawPathDownload(){return`${GITEE.api.API_GO_BASEURL}/api/${this.rowData.data.full_path}/-/${encodeURIComponent(this.rowData.data.branch)}/blobs/display?path=${encodeURIComponent(this.fileContent.path)}&is_download=1`},contentMessage(){const e=this.fileContent;if(!e)return{};let t="",a=!1,s=e.size,i=this.fileRawPathDownload,n="_blank";return e.is_lfs_file?void 0!==e.file_type&&(t=this.$t("code.new.preview_file_not_supported"),a=!0,s=e.lfs_size,i="javascript:void(0)",n=null):"text"===e.file_type?e.empty_text?t=this.$t("code.new.empty_file"):this.isMarkDownTooBig?(t=this.$t("code.too_big_md_tips"),a=!0):this.tooBigText&&(t=this.$t("code.new.more_file_not_supported"),a=!0):(t=this.$t("code.new.preview_file_not_supported"),"image"!==e.file_type&&(a=!0)),{text:t,size:s,href:i,showDownload:a,target:n}}},methods:{handleShowMore(){this.$emit("action","handleShowMore",this.rowData,!this.rowData.showMore)},handleToggle(){this.$emit("action","handleToggle",this.rowData,!this.rowData.visible),this.$emit("dependenc-change",this.rowData,this.rowData.showMore)},resetSearchKeyword(){this.isProjectPage&&window.eventHub.$emit(this.EVENT_HUB_NAME.RESET_SEARCH_KEYWORD)},downloadLFSFile(){this.fileContent&&this.fileContent.is_lfs_file&&void 0!==this.fileContent.file_type&&window.$http.get(`${GITEE.api.API_GO_BASEURL}/api/${this.rowData.data.full_path}/-/lfs_files/${this.fileContent.lfs_oid}/download`,{params:{filename:this.fileContent.name}}).then((({data:e})=>{e.download_path&&window.open(e.download_path,"_blank")}))},handleLoadBigMarkDown(){this.$emit("action","handleShowMore",this.rowData,!this.rowData.showMore)}}},b=(0,h.Z)(C,v,[],!1,null,"366c0704",null).exports;var S=function(){var e=this,t=e.$createElement;return(e._self._c||t)("router-link",{staticClass:"repo_name link-dark",attrs:{to:{name:"project#search",params:{0:e.full_path}},target:"_blank"}},[e._v("\n "+e._s(e.$t("dashboard.no_search_branch"))+"\n")])};S._withStripped=!0;const D={name:"LinkToRepoSearch",props:{full_path:String}},$=(0,h.Z)(D,S,[],!1,null,null,null).exports;let E=0;const k={name:"SearchCode",components:{CommonSearch:c},mixins:[o.Z],props:{keywords:{type:String,default:""}},data:()=>({totalCount:0,originTotalCount:0,fullData:[],hiddenFiles:[],toggledFiles:[],spendTime:0,itemComponent:b,page:1,per_page:20,loading:!1,timer:null,searchLanguages:[],searchProjects:[],repoSearchWord:"",params:{project_ids:"",languages:"",branches:"",path:""},evtSource:null,evtSourceEvents:{filters:"getFilters",progress:"getProgress",matches:"getMatches",done:"closeEventSource",error:"closeEventSource"},searchArray:[],searchArrayLoading:!1,loadEnd:!1,fullBranch:{},dbRequest:null,db:null,initGetData:!0}),computed:{tableData(){return this.fullData.filter((e=>{const t=!this.params.languages||e.data.language===this.params.languages,a=!this.params.project_ids?.length||this.params.project_ids.includes(e.data.projectId);let s=!0;"code-line"===e.type&&(this.hiddenFiles.includes(e.fileKey)&&(s=!1),this.toggledFiles.includes(e.fileKey)&&(this.fileIsMdTooBig(e.data.fileContent)||e.data.toggleIndex>14)&&(s=!1));const i="toggle-line"!==e.type||!this.hiddenFiles.includes(e.fileKey),n="abnormal-file"!==e.type||!this.hiddenFiles.includes(e.fileKey);return t&&a&&s&&i&&n}))},isGlobalSearch(){return"company#search"===this.$route.name},projectsData(){return this.searchProjects?.filter((e=>e.name.indexOf(this.repoSearchWord)>-1)).slice(0,20)},scrollWrapperDom(){const e=this.isGlobalSearch?".ent-resource-body":".ent-project-bread .tree-holder";return document.querySelector(`.code-app ${e}`)},isEnd(){return this.totalCount<=this.tableData.length},moreLoading(){return this.loading&&this.page>1}},watch:{keywords(){this.searchArrayInit()}},created(){this.searchArrayInit()},beforeDestroy(){this.closeEventSource()},methods:{searchArrayInit(){this.searchArray=this.isGlobalSearch?[{name:this.$t("common.language"),value:"languages",paramsKey:"languages",children:[],defaultChildren:[],filterChildren:[],childrenScroller:!0,childrenSlice:20,showOverflowTooltip:!0,transfer:e=>({...e,identity:e.name}),hasMore:!1,handleShowMore:this.handleShowMoreSearchItem,hasNumLoading:!0,filter:!0,filterWord:"",handleInput:this.handleFilterSearchItem,filterPlaceholder:this.$t_join("please_enter","language"),sort_by:"num"},{name:this.$t("code_repo"),value:"projects",paramsKey:"project_ids",multiple:!0,children:[],childrenScroller:!0,itemSize:41,defaultChildren:[],filterChildren:[],childrenSlice:20,showOverflowTooltip:!1,transfer:e=>{const t=e.full_name.split("/"),a=t[t.length-1],s=e.full_path.split("/"),i=s[s.length-1];return{...e,name:a,path:i,tooltipName:e.full_name,identity:e.id}},hasMore:!1,handleShowMore:this.handleShowMoreSearchItem,filter:!0,filterWord:"",handleInput:this.handleFilterSearchRepoItem,filterPlaceholder:this.$t("groups.search_tree_placeholder")},{name:"分支",value:"branches",paramsKey:"branches",multiple:!0,filter:!0,children:[],childrenScroller:!0,itemSize:41,defaultChildren:[],filterChildren:[],childrenSlice:20,showOverflowTooltip:!1,filterPlaceholder:"请输入分支",listBottomComp:()=>{if(1===this.params.project_ids.length){const e=this.searchArray.findIndex((e=>"projects"===e.value)),t=this.searchArray[e].children.find((e=>e.id===this.params.project_ids[0]));return{components:{LinkToRepoSearch:$},template:`<LinkToRepoSearch :full_path="'${t.full_path}'" />`}}return null},handleShowMore:this.handleShowMoreSearchItem,filterWord:"",handleInput:this.handleFilterSearchItem},{name:"路径",value:"path",paramsKey:"path",filter:!0,onlyInput:!0,visible:!1,children:[],filterWord:"",handleInput:this.handleInputPath,filterPlaceholder:"请输入路径"}]:[]},updateSearchItem(e,t=!1){t?this.$set(e,"children",e.filterChildren.slice(0,e.childrenSlice)):this.$set(e,"children",e.children.concat(e.filterChildren.slice(e.children.length,e.children.length+e.childrenSlice))),this.$set(e,"hasMore",e.filterChildren.length>e.children.length)},handleFilterSearchItem:window.GITEE.tools.debounce((function(e,t){this.$set(t,"filterChildren",e?t.defaultChildren.filter((t=>t.name.toUpperCase().indexOf(e.toUpperCase())>-1)):t.defaultChildren.slice(0)),this.updateSearchItem(t,!0)}),100),handleFilterSearchRepoItem:window.GITEE.tools.debounce((function(e,t){this.$set(t,"filterChildren",e?t.defaultChildren.filter((t=>t.name.toUpperCase().indexOf(e.toUpperCase())>-1||t.path.toUpperCase().indexOf(e.toUpperCase())>-1)):t.defaultChildren.slice(0)),this.updateSearchItem(t,!0)}),100),handleInputPath(e,t){this.params.path=e,this.handleSearch(this.params,t)},handleShowMoreSearchItem(e){this.updateSearchItem(e)},handleSearch(e,t){if(e){if("projects"===t.value){e.branches="";let t=[];e.project_ids&&e.project_ids.forEach((e=>{t.push(...this.fullBranch[e])})),t=[...new Set(t)].sort().map((e=>({name:e.replace("heads/",""),active:!1,identity:e})));const a=this.searchArray.findIndex((e=>"branches"===e.value));this.$set(this.searchArray,a,{...this.searchArray[a],filterWord:"",defaultChildren:t,filterChildren:t}),this.updateSearchItem(this.searchArray[a],!0)}if(["projects","branches"].includes(t.value)){e.path="";const t=this.searchArray.findIndex((e=>"path"===e.value));this.$set(this.searchArray,t,{...this.searchArray[t],visible:e.branches&&e.branches.length,filterWord:""})}}this.db?(this.assignParams(e,this.searchArray),this.resetCodeList(e)):this.initIndexDb((()=>{this.assignParams(e,this.searchArray),this.resetCodeList()}))},resetCodeList(e){E=0,this.fullData=[],this.toggledFiles=[],this.totalCount=0,this.page=1,e?this.getData():(this.initGetData=!0,this.getCodeList())},closeEventSource(){this.loading&&(this.loading=!1),this.loadEnd||(this.loadEnd=!0),this.searchArrayLoading&&(this.searchArrayLoading=!1),this.evtSource&&(this.evtSource.close(),Object.keys(this.evtSourceEvents).forEach((e=>{this.evtSource.removeEventListener(e,this[this.evtSourceEvents[e]])})),this.evtSource=null)},getFilters(e){if(this.params.languages||this.params.project_ids)return;this.searchArrayLoading=!1;const t=JSON.parse(e.data);this.searchArray.map((e=>e.value)).forEach(((e,a)=>{const s=this.searchArray[a],i=t[e]?.map((e=>s.transfer(e)))||[];s.hasOwnProperty("sort_by")&&s.sort_by&&i.sort(((e,t)=>t[s.sort_by]-e[s.sort_by])),this.$set(s,"defaultChildren",i),this.$set(s,"filterChildren",i),this.updateSearchItem(s,!0)}))},getProgress(e){const t=JSON.parse(e.data);this.spendTime=t.elapsedTime,this.totalCount=t.totalRecords,this.originTotalCount=t.totalRecords},getMatches(e){this.loading&&(this.loading=!1);const t=JSON.parse(e.data);this.$nextTick((()=>{const e=t.data;e.forEach((e=>{this.fullBranch[e.project.id]?e.branches.forEach((t=>this.fullBranch[e.project.id].add(t))):this.fullBranch[e.project.id]=new Set(e.branches)})),this.addData(e).then((()=>{if(this.initGetData)this.initGetData=!1,this.getData();else{const e=this.$refs.commonSearch?.$refs.dynamicScroller?.$el;e&&0===e.scrollTop&&e.scrollHeight===e.clientHeight&&this.loadMore()}}))}))},async getCodeList(){this.clearData((()=>{this.closeEventSource(),this.loading=!0,this.loadEnd=!1,this.params.languages||this.params.project_ids||(this.searchArrayLoading=!0);let e=1e4;window.gon.feature_toggles_value&&window.gon.feature_toggles_value.search_limit&&(e=window.gon.feature_toggles_value.search_limit);const t=new URLSearchParams({keywords:this.keywords,start_line:1,end_line:40,num:e,is_case_sensitive:this.$route.query.case||!1,is_strict_match:void 0===this.$route.query.strict||this.$route.query.strict,...this.params}).toString();this.evtSource=new EventSource(`/api/search/enterprises/${window.gon.info.enterprise_uuid}/code/stream?${t}`),Object.keys(this.evtSourceEvents).forEach((e=>{this.evtSource.addEventListener(e,this[this.evtSourceEvents[e]])}))}))},transferFileMatchs(e){if(!e)return[];const t=[];return e.forEach((e=>{const{project:a,file_path:s,file_name:i,contents:n,language:r,branches:o,matches:l,index:h,fileContent:c}=e,d=`${a.full_path}-${s}-${Math.random().toString().slice(-10)}`,p=n?.filter((e=>0===e.line_num))||[],u=n?.filter((e=>0!==e.line_num))||[],m={key:`${d}-file-header`,fileKey:d,type:"file-header",visible:u.length>0,contentLoading:!1,noContent:0===u.length,data:{index:h,project:a,projectId:a.id,file_path:s,file_name:i,language:r,branches:o,html_content:p.length?this.transferLineContent(p[0],e.matches):e.file_path,matches:l}};t.push(m),c&&(!c||"text"!==c.file_type||c.is_lfs_file||c.too_big_text||c.empty_text)||!u.length?c&&t.push({key:`${d}-abnormal-file`,fileKey:d,type:"abnormal-file",data:{language:r,projectId:a.id,toggleIndex:1,isLast:!0,line:{content:"",line_num:1},full_path:a.full_path,fileContent:c,branch:o[0],file:`${a.full_path}-${s}`,html_content:""}}):(u.forEach(((e,i)=>{t.push({key:`${d}-${e.line_num}`,fileKey:d,type:"code-line",data:{language:r,projectId:a.id,toggleIndex:i,isLast:i===u.length-1,line:e,file:`${a.full_path}-${s}`,fileContent:c,html_content:this.transferLineContent(e,l)}})})),this.fileIsMdTooBig(c)?(t.push({key:`${d}-abnormal-file`,fileKey:d,type:"abnormal-file",data:{language:r,projectId:a.id,toggleIndex:1,isLast:!0,line:{content:"",line_num:1},branch:o[0],full_path:a.full_path,fileContent:c,file:`${a.full_path}-${s}`,html_content:""}}),this.toggledFiles.push(d)):u.length>15&&(this.toggledFiles.push(d),t.push({key:`${d}-toggle-line`,fileKey:d,type:"toggle-line",showMore:!1,data:{language:r,projectId:a.id}}))),t.push({key:`${d}-empty-line`,type:"empty-line",index:h,data:{language:r,projectId:a.id}})})),t},transferLineContent(e,t){const{content:a="",line_num:s}=e;if(!t||!t.length||!t.some((e=>e.line_num===s)))return window.GITEE.tools.escapeHtml(a);const i=Boolean(this.$route.query.case),n=[...new Set(t.map((e=>i?e.match:e.match.toLowerCase())))],r=n.map((e=>this.escapeRegExp(e))).join("|");return a.slice(0,500).split(new RegExp(`(${r})`,"g"+(i?"":"i"))).map((e=>n.includes(i?e:e.toLowerCase())?`<em class="highlight">${window.GITEE.tools.escapeHtml(e)}</em>`:window.GITEE.tools.escapeHtml(e))).join("")},escapeRegExp:e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),handleShowMore(e,t){this.updateTableData(e,"showMore",t),t?this.toggledFiles=this.toggledFiles.filter((t=>t!==e.fileKey)):this.toggledFiles.push(e.fileKey)},fileIsMdTooBig:e=>e&&e.is_markdown&&e.size>102400&&e.size<=1048576,handleToggle(e,t){if(this.updateTableData(e,"visible",t),t?this.hiddenFiles=this.hiddenFiles.filter((t=>t!==e.fileKey)):this.hiddenFiles.push(e.fileKey),e.noContent&&!e.contentLoading){this.updateTableData(e,"contentLoading",!0);const t=decodeURIComponent(e.data.branches[0]),a=e.data.project.full_path;window.$http.get(`${GITEE.api.API_GO_BASEURL}/api/${a}/-/${encodeURIComponent(t)}/blobs`,{params:{path:e.data.file_path},noCancel:!0}).then((t=>{const{branches:a,file_name:s,file_path:i,matches:n,language:r,project:o,index:l}=e.data,h=[{content:i,line_num:0}];"text"!==t.data.file_type||t.data.is_lfs_file||t.data.too_big_text||t.data.raw_content.split("\n").forEach(((e,t)=>{h.push({content:e,line_num:t+1})})),1===h.length&&h.push({content:"",line_num:""});const c={branches:[...a],contents:[...h],file_name:s,file_path:i,index:l,language:r,fileContent:t.data,matches:[...n],project:{...o}};this.updateData(c);const d=this.transferFileMatchs([c]),p=this.fullData.findIndex((t=>t.key===`${e.fileKey}-file-header`));p>-1&&this.fullData.splice(p,2,...d)})).finally((()=>{this.updateTableData(e,"contentLoading",!1)}))}},updateTableData(e,t,a){const s=this.fullData.findIndex((t=>t.key===e.key));s>-1&&this.$set(this.fullData[s],t,a)},getData(e){this.loading=!0,this.getPaginatedData({index:e,per_page:this.per_page,...this.params}).then((({data:t,totalCount:a})=>{const{project_ids:s,branches:i,path:n,languages:r}=this.params,o=!s||!s.length,l=!i||!i.length,h=o&&l&&!r&&!n;this.fullData=[...this.fullData,...this.transferFileMatchs(t)],h?this.totalCount=this.originTotalCount:!e&&(this.totalCount=a),this.loading=!1}))},loadMore(){this.fullData.length&&this.fullData[this.fullData.length-1].index<this.totalCount&&(this.page++,this.getData(this.fullData[this.fullData.length-1].index))},initIndexDb(e){this.dbRequest=window.indexedDB.open("codeDB"),this.dbRequest.onsuccess=t=>this.dbRequestSuccess(t,e),this.dbRequest.onupgradeneeded=t=>this.dbRequestSuccess(t,e)},dbRequestSuccess(e,t){this.db=e.target.result,this.db.objectStoreNames.contains("searchCode")||this.db.createObjectStore("searchCode",{keyPath:"index",autoIncrement:!0}),t&&t()},addData(e){const t=E;return E+=e.length,new Promise(((a,s)=>{const i=this.db.transaction(["searchCode"],"readwrite"),n=i.objectStore("searchCode");e.forEach(((e,a)=>{const s=t+a+1;e.index=s,n.add(e).onerror=t=>{console.error("添加失败:",e,"原因:",t.target.error)}})),i.oncomplete=()=>a(),i.onerror=e=>{s(e.target.error)}}))},clearData(e,t){this.db||e();const a=this.db.transaction(["searchCode"],"readwrite").objectStore("searchCode").clear();a.onsuccess=function(t){e&&e(t)},a.onerror=function(e){t&&t(e)}},updateData(e){return new Promise(((t,a)=>{const s=this.db.transaction(["searchCode"],"readwrite").objectStore("searchCode").put(e);s.onsuccess=()=>{t()},s.onerror=e=>{a(e)}}))},getPaginatedData(e){return new Promise(((t,a)=>{const{project_ids:s,branches:i,path:n,languages:r,index:o,per_page:l}=e,h=this.db.transaction("searchCode","readonly").objectStore("searchCode");let c,d;o?(c=IDBKeyRange.lowerBound(o,!0),d=h.openCursor(c)):d=h.openCursor();const p=[];let u=0,m=0;d.onsuccess=e=>{const a=e.target.result,h=!s||!s.length,c=!i||!i.length,d=!r,g=!n,_=h&&c&&d&&g;if(!a)return void t({data:p,totalCount:m});const f=a.value,w=h||s.includes(f.project.id),y=c||i.some((e=>f.branches.includes(e))),v=d||f.language===r,C=g||f.file_path.indexOf(n)>-1;w&&y&&v&&C&&(m++,u++,u<=l?p.push(f):(o||_)&&t({data:p})),a.continue()},d.onerror=e=>{a(e.target.error)}}))}}},j=(0,h.Z)(k,y,[],!1,null,null,null).exports;var I=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"code-search__entry"},[a("div",{staticClass:"code-search__box"},[a("h2",{staticClass:"code-search__title"},[e._v("Gitee Search")]),e._v(" "),a("div",{staticClass:"code-search__input"},[a("el-input",{attrs:{clearable:"",placeholder:e.$t("common.search")},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:function(){return e.handleSearch()}.apply(null,arguments)}},model:{value:e.keywords,callback:function(t){e.keywords=t},expression:"keywords"}},[a("i",{staticClass:"iconfont-new iconsearch",attrs:{slot:"prepend"},slot:"prepend"})])],1)]),e._v(" "),a("img",{staticClass:"majiancang",attrs:{src:e.imageUrl,alt:"majiancang"}})])};I._withStripped=!0;const x=a.p+"images/65b33c117668fb44a1dfa5fc4fb93836.png";var T=a(3418);const A={name:"GlobalSearchEntry",data:()=>({keywords:"",imageUrl:x}),methods:{handleSearch(){this.$router.push({name:"company#search",query:{...this.$route.query,wd:this.keywords},params:(0,T.e)()})}}},L=(0,h.Z)(A,I,[],!1,null,"7a70b4e7",null).exports;var M=a(3539),P=a(7376);const R={name:"GlobalSearchPage",components:{SearchProjects:p,SearchIssues:w,SearchCode:j,GlobalSearchEntry:L},data:()=>({keywords:"",tabArr:[{code:"project",component:p,init:!1},{code:"issue",component:w,init:!1},{code:"code",component:j,init:!1}],userTabConfigKey:"default_global_search_type"}),computed:{activeName(){return this.$store.getters["dashboard/getActiveTab"]},searchComponent(){return this.tabArr.find((e=>e.code===this.activeName))?.component},hasKeywords(){return this.$route.query.hasOwnProperty("wd")&&this.$route.query.wd}},watch:{$route:{immediate:!0,handler(){if(this.hasKeywords){if(!this.$route.query.hasOwnProperty("tab")||!this.$route.query.tab)return void this.$router.replace({query:{...this.$route.query,tab:"project"}});this.keywords=this.$route.query.wd,this.storeActiveName();const e=this.tabArr.find((e=>e.code===this.activeName));if(e.init)return;e.init=!0,this.handleSearch()}}},activeName(){this.hasKeywords&&this.$router.push({name:"company#search",query:{wd:this.keywords,tab:this.activeName,case:this.$route.query.case,strict:this.$route.query.strict},params:(0,T.e)()})}},created(){this.storeActiveName(),this.registerEventHubListener(P.I.REFRESH_SEARCH_CODE,this.handleSearch),this.registerEventHubListener(P.I.RESET_SEARCH_INIT,this.resetSearchInit)},methods:{resetSearchInit(){this.tabArr.forEach((e=>{e.init&&(e.init=!1)}))},storeActiveName(){this.$route.query.tab&&this.$store.commit("dashboard/setActiveTab",this.$route.query.tab)},handleMove(e,t,a){this.$set(this.tabArr[t],"showMove",a)},async handleSearch(){this.$nextTick((()=>{this.$refs[`${this.activeName}SearchComponent`].handleSearch()}))},handleTrigger(){(0,M.tm)()}}},N=(0,h.Z)(R,s,[],!1,null,"8426e210",null).exports}}]);
|
|
Binary file
|
|
Binary file
|