|
|
@@ -1,13 +1,16 @@
|
|
|
<template>
|
|
|
<basic-container>
|
|
|
- <el-select v-model="value" filterable placeholder="请选择" @change="selectTable">
|
|
|
- <el-option
|
|
|
- v-for="(item, idx) in tableList"
|
|
|
- :key="idx"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <basic-container>
|
|
|
+ <el-select v-model="value" filterable placeholder="请选择" @change="selectTable">
|
|
|
+ <el-option
|
|
|
+ v-for="(item, idx) in tableList"
|
|
|
+ :key="idx"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </basic-container>
|
|
|
+
|
|
|
<div v-if="value">
|
|
|
<avue-crud :option="option"
|
|
|
:table-loading="loading"
|
|
|
@@ -45,6 +48,7 @@
|
|
|
import {getList, getDetail, add, update, remove} from "@/api/bank/autodata";
|
|
|
import {mapGetters} from "vuex";
|
|
|
import {getList as getTables} from "@/api/bank/autostruct";
|
|
|
+ import {opStr2opObj} from "../../api/bank/autostruct";
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
@@ -111,16 +115,19 @@
|
|
|
},
|
|
|
selectTable(value){
|
|
|
let table = this.getItemById(value);
|
|
|
- let optionStr = table.columns.replace(/(s*?{s*?|s*?,s*?)(['"])?([a-zA-Z0-9]+)(['"])?:/g, '$1"$3":').replaceAll('\'', '\"');
|
|
|
+ /*let optionStr = table.columns.replace(/(s*?{s*?|s*?,s*?)(['"])?([a-zA-Z0-9]+)(['"])?:/g, '$1"$3":').replaceAll('\'', '\"');
|
|
|
optionStr = optionStr.replace('>', '>')
|
|
|
- optionStr = optionStr.replace(/\s*/g, '')
|
|
|
- // str.replace(/\s*/g,"")
|
|
|
+ optionStr = optionStr.replace(/\s*!/g, '')
|
|
|
+ // str.replace(/\s*!/g,"")
|
|
|
this.option = JSON.parse(optionStr, (k,v)=>{
|
|
|
if(k == 'change'){
|
|
|
return eval('"' + v + '"')
|
|
|
}
|
|
|
return v
|
|
|
})
|
|
|
+*/
|
|
|
+ this.option = opStr2opObj(table.columns);
|
|
|
+
|
|
|
this.onLoad(this.page)
|
|
|
},
|
|
|
getItemById(id){
|