File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,12 +133,11 @@ export default {
133133 handleWidgetAdd (evt ) {
134134 const newIndex = evt .newIndex ;
135135
136- // 为拖拽到容器的元素添加唯一 key
137- const key = Date .parse (new Date ()) + ' _' + Math .ceil (Math .random () * 99999 )
136+ const elKey = Date .now () + ' _' + Math .ceil (Math .random () * 1000000 );
138137 let newObj = this .$util .deepClone (this .pageData [this .list ][newIndex]);
139- // 绑定键值
140- newObj .key = this .pageData [this .list ][newIndex].type + ' _' + key ;
141- this .$set (this .pageData [this .list ], newIndex, newObj)
138+
139+ newObj .key = this .pageData [this .list ][newIndex].type + ' _' + elKey ;
140+ this .$set (this .pageData [this .list ], newIndex, newObj);
142141 this .$store .commit (' setSelectWg' , this .pageData [this .list ][newIndex]);
143142 this .$store .commit (' setConfigTab' , " widget" );
144143 },
@@ -162,7 +161,7 @@ export default {
162161 },
163162 handleWidgetClone (index ) {
164163 let cloneData = this .$util .deepClone (this .pageData [this .list ][index]);
165- cloneData .key = this .pageData [this .list ][index].type + ' _' + Date .parse ( new Date ()) + ' _' + Math .ceil (Math .random () * 99999 )
164+ cloneData .key = this .pageData [this .list ][index].type + ' _' + Date .now () + ' _' + Math .ceil (Math .random () * 1000000 )
166165 this .pageData [this .list ].splice (index, 0 , cloneData)
167166 this .$nextTick (() => {
168167 this .$store .commit (' setSelectWg' , this .pageData [this .list ][index + 1 ])
Original file line number Diff line number Diff line change 1- // import api from "../../assets/js/api.js"
2-
31const state = {
42 pageData : {
53 list : [ ] ,
@@ -11,16 +9,12 @@ const state = {
119 selectTheme : ""
1210}
1311
14- const actions = {
15- // getBusinessTypeList({commit}) {
16- // api.vkcPost2("supermarketloan/crm/qualitycontrol/findAllBusinessTypes", "", res => {
17- // commit(types.BUSINESS_TYPE_LIST, res);
18- // });
19- // }
20- }
12+ // const actions = {
13+
14+ // }
2115
2216// const getters = {
23- // businessTypeList : state => state.businessTypeList
17+ // selectTheme : state => state.selectTheme
2418// }
2519
2620const mutations = {
@@ -40,6 +34,5 @@ const mutations = {
4034
4135export default {
4236 state,
43- actions,
4437 mutations
4538}
You can’t perform that action at this time.
0 commit comments