@@ -49,11 +49,11 @@ <h1>代码生成</h1>
4949 :rules ="tableRequestValidate ">
5050 < i-col span ="9 ">
5151 < form-item label ="URL " prop ="url " required >
52- < i-input v-model ="tableRequest.url " : placeholder ="urlHint ">
52+ < i-input v-model ="tableRequest.url " placeholder ="<host>:<port>/<dbName> ">
5353 < i-select v-model ="tableRequest.prepend " slot ="prepend " style ="width: 150px; ">
54- < i-option value ="jdbc:mysql:// " > jdbc:mysql:// </ i-option >
55- < i-option value ="jdbc:oracle:thin:@ " > jdbc:oracle:thin:@ </ i-option >
56- < i-option value ="jdbc:sqlserver:// " > jdbc:sqlserver:// </ i-option >
54+ < i-option : value ="mysqlPrepend " > {{mysqlPrepend}} </ i-option >
55+ < i-option : value ="oraclePrepend " > {{oraclePrepend}} </ i-option >
56+ < i-option : value ="mssqlPrepend " > {{mssqlPrepend}} </ i-option >
5757 </ i-select >
5858 </ i-input >
5959 </ form-item >
@@ -167,6 +167,10 @@ <h2>生成配置</h2>
167167 baseURL : '/demo'
168168 } ) ;
169169
170+ const MYSQL_PREPEND = "jdbc:mysql://" ;
171+ const MSSQL_PREPEND = "jdbc:jtds:sqlserver://" ;
172+ const ORACLE_PREPEND = "jdbc:oracle:thin:@//" ;
173+
170174 new Vue ( {
171175 el : "#app" ,
172176 data : {
@@ -247,16 +251,15 @@ <h2>生成配置</h2>
247251 data : [ ]
248252 } ,
249253 computed : {
250- urlHint ( ) {
251- if ( this . tableRequest . prepend === "jdbc:mysql://" ) {
252- return "mysql格式为 <host>:<port>/<dbName>" ;
253- } else if ( this . tableRequest . prepend === "jdbc:oracle:thin:@" ) {
254- return "oracle格式为 <host>:<port>:<SID>" ;
255- } else if ( this . tableRequest . prepend === "jdbc:sqlserver://" ) {
256- return "sqlserver格式为 <server_name>:<port>" ;
257- } else {
258- return "请选择 JDBC Url 前缀" ;
259- }
254+ mysqlPrepend ( ) {
255+ return MYSQL_PREPEND ;
256+ } ,
257+ oraclePrepend ( ) {
258+ return ORACLE_PREPEND ;
259+
260+ } ,
261+ mssqlPrepend ( ) {
262+ return MSSQL_PREPEND ;
260263 }
261264 } ,
262265 methods : {
0 commit comments