Ver código fonte

多个逗号

lrf 2 anos atrás
pai
commit
9838618f73
1 arquivos alterados com 3 adições e 3 exclusões
  1. 3 3
      app/public/table-template.js

+ 3 - 3
app/public/table-template.js

@@ -1,7 +1,7 @@
 'use strict';
 const _ = require('lodash');
 
-module.exports = data => {
+module.exports = (data) => {
   const { name, name_zh, columns } = data;
   let columnStr = `const ${name} = { \n`;
   let indexStr = '';
@@ -11,7 +11,7 @@ module.exports = data => {
   let configSearchStr = '';
   for (let i = 0; i < columns.length; i++) {
     const { title, type, required = false, remark, index, def } = columns[i];
-    const str = `  ${title}: { type: ${type || 'String'}, required: ${required} ${type === 'Secret' ? ', select: false' : ''} ${def ? `, default: '${def}'` : ''}, ${
+    const str = `  ${title}: { type: ${type || 'String'}, required: ${required} ${type === 'Secret' ? ', select: false' : ''} ${def ? `, default: '${def}'` : ''}${
       remark ? `, zh: '${remark}'` : ''
     } }, // ${remark || ''} \n`;
     columnStr += str;
@@ -25,7 +25,7 @@ module.exports = data => {
   }
   columnStr += '}';
   const nameList = name.split('_');
-  const modelName = nameList.map(i => _.capitalize(i)).join('_');
+  const modelName = nameList.map((i) => _.capitalize(i)).join('_');
   return `'use strict';
 const Schema = require('mongoose').Schema;
 const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');