askbot-dragon 0.6.24 → 0.6.25
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/package.json +1 -1
- package/public/index.html +1 -1
- package/src/App.vue +2 -1
- package/src/assets/js/script.js +37 -0
- package/src/assets/less/common.css +17 -7
- package/src/assets/less/converSationContainer/common.less +23 -4583
- package/src/assets/less/converSationContainer/converSatonContainer.less +1 -0
- package/src/assets/less/iconfont.css +17 -0
- package/src/assets/less/ticketMessage.less +84 -188
- package/src/components/ConversationContainer.vue +334 -510
- package/src/components/actionSatisfaction.vue +76 -0
- package/src/components/actionSendToBot.vue +60 -0
- package/src/components/answerDissatisfaction.vue +61 -0
- package/src/components/answerRadio.vue +64 -0
- package/src/components/askVideo.vue +46 -0
- package/src/components/associationIntention.vue +91 -0
- package/src/components/botActionSatisfactor.vue +72 -0
- package/src/components/feedBack.vue +26 -15
- package/src/components/formTemplate.vue +150 -72
- package/src/components/loadingProcess.vue +176 -0
- package/src/components/message/TextMessage.vue +47 -12
- package/src/components/message/TicketMessage.vue +16 -22
- package/src/components/message/swiper/ticketSwiper.vue +9 -35
- package/src/components/msgLoading.vue +231 -0
- package/src/components/recommend.vue +76 -0
- package/src/components/voiceComponent.vue +102 -0
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
<div class="titleName" >
|
|
5
5
|
{{formShow.form.name}}
|
|
6
6
|
</div>
|
|
7
|
-
<div class="pcFormClass" v-if="isCompany
|
|
7
|
+
<div class="pcFormClass" v-if="isCompany">
|
|
8
8
|
<div v-for="(item) in formShow.form.formFieldRelation"
|
|
9
9
|
:key="item.formField.id"
|
|
10
10
|
:class="{notClick:disableds === true}"
|
|
11
11
|
>
|
|
12
12
|
<div v-if="item.formField.type!=='CHAT_RECORD'&&item.formField.type!=='CHANNEL'&&item.display&&item.fieldId!=='workorder_name'" class="field-item">
|
|
13
13
|
<div v-if="item.display&&item.fieldId!=='workorder_name'&&item.formField.type!=='EXPLANATION'&&item.formField.type!=='EXPLAIN'" class="field-item-name">
|
|
14
|
-
<span style="color: red" v-if="item.required===true">*</span>
|
|
15
14
|
<span v-if="item.fieldId!=='workorder_description'&&item.fieldId!=='workorder_clientId'">{{item.formField.name}}</span>
|
|
16
15
|
<span v-if="item.fieldId==='workorder_description'">问题描述</span>
|
|
17
16
|
<span v-if="item.fieldId==='workorder_clientId'">报单人</span>
|
|
17
|
+
<span style="color: red;padding-left: 5px" v-if="item.required===true">*</span>
|
|
18
18
|
</div>
|
|
19
19
|
<el-input v-model=item.value
|
|
20
20
|
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请输入'"
|
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
v-if="item.formField.type==='INPUT'&&item.fieldId!=='workorder_name'"
|
|
23
23
|
></el-input>
|
|
24
24
|
<div v-if="item.formField.type==='EXPLANATION'">
|
|
25
|
-
<div
|
|
26
|
-
<p
|
|
25
|
+
<div class="explanation">
|
|
26
|
+
<p class="explanation-p">
|
|
27
27
|
<span class="el-icon-info"></span>
|
|
28
28
|
{{item.formField.extInfo.descriptionText}}
|
|
29
29
|
</p>
|
|
30
30
|
</div>
|
|
31
31
|
</div>
|
|
32
32
|
<div v-if="item.formField.type==='EXPLAIN'">
|
|
33
|
-
<div
|
|
34
|
-
<p
|
|
33
|
+
<div class="explanation">
|
|
34
|
+
<p class="explanation-p">
|
|
35
35
|
<span class="el-icon-info"></span>
|
|
36
36
|
<span v-if="item.formField.extInfo.url" class="explain-url"><a :href="item.formField.extInfo.url" target="_blank">{{item.value}}</a></span>
|
|
37
37
|
<span v-else>{{item.value}}</span>
|
|
@@ -180,12 +180,13 @@
|
|
|
180
180
|
</div>
|
|
181
181
|
</div>
|
|
182
182
|
</div>
|
|
183
|
-
<div
|
|
184
|
-
|
|
183
|
+
<div class="form-link"></div>
|
|
184
|
+
<div class="form-submit-btn">
|
|
185
|
+
<el-button style="border-color: #366aff;color: white;background-color: #366aff" round class="submitClass" size="small" @click="submitClick" :disabled="disableds">{{submitValue}}</el-button>
|
|
185
186
|
</div>
|
|
186
|
-
|
|
187
|
+
</div>
|
|
187
188
|
<div class="mobileFormClass" v-else style="padding: 10px 0;" :class="{notClick:disableds === true}">
|
|
188
|
-
|
|
189
|
+
<div v-for="(item,index) in formFieldRelation"
|
|
189
190
|
:key="item.formField.id"
|
|
190
191
|
class="form-field-item"
|
|
191
192
|
>
|
|
@@ -199,12 +200,12 @@
|
|
|
199
200
|
/>
|
|
200
201
|
</div>
|
|
201
202
|
<div v-else-if="item.formField.type==='EXPLANATION'||item.formField.type==='EXPLAIN'" class="explan-ation">
|
|
202
|
-
<div class="
|
|
203
|
-
<p class="
|
|
203
|
+
<div class="explanation">
|
|
204
|
+
<p class="explanation-p" v-if="item.formField.type==='EXPLANATION'">
|
|
204
205
|
<span class="el-icon-info"></span>
|
|
205
206
|
{{item.formField.extInfo.descriptionText}}
|
|
206
207
|
</p>
|
|
207
|
-
<p v-else class="
|
|
208
|
+
<p v-else class="explanation-p">
|
|
208
209
|
<span class="el-icon-info"></span>
|
|
209
210
|
<span v-if="item.formField.extInfo.url" class="explain-url"><a :href="item.formField.extInfo.url" target="_blank">{{item.value}}</a></span>
|
|
210
211
|
<span v-else>{{item.value}}</span>
|
|
@@ -244,6 +245,7 @@
|
|
|
244
245
|
:required="item.required===true"
|
|
245
246
|
@click="dateClick(item.fieldId)"
|
|
246
247
|
:disabled="disableds"
|
|
248
|
+
right-icon="van-icon van-icon-arrow van-cell__right-icon"
|
|
247
249
|
/>
|
|
248
250
|
<van-calendar
|
|
249
251
|
v-model="showCalendar"
|
|
@@ -261,6 +263,7 @@
|
|
|
261
263
|
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请选择时间'"
|
|
262
264
|
@click="timeClick(item.fieldId,item)"
|
|
263
265
|
:disabled="disableds"
|
|
266
|
+
right-icon="van-icon van-icon-arrow van-cell__right-icon"
|
|
264
267
|
|
|
265
268
|
/>
|
|
266
269
|
<van-popup v-model="showTimePicker" position="bottom">
|
|
@@ -286,6 +289,7 @@
|
|
|
286
289
|
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请选择日期'"
|
|
287
290
|
@click="timeClick(item.fieldId,item)"
|
|
288
291
|
:disabled="disableds"
|
|
292
|
+
right-icon="van-icon van-icon-arrow van-cell__right-icon"
|
|
289
293
|
|
|
290
294
|
/>
|
|
291
295
|
<van-calendar v-model="showTimePickerd" :show-confirm="false" @confirm="onConfirm($event,timeId,item)" @cancel="showTimePickerd = false"/>
|
|
@@ -417,14 +421,15 @@
|
|
|
417
421
|
</div>
|
|
418
422
|
</div>
|
|
419
423
|
</div>
|
|
420
|
-
|
|
421
|
-
<
|
|
422
|
-
|
|
423
|
-
<van-popup v-model="fileUpload" :close-on-click-overlay="false">
|
|
424
|
-
<div style="background-color: black;height: 100px;width: 100px;display: flex;justify-content: center;align-items: center" >
|
|
425
|
-
<van-loading type="spinner"/>
|
|
424
|
+
<div class="form-link"></div>
|
|
425
|
+
<div class="form-submit-btn">
|
|
426
|
+
<van-button round type="info" class="submitClass" @click="submitClick" :disabled="disableds">{{submitValue}}</van-button>
|
|
426
427
|
</div>
|
|
427
|
-
|
|
428
|
+
<van-popup v-model="fileUpload" :close-on-click-overlay="false">
|
|
429
|
+
<div style="background-color: black;height: 100px;width: 100px;display: flex;justify-content: center;align-items: center" >
|
|
430
|
+
<van-loading type="spinner"/>
|
|
431
|
+
</div>
|
|
432
|
+
</van-popup>
|
|
428
433
|
</div>
|
|
429
434
|
</div>
|
|
430
435
|
<el-dialog :visible.sync="dialogVisible">
|
|
@@ -1629,9 +1634,21 @@ export default {
|
|
|
1629
1634
|
/* border: 1px solid #ebebeb;*/
|
|
1630
1635
|
font-family: "Avenir", Helvetica, Arial, sans-serif;
|
|
1631
1636
|
border-radius: 15px;
|
|
1637
|
+
.explanation{
|
|
1638
|
+
display: flex;
|
|
1639
|
+
padding: 4px;
|
|
1640
|
+
.explanation-p{
|
|
1641
|
+
color: #366aff;
|
|
1642
|
+
font-size: 14px;
|
|
1643
|
+
margin: 10px 4px;
|
|
1644
|
+
.el-icon-info{
|
|
1645
|
+
margin-right: 8px;
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1632
1649
|
.explain-url{
|
|
1633
1650
|
a{
|
|
1634
|
-
color:#
|
|
1651
|
+
color:#366aff ;
|
|
1635
1652
|
}
|
|
1636
1653
|
}
|
|
1637
1654
|
.titleName{
|
|
@@ -1643,10 +1660,15 @@ export default {
|
|
|
1643
1660
|
justify-content: center;
|
|
1644
1661
|
border-bottom: 1px solid #EEEEEE;
|
|
1645
1662
|
}
|
|
1663
|
+
.form-link{
|
|
1664
|
+
margin-top: 14px;
|
|
1665
|
+
height: 1px;
|
|
1666
|
+
width: 100%;
|
|
1667
|
+
background-color: #EEEEEE;
|
|
1668
|
+
}
|
|
1646
1669
|
.form-submit-btn{
|
|
1647
1670
|
padding: 14px 16px 0 16px;
|
|
1648
1671
|
text-align: center;
|
|
1649
|
-
border-top: 1px solid #EEEEEE;
|
|
1650
1672
|
}
|
|
1651
1673
|
/deep/.ck.ck-editor{
|
|
1652
1674
|
padding: 0 8px;
|
|
@@ -1664,36 +1686,45 @@ export default {
|
|
|
1664
1686
|
}
|
|
1665
1687
|
}
|
|
1666
1688
|
.pcFormClass{
|
|
1667
|
-
|
|
1689
|
+
/* width: 300px;*/
|
|
1668
1690
|
margin: 0 auto;
|
|
1669
1691
|
.field-item{
|
|
1670
1692
|
padding: 8px 0;
|
|
1671
1693
|
.field-item-name{
|
|
1672
1694
|
padding-bottom: 8px;
|
|
1673
|
-
|
|
1674
|
-
|
|
1695
|
+
color: #A9B3C6;
|
|
1696
|
+
/* color: #000000;*/
|
|
1675
1697
|
}
|
|
1676
1698
|
}
|
|
1699
|
+
/deep/.el-input__inner{
|
|
1700
|
+
border-color: #E0E6F7!important;
|
|
1701
|
+
background-color: transparent!important;
|
|
1702
|
+
border-radius: 9px!important;
|
|
1703
|
+
}
|
|
1677
1704
|
/deep/.el-upload--picture-card{
|
|
1678
|
-
background-color: #
|
|
1679
|
-
border: 1px
|
|
1680
|
-
border-radius:
|
|
1705
|
+
background-color: #FFFFFF;
|
|
1706
|
+
border: 1px solid #E0E6F7;
|
|
1707
|
+
border-radius: 10px;
|
|
1681
1708
|
width: 74px;
|
|
1682
1709
|
height: 74px;
|
|
1683
1710
|
vertical-align: top;
|
|
1684
1711
|
cursor: pointer;
|
|
1685
1712
|
text-align: center;
|
|
1686
1713
|
font-size:28px;
|
|
1687
|
-
color:#
|
|
1714
|
+
color:#366AFF;
|
|
1688
1715
|
display: flex;
|
|
1689
1716
|
align-items: center;
|
|
1690
1717
|
justify-content: center;
|
|
1718
|
+
i{
|
|
1719
|
+
color: #366AFF;
|
|
1720
|
+
}
|
|
1691
1721
|
}
|
|
1692
1722
|
|
|
1693
1723
|
/deep/.el-upload-list--picture-card{
|
|
1694
1724
|
.el-upload-list__item{
|
|
1695
1725
|
width: 74px;
|
|
1696
1726
|
height: 74px;
|
|
1727
|
+
border-radius: 10px;
|
|
1697
1728
|
}
|
|
1698
1729
|
}
|
|
1699
1730
|
/deep/.el-upload-list__item-name{
|
|
@@ -1704,16 +1735,16 @@ export default {
|
|
|
1704
1735
|
}
|
|
1705
1736
|
}
|
|
1706
1737
|
/deep/.van-radio__icon--checked .van-icon{
|
|
1707
|
-
background-color: #
|
|
1708
|
-
border-color: #
|
|
1738
|
+
background-color: #366aff!important;
|
|
1739
|
+
border-color: #366aff!important;
|
|
1709
1740
|
}
|
|
1710
1741
|
/deep/.van-checkbox__icon--checked .van-icon{
|
|
1711
|
-
background-color: #
|
|
1712
|
-
border-color: #
|
|
1742
|
+
background-color: #366aff!important;
|
|
1743
|
+
border-color: #366aff!important;
|
|
1713
1744
|
}
|
|
1714
1745
|
/deep/.vant-upload--picture-card{
|
|
1715
|
-
background-color: #
|
|
1716
|
-
border: 1px
|
|
1746
|
+
background-color: #ffffff;
|
|
1747
|
+
border: 1px solid #E0E6F7;
|
|
1717
1748
|
border-radius: 10px;
|
|
1718
1749
|
width: 74px;
|
|
1719
1750
|
height: 74px;
|
|
@@ -1725,13 +1756,16 @@ export default {
|
|
|
1725
1756
|
display: flex;
|
|
1726
1757
|
align-items: center;
|
|
1727
1758
|
justify-content: center;
|
|
1759
|
+
i{
|
|
1760
|
+
color: #366aff;
|
|
1761
|
+
}
|
|
1728
1762
|
}
|
|
1729
1763
|
/deep/.van-popup{
|
|
1730
1764
|
border-radius: 5px;
|
|
1731
1765
|
}
|
|
1732
1766
|
.remPhoneClassForm{
|
|
1733
1767
|
.mobileFormClass{
|
|
1734
|
-
|
|
1768
|
+
/* width: 80vw;*/
|
|
1735
1769
|
.form-field-item{
|
|
1736
1770
|
/* border-bottom: 1px solid #ebebeb;*/
|
|
1737
1771
|
.form-field-item-value{
|
|
@@ -1752,8 +1786,8 @@ export default {
|
|
|
1752
1786
|
padding: 8px;
|
|
1753
1787
|
.fileName{
|
|
1754
1788
|
padding-bottom: 8px;
|
|
1755
|
-
|
|
1756
|
-
|
|
1789
|
+
color: #A9B3C6;
|
|
1790
|
+
/* color: #000000;*/
|
|
1757
1791
|
}
|
|
1758
1792
|
}
|
|
1759
1793
|
.workorder_description{
|
|
@@ -1763,8 +1797,8 @@ export default {
|
|
|
1763
1797
|
.field-name{
|
|
1764
1798
|
width: 100%;
|
|
1765
1799
|
text-align: left;
|
|
1766
|
-
|
|
1767
|
-
|
|
1800
|
+
color: #A9B3C6;
|
|
1801
|
+
/* color: #000000;*/
|
|
1768
1802
|
line-height: 1;
|
|
1769
1803
|
padding-bottom: 8px;
|
|
1770
1804
|
}
|
|
@@ -1792,7 +1826,7 @@ export default {
|
|
|
1792
1826
|
padding: 4px;
|
|
1793
1827
|
}
|
|
1794
1828
|
.explan-ation-p{
|
|
1795
|
-
color: #
|
|
1829
|
+
color: #366aff;font-size: 14px;margin: 16px 4px;
|
|
1796
1830
|
}
|
|
1797
1831
|
}
|
|
1798
1832
|
}
|
|
@@ -1823,18 +1857,40 @@ export default {
|
|
|
1823
1857
|
}
|
|
1824
1858
|
.submitClass{
|
|
1825
1859
|
width: 120px;
|
|
1826
|
-
background-color: #
|
|
1860
|
+
background-color: #366aff;
|
|
1827
1861
|
color: white!important;
|
|
1828
1862
|
height: 36px;
|
|
1829
1863
|
}
|
|
1864
|
+
/deep/.van-radio-group--horizontal{
|
|
1865
|
+
.van-radio{
|
|
1866
|
+
min-width: 130px;
|
|
1867
|
+
max-width: 260px;
|
|
1868
|
+
flex: none;
|
|
1869
|
+
}
|
|
1870
|
+
.van-radio--horizontal{
|
|
1871
|
+
padding: 0.3rem 0;
|
|
1872
|
+
margin-right: 0;
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
/deep/.van-checkbox-group--horizontal{
|
|
1876
|
+
.van-checkbox{
|
|
1877
|
+
min-width: 130px;
|
|
1878
|
+
max-width: 260px;
|
|
1879
|
+
flex: none;
|
|
1880
|
+
}
|
|
1881
|
+
.van-checkbox--horizontal{
|
|
1882
|
+
padding: 0.3rem 0;
|
|
1883
|
+
margin-right: 0;
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1830
1886
|
/deep/.van-button--info{
|
|
1831
|
-
border:1px solid #
|
|
1887
|
+
border:1px solid #366aff;
|
|
1832
1888
|
}
|
|
1833
1889
|
/deep/.van-field__label{
|
|
1834
1890
|
width: 100%;
|
|
1835
1891
|
text-align: left;
|
|
1836
|
-
|
|
1837
|
-
|
|
1892
|
+
color: #A9B3C6!important;
|
|
1893
|
+
/* color: #000000!important;*/
|
|
1838
1894
|
display: flex;
|
|
1839
1895
|
align-items: center;
|
|
1840
1896
|
line-height: 1;
|
|
@@ -1845,26 +1901,12 @@ export default {
|
|
|
1845
1901
|
/deep/.van-field__control{
|
|
1846
1902
|
min-height: 40px;
|
|
1847
1903
|
}
|
|
1848
|
-
/deep/.van-checkbox--horizontal{
|
|
1849
|
-
padding: 0.2rem 0;
|
|
1850
|
-
}
|
|
1851
|
-
/deep/.van-radio--horizontal{
|
|
1852
|
-
padding: 0.2rem 0;
|
|
1853
|
-
}
|
|
1854
1904
|
/deep/.van-dropdown-menu__bar{
|
|
1855
1905
|
box-shadow: none!important;
|
|
1856
1906
|
}
|
|
1857
|
-
|
|
1858
1907
|
/deep/.van-overlay{
|
|
1859
1908
|
background-color: rgba(0,0,0,.4);
|
|
1860
1909
|
}
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
/deep/.el-input__inner{
|
|
1864
|
-
background-color: transparent!important;
|
|
1865
|
-
}
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
1910
|
}
|
|
1869
1911
|
|
|
1870
1912
|
.remCompanyClassForm{
|
|
@@ -1873,29 +1915,65 @@ export default {
|
|
|
1873
1915
|
.submitClass{
|
|
1874
1916
|
width: 120px;
|
|
1875
1917
|
color: white!important;
|
|
1876
|
-
background-color:#
|
|
1877
|
-
border-color: #
|
|
1918
|
+
background-color:#366aff;
|
|
1919
|
+
border-color: #366aff;
|
|
1878
1920
|
}
|
|
1879
|
-
|
|
1880
|
-
|
|
1921
|
+
/deep/.el-checkbox-group{
|
|
1922
|
+
display: flex;
|
|
1923
|
+
align-items: center;
|
|
1924
|
+
flex-wrap: wrap;
|
|
1925
|
+
.el-checkbox{
|
|
1926
|
+
padding: 8px 0;
|
|
1927
|
+
min-width:150px;
|
|
1928
|
+
max-width: 280px;
|
|
1929
|
+
flex: none;
|
|
1930
|
+
display: flex;
|
|
1931
|
+
overflow: hidden;
|
|
1932
|
+
margin-right: 0;
|
|
1933
|
+
}
|
|
1934
|
+
.el-checkbox__label{
|
|
1935
|
+
font-size: 1em;
|
|
1936
|
+
overflow: hidden;
|
|
1937
|
+
text-overflow: ellipsis;
|
|
1938
|
+
white-space: nowrap;
|
|
1939
|
+
}
|
|
1881
1940
|
}
|
|
1882
|
-
|
|
1883
|
-
|
|
1941
|
+
|
|
1942
|
+
/deep/.el-radio-group{
|
|
1943
|
+
display: flex;
|
|
1944
|
+
align-items: center;
|
|
1945
|
+
flex-wrap: wrap;
|
|
1946
|
+
.el-radio{
|
|
1947
|
+
padding: 8px 0;
|
|
1948
|
+
min-width:150px;
|
|
1949
|
+
max-width: 280px;
|
|
1950
|
+
flex: none;
|
|
1951
|
+
display: flex;
|
|
1952
|
+
overflow: hidden;
|
|
1953
|
+
margin-right: 0;
|
|
1954
|
+
}
|
|
1955
|
+
.el-radio__label{
|
|
1956
|
+
overflow: hidden;
|
|
1957
|
+
text-overflow: ellipsis;
|
|
1958
|
+
white-space: nowrap;
|
|
1959
|
+
font-size: 1em;
|
|
1960
|
+
}
|
|
1884
1961
|
}
|
|
1962
|
+
|
|
1885
1963
|
/deep/.el-radio__input.is-checked+.el-radio__label{
|
|
1886
|
-
color: #
|
|
1964
|
+
color: #366aff!important;
|
|
1887
1965
|
}
|
|
1888
1966
|
/deep/.el-radio__input.is-checked .el-radio__inner{
|
|
1889
|
-
color: #
|
|
1890
|
-
border-color: #
|
|
1891
|
-
background: #
|
|
1967
|
+
color: #366aff!important;
|
|
1968
|
+
border-color: #366aff!important;
|
|
1969
|
+
background: #366aff!important;
|
|
1892
1970
|
}
|
|
1893
1971
|
/deep/.el-checkbox__input.is-checked+.el-checkbox__label{
|
|
1894
|
-
color: #
|
|
1972
|
+
color: #366aff!important;
|
|
1895
1973
|
}
|
|
1896
1974
|
/deep/.el-checkbox__input.is-checked .el-checkbox__inner, .el-checkbox__input.is-indeterminate .el-checkbox__inner{
|
|
1897
|
-
background-color: #
|
|
1898
|
-
border-color: #
|
|
1975
|
+
background-color: #366aff!important;
|
|
1976
|
+
border-color: #366aff!important;
|
|
1899
1977
|
}
|
|
1900
1978
|
}
|
|
1901
1979
|
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="loading-process">
|
|
3
|
+
<div class="bg-color"></div>
|
|
4
|
+
<ul class="display-container" >
|
|
5
|
+
<li class="note-display" :data-note="dataNodes">
|
|
6
|
+
<div class="circle">
|
|
7
|
+
<svg width="30" height="30" class="circle__svg" viewBox="0 0 90 90">
|
|
8
|
+
<circle cx="41" cy="41" r="38" class="circle__progress circle__progress--path"></circle>
|
|
9
|
+
<circle cx="41" cy="41" r="38" class="circle__progress circle__progress--fill"></circle>
|
|
10
|
+
</svg>
|
|
11
|
+
</div>
|
|
12
|
+
</li>
|
|
13
|
+
</ul>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
const transitionDuration = 1000
|
|
19
|
+
export default {
|
|
20
|
+
name: "loadingProcess",
|
|
21
|
+
data(){
|
|
22
|
+
return{
|
|
23
|
+
timer:null,
|
|
24
|
+
dataNodes:0
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
props:['dataNote','finished'],
|
|
28
|
+
methods:{
|
|
29
|
+
strokeTransition(display, note) {
|
|
30
|
+
let progress = display.querySelector('.circle__progress--fill');
|
|
31
|
+
let radius = progress.r.baseVal.value;
|
|
32
|
+
let circumference = 2 * Math.PI * radius;
|
|
33
|
+
let offset = circumference * (10 - note) / 10;
|
|
34
|
+
progress.style.setProperty('--initialStroke', circumference);
|
|
35
|
+
progress.style.setProperty('--transitionDuration', `${transitionDuration}ms`);
|
|
36
|
+
|
|
37
|
+
setTimeout(() => progress.style.strokeDashoffset = offset, 100);
|
|
38
|
+
},
|
|
39
|
+
increaseNumber(display, number, className) {
|
|
40
|
+
let element = display.querySelector(`.percent__${className}`),
|
|
41
|
+
decPoint = className === 'int' ? '' : '',
|
|
42
|
+
interval = transitionDuration / number,
|
|
43
|
+
counter = 0;
|
|
44
|
+
console.debug('element',element,counter,decPoint)
|
|
45
|
+
let increaseInterval = setInterval(() => {
|
|
46
|
+
if (counter === number) { window.clearInterval(increaseInterval); }
|
|
47
|
+
/*
|
|
48
|
+
element.textContent = counter + decPoint;*/
|
|
49
|
+
counter++;
|
|
50
|
+
}, interval);
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
mounted() {
|
|
54
|
+
this.timer = setInterval(()=>{
|
|
55
|
+
const displays = document.querySelectorAll('.note-display');
|
|
56
|
+
displays.forEach(display => {
|
|
57
|
+
let note = parseFloat(display.dataset.note);
|
|
58
|
+
let [int, dec] = display.dataset.note.split('.');
|
|
59
|
+
[int, dec] = [Number(int), Number(dec)];
|
|
60
|
+
this.strokeTransition(display, note);
|
|
61
|
+
this.increaseNumber(display, this.dataNote, 'int');
|
|
62
|
+
/* this.increaseNumber(display, dec, 'dec');*/
|
|
63
|
+
})
|
|
64
|
+
},1000)
|
|
65
|
+
/* const displays = document.querySelectorAll('.note-display');
|
|
66
|
+
displays.forEach(display => {
|
|
67
|
+
let note = parseFloat(display.dataset.note);
|
|
68
|
+
let [int, dec] = display.dataset.note.split('.');
|
|
69
|
+
[int, dec] = [Number(int), Number(dec)];
|
|
70
|
+
this.strokeTransition(display, note);
|
|
71
|
+
this.increaseNumber(display, this.dataNote, 'int');
|
|
72
|
+
/!* this.increaseNumber(display, dec, 'dec');*!/
|
|
73
|
+
})*/
|
|
74
|
+
|
|
75
|
+
},
|
|
76
|
+
watch:{
|
|
77
|
+
dataNote:{
|
|
78
|
+
handler(val){
|
|
79
|
+
this.dataNodes = val
|
|
80
|
+
console.debug('this.dataNodes',val,this.dataNodes)
|
|
81
|
+
},
|
|
82
|
+
immediate:true,
|
|
83
|
+
deep:true
|
|
84
|
+
},
|
|
85
|
+
finished:{
|
|
86
|
+
handler(val){
|
|
87
|
+
if (val){
|
|
88
|
+
setTimeout(()=>{
|
|
89
|
+
clearInterval(this.timer)
|
|
90
|
+
},1000)
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
immediate:true
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<style scoped lang="less">
|
|
100
|
+
/*@import url('https://fonts.googleapis.com/css?family=Nixie+One|Raleway:200');*/
|
|
101
|
+
#loading-process{
|
|
102
|
+
height: 100px;
|
|
103
|
+
width: 100px;
|
|
104
|
+
position: relative;
|
|
105
|
+
.bg-color{
|
|
106
|
+
background-color:#000000 ;
|
|
107
|
+
opacity: 0.4;
|
|
108
|
+
width: 100%;
|
|
109
|
+
height: 100%;
|
|
110
|
+
}
|
|
111
|
+
.display-container{
|
|
112
|
+
position: absolute;
|
|
113
|
+
top: calc(50% - 15px);
|
|
114
|
+
left: 10px;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
* {
|
|
118
|
+
padding: 0;
|
|
119
|
+
margin: 0;
|
|
120
|
+
box-sizing: border-box;
|
|
121
|
+
}
|
|
122
|
+
/*
|
|
123
|
+
body {
|
|
124
|
+
height: 100vh;
|
|
125
|
+
color: #fff;
|
|
126
|
+
display: flex;
|
|
127
|
+
background: #3E423A;
|
|
128
|
+
font-family: 'Nixie One', cursive;
|
|
129
|
+
}
|
|
130
|
+
*/
|
|
131
|
+
|
|
132
|
+
.display-container {
|
|
133
|
+
margin: auto;
|
|
134
|
+
display: flex;
|
|
135
|
+
.note-display {
|
|
136
|
+
display: flex;
|
|
137
|
+
flex-direction: column;
|
|
138
|
+
align-items: center;
|
|
139
|
+
margin: 0 25px;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
.circle__progress {
|
|
143
|
+
fill: none;
|
|
144
|
+
stroke-width: 5;
|
|
145
|
+
stroke-opacity: 0.3;
|
|
146
|
+
stroke-linecap: round;
|
|
147
|
+
}
|
|
148
|
+
.note-display:nth-child(1) .circle__progress--fill{
|
|
149
|
+
stroke: #FFFFFF!important;
|
|
150
|
+
stroke-opacity: 1;
|
|
151
|
+
}
|
|
152
|
+
.circle__progress--path{
|
|
153
|
+
stroke: #EFEFEF!important;
|
|
154
|
+
stroke-opacity: 0.5;
|
|
155
|
+
}
|
|
156
|
+
.note-display:nth-child(1) .circle__progress { stroke: #AAFF00; }
|
|
157
|
+
.note-display:nth-child(2) .circle__progress { stroke: #FF00AA; }
|
|
158
|
+
.note-display:nth-child(3) .circle__progress { stroke: #AA00FF; }
|
|
159
|
+
.note-display:nth-child(4) .circle__progress { stroke: #00AAFF; }
|
|
160
|
+
.circle {
|
|
161
|
+
position: relative;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.percent {
|
|
165
|
+
width: 100%;
|
|
166
|
+
top: 50%;
|
|
167
|
+
left: 50%;
|
|
168
|
+
position: absolute;
|
|
169
|
+
font-weight: bold;
|
|
170
|
+
text-align: center;
|
|
171
|
+
/* line-height: 28px;*/
|
|
172
|
+
transform: translate(-50%, -50%);
|
|
173
|
+
font-size: 12px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
</style>
|