"use strict";(self.webpackChunkmy_package_ext=self.webpackChunkmy_package_ext||[]).push([[2521],{42521:function(t,e,i){i.r(e),i.d(e,{default:function(){return s}});var n=i(13974);function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){var i,n=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)),n}function a(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?r(Object(i),!0).forEach((function(e){var n,r;n=t,r=i[e],(e=function(t){return t=function(t,e){if("object"!==o(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0===i)return String(t);if("object"!==o(i=i.call(t,"string")))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}(t),"symbol"===o(t)?t:String(t)}(e))in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}e={name:"timeLine",mixins:[i(98263).Z],props:{value:"",mode:{default:"edit"},optionTemplate:{type:String,default:""},placement:"bottom",type:null,color:null,lastColor:null,size:"normal",reverse:{type:Boolean,default:!1}},data:function(){return{demoList:[{content:"活动1",timestamp:"2023-08-03"},{content:"活动2",timestamp:"2023-08-05"},{content:"活动3",timestamp:"2023-08-08"}]}},computed:{activities:function(){var t,e=this,i=this.options||[],o=this.settings,r=void 0===(t=o.customContentField)?"content":t,s=void 0===(t=o.customTimestampField)?"timestamp":t,c=o.type;return(0,n.isEmpty)(i)?this.demoList:i.map((function(t,i){return{_data:i+1===e.options.length?a(a({},t._data),{},{color:t._data.color||e.lastColor}):t._data,content:"custom"===c?t._data[r]:t.label,timestamp:"custom"===c?t._data[s]:t.value}}))}},created:function(){},watch:{},methods:{clickItem:function(t){console.log(t._data,"data._data"),this.$emit("clickTimeLineItem",t._data)}}};var s=(0,i(51900).Z)(e,(function(){var t=this,e=t._self._c;return e("div",{staticStyle:{width:"100%"}},["edit"==t.mode?e("ul",{staticClass:"timeline"},t._l(t.activities,(function(i,n){return e("li",{key:n,staticClass:"timeline-item",on:{click:function(e){return t.clickItem(i)}}},[e("div",{class:["item-tail",n+1==t.activities.length?"last":""]}),t._v(" "),e("div",{staticClass:"item-node",style:{background:(null==(n=i._data)?void 0:n.color)||t.color}}),t._v(" "),e("div",{staticClass:"item-wrapper"},[t.optionTemplateIsEnable&&"top"===t.placement?e("div",{ref:"time",refInFor:!0,staticClass:"item-time"},[t._v(t._s(i.timestamp))]):t._e(),t._v(" "),t._t("default",(function(){return["top"===t.placement?e("div",{ref:"time",refInFor:!0,staticClass:"item-time"},[t._v(t._s(i.timestamp))]):t._e(),t._v(" "),e("div",{staticClass:"item-process"},[t._v(t._s(i.content))]),t._v(" "),"bottom"===t.placement?e("div",{ref:"time",refInFor:!0,staticClass:"item-time"},[t._v(t._s(i.timestamp))]):t._e()]}),{data:i._data}),t._v(" "),t.optionTemplateIsEnable&&"bottom"===t.placement?e("div",{ref:"time",refInFor:!0,staticClass:"item-time"},[t._v(t._s(i.timestamp))]):t._e()],2)])})),0):t._e()])}),[],!1,null,"2120f012",null).exports}}]);