|
|
@@ -230,9 +230,20 @@ export default {
|
|
|
async addOrUpdateChain() {
|
|
|
|
|
|
const {id, chain, tokenSymbol, networkName, http, explorer, other} = this.editDialog.item
|
|
|
- console.log("???", this.editDialog.item)
|
|
|
+ // console.log("???", this.editDialog.item)
|
|
|
+ var val_other = other
|
|
|
+
|
|
|
+
|
|
|
+ if (this.IsJsonString(other)) {
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.$msgkit.error(`rst1: other 只能是json 字符串`)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
const updateOrAdd = {
|
|
|
- id, chain, tokenSymbol, networkName, http, explorer,other
|
|
|
+ id, chain, tokenSymbol, networkName, http, explorer, other: val_other
|
|
|
}
|
|
|
|
|
|
const rst1 = await this.chainModel.appendOrUpdateChain(updateOrAdd)
|
|
|
@@ -263,6 +274,17 @@ export default {
|
|
|
},
|
|
|
editItem(item) {
|
|
|
this.editDialog.item = item
|
|
|
+ let val_other = this.editDialog.item.other
|
|
|
+ if (val_other === "" || val_other === null) {
|
|
|
+ val_other = "{}"
|
|
|
+ } else {
|
|
|
+ if (!this.IsJsonString(val_other)) {
|
|
|
+ val_other = "{}"
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.editDialog.item.other = val_other
|
|
|
+
|
|
|
this.editDialog.visible = true
|
|
|
this.editDialog.addOrUpdate = false
|
|
|
},
|
|
|
@@ -272,6 +294,20 @@ export default {
|
|
|
jquery(".v-row-group__header td.text-start").unbind('click')
|
|
|
console.log("移除点击事件:remButClick")
|
|
|
},
|
|
|
+
|
|
|
+ IsJsonString(str) {
|
|
|
+ try {
|
|
|
+ var zzz= JSON.parse(str);
|
|
|
+ console.log('是', str,zzz);
|
|
|
+ } catch (e) {
|
|
|
+ console.log('否', str);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
async mounted() {
|
|
|
}
|