Browse Source

Merge branch 'master' of http://smartcost.f3322.net:3000/caiaolin/Calculation

Conflicts:
	app/controller/ledger_controller.js
	app/router.js
	package.json
MaiXinRong 7 years ago
parent
commit
94a22b844a

+ 1 - 0
.gitignore

@@ -3,6 +3,7 @@ npm-debug.log
 node_modules/
 coverage/
 .idea/
+config/config.local.js
 run/
 .DS_Store
 *.swp

+ 9 - 2
app/base/base_controller.js

@@ -11,7 +11,6 @@ const moment = require('moment');
 const messageType = require('../const/message_type');
 const Controller = require('egg').Controller;
 const menuList = require('../../config/menu');
-const JsValidator = require('../lib/js_validator');
 class BaseController extends Controller {
 
     /**
@@ -23,9 +22,17 @@ class BaseController extends Controller {
     constructor(ctx) {
         super(ctx);
         this.messageType = messageType;
-        this.jsValidator = new JsValidator(ctx);
+        this.jsValidator = this.app.jsValidator;
         // 当前菜单
         ctx.menu = menuList[ctx.controllerName] === undefined ? {} : menuList[ctx.controllerName];
+        ctx.title = '';
+        if (ctx.menu.children !== undefined) {
+            for (const index in ctx.menu.children) {
+                if (index === ctx.actionName) {
+                    ctx.title = ctx.menu.children[index].name;
+                }
+            }
+        }
         // 菜单列表
         ctx.menuList = menuList;
         ctx.showProject = false;

+ 22 - 0
app/controller/ledger_controller.js

@@ -260,6 +260,28 @@ module.exports = app => {
 
             ctx.body = responseData;
         };
+
+        /**
+         * 台账变更页面
+         *
+         * @param {object} ctx - egg全局变量
+         * @return {void}
+         */
+        async change(ctx) {
+            const renderData = {};
+            await this.layout('ledger/change.ejs', renderData);
+        }
+
+        /**
+         * 计量台账页面
+         *
+         * @param {object} ctx - egg全局变量
+         * @return {void}
+         */
+        async index(ctx) {
+            const renderData = {};
+            await this.layout('ledger/index.ejs', renderData);
+        }
     }
 
     return LedgerController;

+ 42 - 0
app/controller/measure_controller.js

@@ -0,0 +1,42 @@
+'use strict';
+
+/**
+ * 计量相关控制器
+ *
+ * @author olym
+ * @date 2018/2/11
+ * @version
+ */
+
+module.exports = app => {
+
+    class MeasureController extends app.BaseController {
+
+        /**
+         * 构造函数
+         *
+         * @param {Object} ctx - egg全局变量
+         * @return {void}
+         */
+        constructor(ctx) {
+            super(ctx);
+            ctx.showProject = true;
+            ctx.showTender = true;
+            ctx.showTitle = false;
+        }
+
+        /**
+         * 中间计量页面
+         *
+         * @param {Object} ctx - egg全局变量
+         * @return {void}
+         */
+        async middle(ctx) {
+            const renderData = {};
+            await this.layout('measure/middle.ejs', renderData);
+        }
+
+    }
+
+    return MeasureController;
+};

+ 0 - 135
app/lib/js_validator.js

@@ -1,135 +0,0 @@
-'use strict';
-
-/**
- * egg内置验证器与jquery验证器结合
- *
- * @author CaiAoLin
- * @date 2018/2/7
- * @version
- */
-
-class JSValidator {
-
-    /**
-     * 构造函数
-     *
-     * @param {Object} ctx - egg全局变量
-     * @return {void}
-     */
-    constructor(ctx) {
-        this.rule = {};
-        // 模板
-        this.template = 'layout/validator_template.ejs';
-        // 表单元素
-        this.selector = 'form';
-        this.ctx = ctx;
-        this.message = {};
-    }
-
-    /**
-     * 设置选择器
-     *
-     * @param {String} selectorName - 选择器名称
-     * @return {Object} - 返回自身类以便链式操作
-     */
-    setSelector(selectorName) {
-        this.selector = selectorName;
-        return this;
-    }
-
-    /**
-     * 转换格式
-     *
-     * @param {Object} rule - egg中的规则
-     * @return {Object} - 返回自身类以便链式操作
-     */
-    convert(rule) {
-        const result = {};
-        const messageResult = {};
-        if (Object.keys(rule).length <= 0) {
-            return rule;
-        }
-
-        for (const index in rule) {
-            result[index] = {};
-            const type = rule[index].type !== undefined && rule[index].type !== '' ? rule[index].type : '';
-            const stringType = ['string', 'password'];
-            // 是否必填
-            if (rule[index].required !== undefined) {
-                result[index].required = rule[index].required;
-            }
-
-            // 最小长度
-            if (stringType.indexOf(type) >= 0 && rule[index].min !== undefined) {
-                result[index].minlength = rule[index].min;
-            }
-
-            // 最大长度
-            if (stringType.indexOf(type) >= 0 && rule[index].max !== undefined) {
-                result[index].maxlength = rule[index].max;
-            }
-
-            // 密码相关
-            if (type === 'password' && rule[index].compare !== undefined) {
-                result[index].equalTo = '#' + rule[index].compare;
-            }
-
-            // 最小值
-            const integerType = ['integer', 'int', 'Number'];
-            if (integerType.indexOf(type) >= 0 && rule[index].min !== undefined) {
-                result[index].min = rule[index].min;
-            }
-
-            // 最大值
-            if (integerType.indexOf(type) >= 0 && rule[index].max !== undefined) {
-                result[index].max = rule[index].max;
-            }
-
-            // 自定义判断
-            const customType = ['mobile', 'ip'];
-            // 自定义且带参数
-            if (customType.indexOf(type) >= 0) {
-                result[index][type] = true;
-                if (rule[index].allowEmpty !== undefined) {
-                    result[index].required = !rule[index].allowEmpty;
-                }
-            }
-
-            // 密码值判断
-            if (type === 'password' && rule[index].compare !== undefined) {
-                result[index].equalTo = '#' + rule[index].compare;
-            }
-
-            // 提示语
-            if (rule[index].message !== undefined) {
-                messageResult[index] = rule[index].message;
-            }
-
-        }
-
-        this.rule = result;
-        this.message = messageResult;
-        return this;
-    }
-
-    /**
-     * 构建js
-     *
-     * @return {String} - 返回js
-     */
-    async build() {
-        if (Object.keys(this.rule).length <= 0) {
-            return '';
-        }
-
-        const renderData = {
-            selector: this.selector,
-            rule: this.rule,
-            message: this.message,
-        };
-        return await this.ctx.renderView(this.template, renderData);
-    }
-
-}
-
-module.exports = JSValidator;

+ 5 - 0
app/router.js

@@ -40,6 +40,8 @@ module.exports = app => {
     app.post('/ledger/down-move', sessionAuth, 'ledgerController.downMove');
     app.post('/ledger/up-level', sessionAuth, 'ledgerController.upLevel');
     app.post('/ledger/down-level', sessionAuth, 'ledgerController.downLevel');
+    app.get('/ledger/change', sessionAuth, 'ledgerController.change');
+    app.get('/ledger/index', sessionAuth, 'ledgerController.index');
 
     // 个人账号相关
     app.get('/profile/info', sessionAuth, 'profileController.info');
@@ -51,4 +53,7 @@ module.exports = app => {
     // 标段管理相关
     app.get('/tender', sessionAuth, 'tenderController.index');
     app.post('/tender/add', sessionAuth, datetimeFill, 'tenderController.add');
+
+    // 计量管理相关
+    app.get('/measure/middle', sessionAuth, 'measureController.middle');
 };

+ 1 - 1
app/view/layout/layout.ejs

@@ -36,7 +36,7 @@
     <% } %>
     <% if(ctx.showTitle) { %>
     <div class="poj-name">
-        <span class="name"><%= ctx.menu.name %></span>
+        <span class="name"><%= ctx.title %></span>
     </div>
     <% } %>
     <div class="header-box">

+ 1 - 1
app/view/layout/menu.ejs

@@ -12,7 +12,7 @@
                     <% } %>
                 </a>
                 <% if (ctx.menuList[index].children !== null) { %>
-                <ul class="sub-menu">
+                <ul class="sub-menu" <% if(ctx.controllerName === index) { %>style="display: block;"<% }%>>
                     <% for (const childIndex in ctx.menuList[index].children) { %>
                     <li><a href="<%= ctx.menuList[index].children[childIndex].url %>"><%= ctx.menuList[index].children[childIndex].name %></a></li>
                     <% } %>

+ 25 - 0
app/view/layout/modal.ejs

@@ -45,4 +45,29 @@
             </div>
         </div>
     </div>
+</div>
+
+<!--弹出新建台帐变更-->
+<div class="modal fade" id="add-bg" data-backdrop="static">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">新建变更</h5>
+            </div>
+            <div class="modal-body">
+                <div class="form-group">
+                    <label>变更编号<b class="text-danger">*</b></label>
+                    <input class="form-control"  value="0006" type="text" readonly>
+                </div>
+                <div class="form-group">
+                    <label>变更名称<b class="text-danger">*</b></label>
+                    <input class="form-control"  placeholder="输入标段名称" type="text">
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+                <button type="button" class="btn btn-primary">确定新建</button>
+            </div>
+        </div>
+    </div>
 </div>

+ 98 - 0
app/view/ledger/change.ejs

@@ -0,0 +1,98 @@
+<div class="panel-content">
+    <div class="panel-title fluid">
+        <div class="title-main  d-flex justify-content-between"><!--工具-->
+            <div>
+                <div class="btn-group">
+                    <input type="month" class="form-control form-control-sm mt-0">
+                </div>
+                <div class="btn-group">
+                    <select class="form-control form-control-sm mt-0">
+                        <option>全部</option>
+                        <option>草稿</option>
+                        <option>审批中</option>
+                        <option>退回</option>
+                        <option>完成</option>
+                        <option>作废</option>
+                    </select>
+                </div>
+            </div>
+            <div>
+                <a href="#add-bg" data-toggle="modal" data-target="#add-bg" class="btn btn-primary btn-sm">新建变更</a>
+            </div>
+        </div>
+    </div>
+    <div class="content-wrap">
+        <div class="c-body">
+            <table class="table table-bordered">
+                <thead>
+                <tr>
+                    <th>编号</th>
+                    <th>变更名称</th>
+                    <th>创建时间</th>
+                    <th>提交人</th>
+                    <th>状态</th>
+                    <th>处理时间</th>
+                    <th>操作</th>
+                </tr>
+                </thead>
+                <tr>
+                    <td>0001</td>
+                    <td><a href="taizhang-bg-detail.html">编写错漏1</a></td>
+                    <td>2017-11-23</td>
+                    <td>张三</td>
+                    <td>完成</td>
+                    <td>2017-11-25</td>
+                    <td></td>
+                </tr>
+                <tr>
+                    <td>0002</td>
+                    <td><a href="taizhang-bg-detail.html">编写错漏2</a></td>
+                    <td>2017-11-23</td>
+                    <td>张三</td>
+                    <td>王五 审批中</td>
+                    <td></td>
+                    <td></td>
+                </tr>
+                <tr>
+                    <td>0003</td>
+                    <td><a href="taizhang-bg-detail.html">编写错漏3</a></td>
+                    <td>2017-11-23</td>
+                    <td>张三</td>
+                    <td>退回</td>
+                    <td>2017-12-06</td>
+                    <td><a href="#" class="btn btn-primary btn-sm">重新上报</a> <a href="#"
+                                                                               class="btn btn-secondary btn-sm">作废</a>
+                    </td>
+                </tr>
+                <tr>
+                    <td>0004</td>
+                    <td><a href="taizhang-bg-detail.html">编写错漏4</a></td>
+                    <td>2017-11-23</td>
+                    <td>张三</td>
+                    <td>草稿</td>
+                    <td></td>
+                    <td><a href="#" class="btn btn-primary btn-sm">发起审批</a> <a href="#" class="btn btn-primary btn-sm">完成变更</a>
+                    </td>
+                </tr>
+                <tr>
+                    <td>0005</td>
+                    <td><a href="taizhang-bg-detail.html">编写错漏5</a></td>
+                    <td>2017-11-23</td>
+                    <td>张三</td>
+                    <td>张三 作废</td>
+                    <td>2017-11-24</td>
+                    <td></td>
+                </tr>
+                <tr>
+                    <td>0005</td>
+                    <td><a href="taizhang-bg-detail.html">编写错漏6</a></td>
+                    <td>2017-11-23</td>
+                    <td>张三</td>
+                    <td></td>
+                    <td></td>
+                    <td><a href="#" class="btn btn-danger btn-sm">删除</a></td>
+                </tr>
+            </table>
+        </div>
+    </div>
+</div>

+ 93 - 94
app/view/ledger/index.ejs

@@ -1,105 +1,104 @@
-<div class="panel-sidebar">
-    <div class="panel-title">
-        <div class="title-bar d-flex justify-content-between">
-            <h2>标段列表</h2>
-            <div class="mr-3">
-                <a href="#add-bd" data-toggle="modal" data-target="#add-bd" class="btn btn-sm btn-outline-primary">添加</a>
-            </div>
-        </div>
-    </div>
-    <div class="scrollbar-auto">
-        <div class="nav-box">
-            <ul class="nav-list list-unstyled">
-                <% tenderList.forEach(function(tender) {%>
-                <li <% if (currentTender === tender.id) { %>class="active"<% } %>><a href="/ledger?tender=<%= tender.id %>"><span><%= tender.name %></span></a></li>
-                <% }) %>
-            </ul>
-        </div>
-    </div>
-</div>
 <div class="panel-content">
-    <div class="panel-title">
-        <div class="title-main">
-            <h2>WWUJ-2 台帐
-                <a href="#" class="btn btn-primary btn-sm pull-right">上报审批</a>
-                <a href="#" class="btn btn-outline-secondary btn-sm pull-right disabled">已报审</a>
-                <a href="#" class="btn btn-outline-danger btn-sm pull-right">删除标段</a></h2>
-        </div>
-    </div>
-    <div class="content-wrap row">
-        <div class="c-header p-0 col-12 d-flex justify-content-between">
-            <!--工具-->
+    <div class="panel-title fluid">
+        <div class="title-main  d-flex justify-content-between"><!--工具-->
             <div>
-                <div class="form-check">
-                    <label class="form-check-label">
-                        <input type="checkbox" class="form-check-input">
-                        查看审批过程
-                    </label>
+                <div class="btn-group">
+                    <select class="form-control form-control-sm mt-0">
+                        <option>第 15 期</option>
+                        <option>第 14 期</option>
+                        <option>第 13 期</option>
+                        <option>第 12 期</option>
+                        <option>第 11 期</option>
+                    </select>
+                </div>
+                <div class="btn-group">
+                    <select class="form-control form-control-sm mt-0">
+                        <option>终审 王五</option>
+                        <option>2审 赵四</option>
+                        <option>1审 张三</option>
+                    </select>
+                </div>
+                <div class="btn-group">
+                    <div class="form-check-inline">
+                        <label class="form-check-label">
+                            <input class="form-check-input" type="checkbox">
+                            审批结果比较
+                        </label>
+                    </div>
                 </div>
             </div>
-            <!--标准清单-->
-            <ul class="nav nav-tabs">
-                <li class="nav-item">
-                    <a class="nav-link active" data-toggle="tab" href="#xiangmujie" role="tab">项目节</a>
-                </li>
-                <li class="nav-item">
-                    <a class="nav-link" data-toggle="tab" href="#qingdan" role="tab">工程量清单</a>
-                </li>
-            </ul>
+            <div>
+            </div>
         </div>
-        <div class="c-body col-8">
+    </div>
+    <div class="content-wrap">
+        <div class="c-body">
             <table class="table table-bordered">
+                <thead>
                 <tr>
-                    <th></th>
-                    <th>项目节编号</th>
-                    <th>清单编号</th>
-                    <th>名称</th>
-                    <th>单位</th>
-                    <th>单价</th>
-                    <th>施工图原设计</th>
-                    <th>图(册)号</th>
-                    <th>备注</th>
+                    <th rowspan="2">1</th>
+                    <th rowspan="2">项目节编号</th>
+                    <th rowspan="2">清单编号</th>
+                    <th rowspan="2">名称</th>
+                    <th rowspan="2">单位</th>
+                    <th rowspan="2">单价</th>
+                    <th colspan="2">0号台帐合同</th>
+                    <th colspan="2">本期合同计量</th>
+                    <th colspan="3">本期数量变更计量</th>
+                    <th colspan="2">本期完成计量</th>
+                    <th colspan="2">截止本期合同计量</th>
+                    <th colspan="2">截止本期数量变更</th>
+                    <th colspan="2">截止本期完成计量</th>
+                    <th rowspan="2">图(册)号</th>
+                    <th rowspan="2">累计完成率(%)</th>
+                    <th rowspan="2">备注</th>
                 </tr>
+                <tr>
+                    <th>数量</th>
+                    <th>金额</th>
+                    <th>数量</th>
+                    <th>金额</th>
+                    <th>数量</th>
+                    <th>金额</th>
+                    <th>数量</th>
+                    <th>金额</th>
+                    <th>变更令</th>
+                    <th>数量</th>
+                    <th>金额</th>
+                    <th>数量</th>
+                    <th>金额</th>
+                    <th>数量</th>
+                    <th>金额</th>
+                </tr>
+                </thead>
+            </table>
+            <!--审批结果比较-->
+            <table class="table table-bordered">
+                <thead>
+                <tr>
+                    <th rowspan="2">1</th>
+                    <th rowspan="2">项目节编号</th>
+                    <th rowspan="2">清单编号</th>
+                    <th rowspan="2">名称</th>
+                    <th rowspan="2">单位</th>
+                    <th rowspan="2">单价</th>
+                    <th colspan="2">上报</th>
+                    <th colspan="2">1审 张三</th>
+                    <th colspan="2">2审 赵四</th>
+                    <th colspan="2">终审 王五</th>
+                </tr>
+                <tr>
+                    <th>数量</th>
+                    <th>金额</th>
+                    <th>数量</th>
+                    <th>金额</th>
+                    <th>数量</th>
+                    <th>金额</th>
+                    <th>数量</th>
+                    <th>金额</th>
+                </tr>
+                </thead>
             </table>
-        </div>
-        <div class="c-body col-4">
-            <div class="tab-content">
-                <div id="xiangmujie" class="tab-pane active">
-                    <select class="form-control form-control-sm">
-                        <option>0号计量台帐部位参考(项目节)</option>
-                    </select>
-                    <table class="table table-bordered">
-                        <tr>
-                            <th></th>
-                            <th>项目节编号</th>
-                            <th>名称</th>
-                            <th>单位</th>
-                        </tr>
-                    </table>
-                </div>
-                <div id="qingdan" class="tab-pane">
-                    <select class="form-control form-control-sm">
-                        <option>0号计量台帐部位参考(项目节)</option>
-                    </select>
-                    <table class="table table-bordered">
-                        <tr>
-                            <th></th>
-                            <th>清单编号</th>
-                            <th>名称</th>
-                            <th>单位</th>
-                        </tr>
-                    </table>
-                </div>
-            </div>
         </div>
     </div>
-</div>
-<script type="text/javascript">
-    let rule = '<%- rule %>';
-    rule = JSON.parse(rule);
-
-    let message = {
-    };
-</script>
-<script src="/public/js/form_validate.js"></script>
-<script src="/public/js/validate.extend.js"></script>
+</div>

+ 45 - 0
app/view/measure/middle.ejs

@@ -0,0 +1,45 @@
+<div class="panel-content">
+    <div class="panel-title fluid">
+        <div class="title-main d-flex justify-content-between">
+            <div>
+                <select class="form-control form-control-sm">
+                    <option>全部</option>
+                    <option>编制中</option>
+                    <option>审批中</option>
+                    <option>审批完成</option>
+                </select>
+            </div>
+            <div>
+                <a href="#" class="btn btn-primary btn-sm pull-right">添加计量</a>
+            </div>
+        </div>
+    </div>
+    <div class="content-wrap">
+        <div class="c-body">
+            <div class="tab-content">
+                <table class="table table-bordered">
+                    <thead>
+                    <tr>
+                        <th>计量编号</th>
+                        <th>计量金额</th>
+                        <th>计量月份</th>
+                        <th>计量期数</th>
+                        <th>状态</th>
+                        <th>当前处理人</th>
+                    </tr>
+                    </thead>
+                    <tbody>
+                    <tr>
+                        <td><a href="jiliang-detail.html">WWUJ-2-201710</a></td>
+                        <td>34234234.00</td>
+                        <td>201710</td>
+                        <td>15</td>
+                        <td>审批中</td>
+                        <td>监理-张三</td>
+                    </tr>
+                    </tbody>
+                </table>
+            </div>
+        </div>
+    </div>
+</div>

+ 5 - 1
config/config.local.js

@@ -19,7 +19,7 @@ module.exports = appInfo => {
             // 用户名
             user: 'root',
             // 密码
-            password: 'admin',
+            password: 'root',
             // 数据库名
             database: 'calculation',
         },
@@ -48,5 +48,9 @@ module.exports = appInfo => {
         key: '9b67989994f9def437ea68bb495f0162',
     };
 
+    config.jsValidator = {
+        client: {},
+        app: true,
+    };
     return config;
 };

+ 4 - 0
config/plugin.js

@@ -26,3 +26,7 @@ exports.sessionRedis = {
     enable: true,
     package: 'egg-session-redis',
 };
+exports.jsValidator = {
+    enable: true,
+    package: 'egg-js-validator',
+};

File diff suppressed because it is too large
+ 2322 - 2243
package-lock.json


+ 7 - 7
package.json

@@ -4,8 +4,8 @@
   "description": "calculation paying frontend",
   "private": true,
   "dependencies": {
-    "egg": "^1.7.0",
-    "egg-js-validator": "^1.0.0",
+    "egg": "^1.13.0",
+    "egg-js-validator": "^1.0.2",
     "egg-mysql": "^3.0.0",
     "egg-redis": "^1.0.2",
     "egg-scripts": "^1.0.0",
@@ -14,17 +14,17 @@
     "egg-view": "^1.1.2",
     "egg-view-ejs": "^1.1.0",
     "gt3-sdk": "^2.0.0",
-    "moment": "^2.18.1",
+    "moment": "^2.20.1",
     "ueditor": "^1.2.3",
     "xmlreader": "^0.2.3"
   },
   "devDependencies": {
     "autod": "^2.9.0",
-    "autod-egg": "^1.0.0",
-    "egg-bin": "^4.1.0",
+    "autod-egg": "^1.1.0",
+    "egg-bin": "^4.3.7",
     "egg-ci": "^1.8.0",
-    "egg-mock": "^3.9.0",
-    "eslint": "^4.3.0",
+    "egg-mock": "^3.14.0",
+    "eslint": "^4.17.0",
     "eslint-config-egg": "^5.0.0",
     "webstorm-disable-index": "^1.2.0"
   },

+ 0 - 59
test/app/lib/js_validator.test.js

@@ -1,59 +0,0 @@
-'use strict';
-
-/**
- * jsvalidator单元测试
- *
- * @author CaiAoLin
- * @date 2018/2/7
- * @version
- */
-
-const JsValidator = require('../../../app/lib/js_validator');
-const { app, assert } = require('egg-mock/bootstrap');
-
-describe('test/app/lib/js_validator.test.js', () => {
-
-    it('test convert', function* () {
-        // 创建 ctx
-        const ctx = app.mockContext();
-        const jsValidator = new JsValidator(ctx);
-        const rule = {
-            username: { type: 'string', required: true, allowEmpty: false, min: 4, max: 10 },
-            group_id: { type: 'integer', required: true, allowEmpty: false, min: 4, max: 10 },
-            password: { type: 'password', required: true, allowEmpty: false, min: 4 },
-            confirm_password: { type: 'password', required: true, allowEmpty: false, min: 4, compare: 'password' },
-            ip: { type: 'ip', allowEmpty: false },
-            telephone: { type: 'mobile', allowEmpty: false },
-        };
-        // 转换为json验证
-        jsValidator.convert(rule);
-        const convertRule = JSON.stringify(jsValidator.rule);
-        let expectRule = {
-            username: { required: true, minlength: 4, maxlength: 10 },
-            group_id: { required: true, min: 4, max: 10 },
-            password: { required: true, minlength: 4 },
-            confirm_password: { required: true, minlength: 4, equalTo: '#password' },
-            ip: { ip: true, required: true },
-            telephone: { mobile: true, required: true },
-        };
-        expectRule = JSON.stringify(expectRule);
-        assert(convertRule === expectRule);
-    });
-
-    it('test js validator', function* () {
-        const ctx = app.mockContext();
-        const jsValidator = new JsValidator(ctx);
-
-        const rule = {
-            username: { type: 'string', required: true, allowEmpty: false, min: 4, max: 10 },
-            group_id: { type: 'integer', required: true, allowEmpty: false, min: 4, max: 10 },
-            password: { type: 'password', required: true, allowEmpty: false, min: 4 },
-            confirm_password: { type: 'password', required: true, allowEmpty: false, min: 4, compare: 'password' },
-            ip: { type: 'ip', allowEmpty: false },
-            telephone: { type: 'mobile', allowEmpty: false },
-        };
-        const jsCode = jsValidator.convert(rule).build();
-        assert(jsCode !== '');
-    });
-
-});