Преглед изворни кода

Merge branch 'develop5.0-tmd' of http://106.12.23.251:10000/TEAMMODEL/TEAMModelOS into develop5.0-tmd

CrazyIter_Bin пре 3 година
родитељ
комит
a06632c255
25 измењених фајлова са 14698 додато и 1091 уклоњено
  1. 28 26
      TEAMModelOS/ClientApp/public/kityformula/assets/styles/base.css
  2. 2 1
      TEAMModelOS/ClientApp/public/kityformula/assets/styles/page.css
  3. 146 104
      TEAMModelOS/ClientApp/public/kityformula/dev-lib/dev-define.js
  4. 1580 0
      TEAMModelOS/ClientApp/public/kityformula/dev-lib/kity-formula-parser.all 2.js
  5. 9 0
      TEAMModelOS/ClientApp/public/kityformula/dev-lib/kity-formula-parser.all.min 2.js
  6. 5757 0
      TEAMModelOS/ClientApp/public/kityformula/dev-lib/kity-formula-render.all 2.js
  7. 12 0
      TEAMModelOS/ClientApp/public/kityformula/dev-lib/kity-formula-render.all.min 2.js
  8. 6195 0
      TEAMModelOS/ClientApp/public/kityformula/dev-lib/kitygraph.all 2.js
  9. 2 2
      TEAMModelOS/ClientApp/public/kityformula/dev-lib/kitygraph.all.js
  10. 1 0
      TEAMModelOS/ClientApp/public/kityformula/dev-lib/start.js
  11. 39 37
      TEAMModelOS/ClientApp/public/kityformula/index.html
  12. 78 0
      TEAMModelOS/ClientApp/public/kityformula/lang/en/en.js
  13. 80 0
      TEAMModelOS/ClientApp/public/kityformula/lang/zh-cn/zh-cn.js
  14. 80 0
      TEAMModelOS/ClientApp/public/kityformula/lang/zh-tw/zh-tw.js
  15. 46 7
      TEAMModelOS/ClientApp/public/kityformula/src/editor/editor.js
  16. 1 1
      TEAMModelOS/ClientApp/public/kityformula/src/parse/parser.js
  17. 1 1
      TEAMModelOS/ClientApp/public/kityformula/src/sysconf.js
  18. 5 179
      TEAMModelOS/ClientApp/public/kityformula/src/ui/other-position.data.js
  19. 604 710
      TEAMModelOS/ClientApp/public/kityformula/src/ui/toolbar-ele-list.js
  20. 1 1
      TEAMModelOS/ClientApp/public/kityformula/src/ui/toolbar/toolbar.js
  21. 4 10
      TEAMModelOS/ClientApp/public/kityformula/src/ui/ui-impl/box.js
  22. 15 2
      TEAMModelOS/ClientApp/src/common/BaseClassSelect.vue
  23. 1 1
      TEAMModelOS/ClientApp/src/components/vote/BaseVoteForm.vue
  24. 5 4
      TEAMModelOS/ClientApp/src/view/answersheet/index.vue
  25. 6 5
      TEAMModelOS/ClientApp/src/view/learnactivity/AutoCreateNew.vue

+ 28 - 26
TEAMModelOS/ClientApp/public/kityformula/assets/styles/base.css

@@ -1,38 +1,40 @@
+
 .kf-editor {
-  width: 100%;
-  height: 100%;
-  position: relative;
-  top: 0;
-  left: 0;
+    width: 100%;
+    height: 100%;
+    border: 1px solid #e0e0e0;
+    position: relative;
+    top: 0;
+    left: 0;
 
-  overflow: hidden;
-  z-index: 2;
-  background-color: #f6f5ee;
+    overflow: hidden;
+    z-index: 2;
+    background-color: #f6f5ee;
 }
 
 .kf-editor-edit-area {
-  position: relative;
-  top: 0;
-  left: 0;
+    position: relative;
+    top: 0;
+    left: 0;
 
-  z-index: 1;
-  height: 0;
-  background-color: white;
-  /*background-color: white;*/
-  /*background-size: 21px 21px;*/
-  /*background-position: 0 0,10px 10px;*/
-  /*background-image: -webkit-linear-gradient(45deg,#efefef 25%,transparent 25%,transparent 75%,#efefef 75%,#efefef),-webkit-linear-gradient(45deg,#efefef 25%,transparent 25%,transparent 75%,#efefef 75%,#efefef);*/
-  /*background-image: linear-gradient(45deg,#efefef 25%,transparent 25%,transparent 75%,#efefef 75%,#efefef),linear-gradient(45deg,#efefef 25%,transparent 25%,transparent 75%,#efefef 75%,#efefef);*/
+    z-index: 1;
+    height: 0;
+    background-color: white;
+    /*background-color: white;*/
+    /*background-size: 21px 21px;*/
+    /*background-position: 0 0,10px 10px;*/
+    /*background-image: -webkit-linear-gradient(45deg,#efefef 25%,transparent 25%,transparent 75%,#efefef 75%,#efefef),-webkit-linear-gradient(45deg,#efefef 25%,transparent 25%,transparent 75%,#efefef 75%,#efefef);*/
+    /*background-image: linear-gradient(45deg,#efefef 25%,transparent 25%,transparent 75%,#efefef 75%,#efefef),linear-gradient(45deg,#efefef 25%,transparent 25%,transparent 75%,#efefef 75%,#efefef);*/
 }
 
 .kf-editor-canvas-container {
-  width: 100%;
-  height: 100%;
+    width: 100%;
+    height: 100%;
 }
 
 .kf-editor-input-box {
-  position: fixed;
-  top: 0;
-  left: -99999999px;
-  z-index: 999999;
-}
+    position: fixed;
+    top: 0;
+    left: -99999999px;
+    z-index: 999999;
+}

+ 2 - 1
TEAMModelOS/ClientApp/public/kityformula/assets/styles/page.css

@@ -4,8 +4,9 @@ html, body {
     height: 100%;
     padding: 0;
     margin: 0;
+    background: rgba( 48, 48, 48, 0.5 );
 }
 
 body {
-    /* height: 1000px; */
+    height: 1000px;
 }

+ 146 - 104
TEAMModelOS/ClientApp/public/kityformula/dev-lib/dev-define.js

@@ -3,135 +3,177 @@
  * 开发用
  */
 
-;(function(global) {
-  var _modules = {},
-    // 记录模块执行顺序的key列表
-    keyList = [],
-    loaded = {}
-
-  global.inc = {
-    base: './src',
-
-    config: function(options) {
-      this.base = options.base || ''
-    },
-
-    record: function(key) {
-      keyList.push(key)
-    },
-
-    use: function(id) {
-      return require(id)
-    },
-
-    remove: function(node) {
-      node.parentNode.removeChild(node)
-    },
-  }
-
-  global.define = function(id, deps, f) {
-    var argLen = arguments.length,
-      module = null
-
-    switch (argLen) {
-      case 1:
-        f = id
-        id = keyList.shift()
-        break
-
-      case 2:
-        if (typeof id === 'string') {
-          f = deps
+( function ( global ) {
+
+    var _modules = {},
+        // 记录模块执行顺序的key列表
+        keyList = [],
+        loaded = {};
+
+    global.inc = {
+
+        base: '',
+
+        config: function ( options ) {
+
+            this.base = options.base || '';
+
+        },
+
+        record: function ( key ) {
+            keyList.push( key );
+        },
+
+        use: function ( id ) {
+
+            return require( id );
+
+        },
+
+        remove: function ( node ) {
+
+            node.parentNode.removeChild( node );
+
+        }
+
+    };
+
+    global.define = function ( id, deps, f ) {
+
+        var argLen = arguments.length,
+            module = null;
+
+        switch ( argLen ) {
+
+            case 1:
+                f = id;
+                id = keyList.shift();
+                break;
+
+            case 2:
+                if ( typeof id === 'string' ) {
+
+                    f = deps;
+
+                } else {
+
+                    f = deps;
+                    id = keyList.shift();
+
+                }
+
+                break;
+
+        }
+
+        module = _modules[ id ] = {
+
+            exports: {},
+            value: null,
+            factory: null
+
+        };
+
+        loadDeps( f );
+
+        if ( typeof f === 'function' ) {
+
+            module.factory = f;
+
         } else {
-          f = deps
-          id = keyList.shift()
+
+            module.value = f;
+
         }
 
-        break
     }
 
-    module = _modules[id] = {
-      exports: {},
-      value: null,
-      factory: null,
-    }
+    function require ( id ) {
 
-    loadDeps(f)
+        var exports = {},
+            module = _modules[ id ];
 
-    if (typeof f === 'function') {
-      module.factory = f
-    } else {
-      module.value = f
-    }
-  }
+        if ( module.value ) {
 
-  function require(id) {
-    var exports = {},
-      module = _modules[id]
+            return module.value;
 
-    if (module.value) {
-      return module.value
-    }
+        }
 
-    exports = module.factory(require, module.exports, module)
+        exports = module.factory( require, module.exports, module );
 
-    if (exports) {
-      module.exports = exports
-    }
+        if ( exports ) {
 
-    module.value = module.exports
-    module.exports = null
-    module.factory = null
+            module.exports = exports;
 
-    return module.value
-  }
+        }
 
-  function loadDeps(factory) {
-    var deps = null,
-      pathname = location.pathname,
-      uri = location.protocol + '//' + location.host
+        module.value = module.exports;
+        module.exports = null;
+        module.factory = null;
 
-    pathname = pathname.split('/')
+        return module.value;
 
-    if (pathname[pathname.length - 1] !== '') {
-      pathname[pathname.length - 1] = ''
     }
 
-    uri += pathname.join('/')
+    function loadDeps ( factory ) {
 
-    if (typeof factory === 'function') {
-      deps = loadDepsByFunction(factory)
-    } else {
-      // 未处理object的情况
-      return
-    }
+        var deps = null,
+            pathname = location.pathname,
+            uri = location.protocol + '//' + location.host;
+
+        pathname = pathname.split( '/');
+
+        if ( pathname[ pathname.length - 1 ] !== '' ) {
+
+            pathname[ pathname.length - 1 ] = '';
 
-    for (var i = 0, len = deps.length; i < len; i++) {
-      var key = deps[i]
+        }
+
+        uri += pathname.join( '/' );
 
-      if (loaded[key]) {
-        continue
-      }
+        if ( typeof factory === 'function' ) {
 
-      loaded[key] = true
+            deps = loadDepsByFunction( factory );
+
+        } else {
+
+            // 未处理object的情况
+            return;
+
+        }
+
+        for ( var i = 0, len = deps.length; i < len; i++ ) {
+
+            var key = deps[ i ];
+
+            if ( loaded[ key ] ) {
+                continue;
+            }
+
+            loaded[ key ] = true;
+
+            document.write( '<script>inc.record("'+ key +'")</script>' );
+            document.write( '<script src="'+ uri + inc.base + '/' + key +'.js" onload="inc.remove(this)" data-id="'+ key +'"></script>' );
+
+        }
 
-      document.write('<script>inc.record("' + key + '")</script>')
-      document.write(
-        '<script src="' + uri + inc.base + '/' + key + '.js" onload="inc.remove(this)" data-id="' + key + '"></script>'
-      )
     }
-  }
 
-  function loadDepsByFunction(factory) {
-    var content = factory.toString(),
-      match = null,
-      deps = [],
-      pattern = /require\s*\(\s*([^)]+?)\s*\)/g
+    function loadDepsByFunction ( factory ) {
+
+        var content = factory.toString(),
+            match = null,
+            deps = [],
+            pattern = /require\s*\(\s*([^)]+?)\s*\)/g;
+
+        while ( match = pattern.exec( content ) ) {
+
+            deps.push( match[ 1 ].replace( /'|"/g, '' ) );
+
+        }
+
+        return deps;
 
-    while ((match = pattern.exec(content))) {
-      deps.push(match[1].replace(/'|"/g, ''))
     }
 
-    return deps
-  }
-})(this)
+} )( this );

Разлика између датотеке није приказан због своје велике величине
+ 1580 - 0
TEAMModelOS/ClientApp/public/kityformula/dev-lib/kity-formula-parser.all 2.js


Разлика између датотеке није приказан због своје велике величине
+ 9 - 0
TEAMModelOS/ClientApp/public/kityformula/dev-lib/kity-formula-parser.all.min 2.js


Разлика између датотеке није приказан због своје велике величине
+ 5757 - 0
TEAMModelOS/ClientApp/public/kityformula/dev-lib/kity-formula-render.all 2.js


Разлика између датотеке није приказан због своје велике величине
+ 12 - 0
TEAMModelOS/ClientApp/public/kityformula/dev-lib/kity-formula-render.all.min 2.js


Разлика између датотеке није приказан због своје велике величине
+ 6195 - 0
TEAMModelOS/ClientApp/public/kityformula/dev-lib/kitygraph.all 2.js


+ 2 - 2
TEAMModelOS/ClientApp/public/kityformula/dev-lib/kitygraph.all.js

@@ -1,9 +1,9 @@
 /*!
  * ====================================================
- * kity - v2.0.5 - 2015-11-12
+ * kity - v2.0.4 - 2016-02-18
  * https://github.com/fex-team/kity
  * GitHub: https://github.com/fex-team/kity.git 
- * Copyright (c) 2015 Baidu FEX; Licensed BSD
+ * Copyright (c) 2016 Baidu FEX; Licensed BSD
  * ====================================================
  */
 

+ 1 - 0
TEAMModelOS/ClientApp/public/kityformula/dev-lib/start.js

@@ -17,5 +17,6 @@ define( 'kf.start', function ( require ) {
     KFEditor.registerComponents( "print", require( "print/printer" ) );
 
     kf.EditorFactory = Factory;
+    kf.I18N = {};
 
 } );

+ 39 - 37
TEAMModelOS/ClientApp/public/kityformula/index.html

@@ -1,55 +1,57 @@
 <!DOCTYPE html>
 <html>
-  <head>
+<head>
     <title>公式编辑器</title>
-    <meta charset="UTF-8" />
-    <meta name="renderer" content="webkit" />
+    <meta charset="UTF-8">
+    <meta name="renderer" content="webkit">
     <script src="dev-lib/jquery-1.11.0.min.js"></script>
     <script src="dev-lib/kitygraph.all.js"></script>
     <script src="dev-lib/kity-formula-render.all.js"></script>
     <script src="dev-lib/kity-formula-parser.all.min.js"></script>
     <script src="dev-lib/dev-define.js"></script>
+    <script>
+        inc.config({
+            base: './src'
+        });
+    </script>
     <script src="dev-lib/exports.js"></script>
     <script src="dev-lib/start.js"></script>
     <script src="dev-lib/dev-start.js"></script>
+    <script src="lang/en/en.js"></script>
+    <script src="lang/zh-cn/zh-cn.js"></script>
+    <script src="lang/zh-tw/zh-tw.js"></script>
     <!--<script src="dist/kityformula-editor.all.min.js"></script>-->
-    <!-- <script src="build/sprites.other.js"></script> -->
     <script>
-      jQuery(function($) {
-        $('#tips').html(
-          '<div id="loading"><p>正在加载,请耐心等待...</p></div>'
-        )
-        var factory = kf.EditorFactory.create($('#kfEditorContainer')[0], {
-          render: {
-            fontsize: 40,
-          },
-          resource: {
-            path: 'resource/',
-          },
-        })
+        jQuery( function ($) {
+            var factory = kf.EditorFactory.create( $( "#kfEditorContainer" )[ 0 ], {
+                render: {
+                    fontsize: 40
+                },
+                resource: {
+                    path: "resource/"
+                },
+                lang: 'zh-cn'
+            });
+
+            factory.ready( function ( KFEditor ) {
+
+                // this指向KFEditor
 
-        factory.ready(function(KFEditor) {
-          // this指向KFEditor
-          $('#tips').remove()
+                this.execCommand( "render", "\\placeholder" );
+                this.execCommand( "focus" );
 
-          this.execCommand('render', '\\placeholder')
-          this.execCommand('focus')
+                window.kfe = this;
 
-          window.kfe = this
-        })
+            } );
 
-      })
+        } );
     </script>
-    <link rel="stylesheet" href="assets/styles/page.css" />
-    <link rel="stylesheet" href="assets/styles/base.css" />
-    <link rel="stylesheet" href="assets/styles/ui.css" />
-    <link rel="stylesheet" href="assets/styles/scrollbar.css" />
-  </head>
-  <body>
-    <div
-      id="kfEditorContainer"
-      class="kf-editor"
-      style="width: 100%; height: 100%;"
-    ></div>
-  </body>
-</html>
+    <link rel="stylesheet" href="assets/styles/page.css">
+    <link rel="stylesheet" href="assets/styles/base.css">
+    <link rel="stylesheet" href="assets/styles/ui.css">
+    <link rel="stylesheet" href="assets/styles/scrollbar.css">
+</head>
+<body>
+    <div id="kfEditorContainer" class="kf-editor" style="height: 502px; position: absolute;"></div>
+</body>
+</html>

+ 78 - 0
TEAMModelOS/ClientApp/public/kityformula/lang/en/en.js

@@ -0,0 +1,78 @@
+kf.I18N["en-us"] = {
+    'rootText': "Enter formula",
+    "labelMap":{
+    	"preset": "Preset<br/>",
+    	"fraction": "Fraction<br/>",
+    	"roots":"Roots<br/>",
+    	"integral": "Integral<br/>",
+    	"largeoperator":"Large<br/>Operator",
+    	"function":"Function<br/>",
+    	"bracket":"Brackets<br/>",
+    	"subsupscript":"Subscript<br/>Superscript"
+    },
+    "preset": {
+        'title' : "Preset formula",
+        'quadraticformula': "Quadratic formula",
+        'binomialtheorem': "Binomial theorem",
+        'pythagoreantheorem' : "Pythagorean theorem"
+    },
+    // AREA start
+    'basicmathematics': {
+       'title': "Basic Mathematics",
+       'basicmathematics': "Basic Mathematics"
+    },
+    "arrow": {
+        'title': "Arrow",
+        'arrow': "Arrow"
+    },
+    'negatedrelationaloperators': {
+        'title': "Negated relational operators",
+        'negatedrelationaloperators': "Negated relational operators"
+    },
+    "handwritten": {
+        'title': "Handwritten",
+        'handwritten': "Handwritten",
+        'curlicue': "Curlicue",
+        'doble': "Double",
+        'roman': "Roman"
+    },
+    "letterlikesymbols": {
+        'title': "Letter-like symbols",
+        'letterlikesymbols':"Letter-like symbols"
+    },
+    "greekletter": {
+        'title': "Greek letter",
+        'lowercase': "Lowercase",
+        'uppercase': "Uppercase",
+        'variants': "Variants"
+    },
+    // AREA end
+
+    "fraction":{
+        'fraction': "Fraction",
+        'commonfraction': "Common fraction"
+
+    },
+    "roots":{
+       'roots' : "Roots",
+       'commonroots' : "Common roots"
+    },
+    "integral":{
+        'integral': "Integral"
+    },
+    "largeoperator":{
+        'sum': "Sum"
+    },
+    "function":{
+        'title': "Function",
+        'trigonometric': "Trigonometric",
+        'commonfunction': "Common function"
+    },
+    "bracket": {
+       'bracket' : "Brackets"
+    },
+    "subsupscript":{
+       'subsupscript' : "Superscript and subscript",
+       'commonsubsupscript' : "Common superscript and subscript"
+    }  
+};

+ 80 - 0
TEAMModelOS/ClientApp/public/kityformula/lang/zh-cn/zh-cn.js

@@ -0,0 +1,80 @@
+kf.I18N["zh-cn"] = {
+    'rootText': "在此处键入公式",
+    "labelMap":{
+    	"preset": "预设<br/>",
+    	"fraction": "分数<br/>",
+    	"roots":"根式<br/>",
+    	"integral": "积分<br/>",
+    	"largeoperator":"大型<br/>运算符",
+    	"function":"函数<br/>",
+    	"bracket":"括号<br/>",
+    	"subsupscript":"上下标<br/>"
+    },
+    "preset":{
+        'title' : "预设公式",
+        'quadraticformula': "二次公式",
+        'binomialtheorem': "二项式定理",
+        'pythagoreantheorem' : "勾股定理"
+    },
+    // AREA start
+    'basicmathematics': {
+       'title': "基础数学",
+       'basicmathematics': "基础数学"
+    },
+    "arrow": {
+        'title': "箭头",
+        'arrow': "箭头"
+    },
+    'negatedrelationaloperators': {
+        'title': "求反关系运算符",
+        'negatedrelationaloperators': "求反关系运算符"
+    },
+    "handwritten": {
+        'title': "手写体",
+        'handwritten': "手写体",
+        'curlicue': "花体",
+        'doble': "双线",
+        'roman': "罗马"
+    },
+    "letterlikesymbols": {
+        'title': "字母类符号",
+        'letterlikesymbols':"字母类符号"
+    },
+    "greekletter": {
+        'title': "希腊字母",
+        'lowercase': "小写",
+        'uppercase': "大写",
+        'variants': "变体"
+    },
+    // AREA end
+
+    "fraction":{
+        'fraction': "分数",
+        'commonfraction': "常用分数"
+
+    },
+    "roots":{
+       'roots' : "根式",
+       'commonroots' : "常用根式"
+    },
+    "integral":{
+        'integral': "积分"
+    },
+
+    "largeoperator":{
+        'largeoperator': "求和"
+    },
+    "function":{
+        'title': "函数",
+        'trigonometric': "三角函数",
+        'commonfunction': "常用函数"
+    },
+    "bracket": {
+       'bracket' : "方括号"
+    },
+    "subsupscript":{
+       'subsupscript' : "上标和下标",
+       'commonsubsupscript' : "常用的上标和下标"
+    }
+
+};

+ 80 - 0
TEAMModelOS/ClientApp/public/kityformula/lang/zh-tw/zh-tw.js

@@ -0,0 +1,80 @@
+kf.I18N["zh-tw"] = {
+    'rootText': "在此處鍵入公式",
+    "labelMap":{
+    	"preset": "預設<br/>",
+    	"fraction": "分數<br/>",
+    	"roots":"根式<br/>",
+    	"integral": "積分<br/>",
+    	"largeoperator":"大型<br/>運算符",
+    	"function":"函數<br/>",
+    	"bracket":"括號<br/>",
+    	"subsupscript":"上下標<br/>"
+    },
+    "preset":{
+        'title' : "預設公式",
+        'quadraticformula': "二次公式",
+        'binomialtheorem': "二項式定理",
+        'pythagoreantheorem' : "勾股定理"
+    },
+    // AREA start
+    'basicmathematics': {
+       'title': "基礎數學",
+       'basicmathematics': "基礎數學"
+    },
+    "arrow": {
+        'title': "箭頭",
+        'arrow': "箭頭"
+    },
+    'negatedrelationaloperators': {
+        'title': "求反關系運算符",
+        'negatedrelationaloperators': "求反關系運算符"
+    },
+    "handwritten": {
+        'title': "手寫體",
+        'handwritten': "手寫體",
+        'curlicue': "花體",
+        'doble': "雙線",
+        'roman': "羅馬"
+    },
+    "letterlikesymbols": {
+        'title': "字母類符號",
+        'letterlikesymbols':"字母類符號"
+    },
+    "greekletter": {
+        'title': "希臘字母",
+        'lowercase': "小寫",
+        'uppercase': "大寫",
+        'variants': "變體"
+    },
+    // AREA end
+
+    "fraction":{
+        'fraction': "分數",
+        'commonfraction': "常用分數"
+
+    },
+    "roots":{
+       'roots' : "根式",
+       'commonroots' : "常用根式"
+    },
+    "integral":{
+        'integral': "積分"
+    },
+
+    "largeoperator":{
+        'largeoperator': "求和"
+    },
+    "function":{
+        'title': "函數",
+        'trigonometric': "三角函數",
+        'commonfunction': "常用函數"
+    },
+    "bracket": {
+       'bracket' : "方括號"
+    },
+    "subsupscript":{
+       'subsupscript' : "上標和下標",
+       'commonsubsupscript' : "常用的上標和下標"
+    }
+
+};

+ 46 - 7
TEAMModelOS/ClientApp/public/kityformula/src/editor/editor.js

@@ -6,6 +6,8 @@ define( function ( require ) {
 
     var kity = require( "kity" ),
         Utils = require( "base/utils" ),
+        kf = require( "kf" ),
+        $ = require('jquery'),
         defaultOpt = {
             formula: {
                 fontsize: 50,
@@ -15,10 +17,18 @@ define( function ( require ) {
                 zoom: true,
                 maxzoom: 2,
                 minzoom: 1
-            }
+            },
+            lang: 'zh-cn'
 
         };
 
+        function checkCurLang(I18N){
+            for(var lang in I18N){
+                return lang
+            }
+        }
+
+
     // 同步组件列表
     var COMPONENTS = {},
         // 异步组件列表
@@ -29,7 +39,6 @@ define( function ( require ) {
         constructor: function ( container, opt ) {
 
             this.options = Utils.extend( true, {}, defaultOpt, opt );
-
             this.FormulaClass = null;
             // 就绪状态
             this._readyState = false;
@@ -59,7 +68,22 @@ define( function ( require ) {
             }
 
         },
-
+        getLang: function (path) {
+            var opt = this.getOptions();
+			opt.lang = localStorage.getItem('local') || navigator.language.toLowerCase() || 'zh-cn'
+            var lang = kf.I18N[opt.lang];
+            if (!lang) {
+                throw Error("not import language file");
+            }
+            path = (path || "").split(".");
+            for (var i = 0, ci; ci = path[i++];) {
+                lang = lang[ci];
+                if (!lang){
+                    break;
+                }
+            }
+            return lang;
+        },
         ready: function ( cb ) {
 
             if ( this._readyState ) {
@@ -85,11 +109,8 @@ define( function ( require ) {
         getOptions: function () {
             return this.options;
         },
-
-        initResource: function () {
-
+        _initResource: function(){
             var _self = this;
-
             ResourceManager.ready( function ( Formula ) {
 
                 _self.FormulaClass = Formula;
@@ -100,6 +121,24 @@ define( function ( require ) {
             }, this.options.resource );
 
         },
+        initResource: function () {
+            var _self = this;
+
+            if(!$.isEmptyObject(kf.I18N)){
+                //修改默认的语言类型
+                _self.options.lang = checkCurLang(kf.I18N);
+                this._initResource();
+            }else{
+                var path = _self.options.langPath + _self.options.lang + "/" + _self.options.lang + ".js?refresh-20150923";
+                $.getScript(path)
+                .done(function( script, textStatus ) {
+                    _self._initResource();
+                })
+                .fail(function( jqxhr, settings, exception ) {
+                    _self._initResource();
+                });
+            }
+        },
 
         /**
          * 初始化同步组件

+ 1 - 1
TEAMModelOS/ClientApp/public/kityformula/src/parse/parser.js

@@ -113,7 +113,7 @@ define( function ( require ) {
             processRootGroup( parser, tree );
         // 根占位符处理, 附加label
         } else if ( parentTree.attr[ "data-root" ] && tree.name === "placeholder" && onlyPlaceholder( parentTree.operand ) ) {
-            tree.attr.label = ROOT_P_TEXT;
+            tree.attr.label = parser.kfEditor.getLang('rootText') || ROOT_P_TEXT;
         }
 
         for ( var i = 0, len= tree.operand.length; i < len; i++ ) {

+ 1 - 1
TEAMModelOS/ClientApp/public/kityformula/src/sysconf.js

@@ -12,7 +12,7 @@ define( function () {
         // 根占位符内容与颜色
         rootPlaceholder: {
             color: "#666",
-            content: "在此处键入公式",
+            content: "在此处键入公式", // i18n
             fontsize: 16
         },
 

+ 5 - 179
TEAMModelOS/ClientApp/public/kityformula/src/ui/other-position.data.js

@@ -1,9 +1,7 @@
 /**
  * 特殊字符区域之外的icon位置和大小数据
- * sprite这个键值对的用法,参考toolbar-ele-list.js的相关注释
  */
 
-
 define( function () {
 
     return {
@@ -17,11 +15,10 @@ define( function () {
                 "height": 73
             }
         },
-        "{^{\\placeholder}/_{\\placeholder}}": {
-            "sprite": "all",
+        "{\\placeholder/\\placeholder}": {
             "pos": {
-                "x": 89,
-                "y": 9
+                "x": 315,
+                "y": 0
             },
             "size": {
                 "width": 56,
@@ -78,17 +75,6 @@ define( function () {
                 "height": 75
             }
         },
-        "\\frac{\\partial y}{\\partial x}": {
-            "sprite": "all",
-            "pos": {
-                "x": 166,
-                "y": 106
-            },
-            "size": {
-                "width": 56,
-                "height": 75
-            }
-        },
         "\\frac {\\delta y}{\\delta x}": {
             "pos": {
                 "x": 1189,
@@ -458,167 +444,7 @@ define( function () {
                 "width": 137,
                 "height": 75
             }
-        },
-        // 傅立叶级数
-        "f(x) = a_0 + \\sum_{n=1}^\\infty\\left(a_n\\cos \\frac{n \\pi x}{L}+b_n\\sin \\frac{n \\pi x}{L} \\right)": {
-            "sprite": "preset",
-            "pos": {
-                "x": 0,
-                "y": 124
-            },
-            "size": {
-                "width": 310,
-                "height": 73
-            }
-        },
-        // 和的展开式
-        "({1+x})^2 = 1 + \\frac{nx}{1!} + \\frac{n(n-1)x^2}{2!}+\\cdots": {
-            "sprite": "preset",
-            "pos": {
-                "x": 0,
-                "y": 290
-            },
-            "size": {
-                "width": 310,
-                "height": 73
-            }
-        },
-        // 三角恒等式1
-        "\\sin\\alpha \\pm \\sin \\beta = 2\\sin \\frac{1}{2}(\\alpha \\pm \\beta)\\cos\\frac{1}{2}(\\alpha \\mp \\beta)": {
-            "sprite": "preset",
-            "pos": {
-                "x": 0,
-                "y": 374
-            },
-            "size": {
-                "width": 310,
-                "height": 73
-            }
-        },
-        // 三角恒等式2
-        "\\cos\\alpha + \\cos \\beta = 2\\cos \\frac{1}{2}(\\alpha + \\beta)\\cos\\frac{1}{2}(\\alpha - \\beta)": {
-            "sprite": "preset",
-            "pos": {
-                "x": 0,
-                "y": 460
-            },
-            "size": {
-                "width": 310,
-                "height": 73
-            }
-        },
-        // 泰勒展开式
-        "e^x = 1+\\frac{x}{1!} + \\frac{x^2}{2!} + \\frac{x^3}{3!} + \\cdots, -\\infty < x < \\infty": {
-            "sprite": "preset",
-            "pos": {
-                "x": 0,
-                "y": 548
-            },
-            "size": {
-                "width": 310,
-                "height": 73
-            }
-        },
-        // 圆的面积
-        "A = \\pi r^2": {
-            "sprite": "preset",
-            "pos": {
-                "x": 0,
-                "y": 634
-            },
-            "size": {
-                "width": 310,
-                "height": 73
-            }
-        },
-        // 极限和对数
-        "\\log_{\\placeholder}\\placeholder": {
-            "sprite": "all",
-            "pos": {
-                "x": 8,
-                "y": 2314
-            },
-            "size": {
-                "width": 56,
-                "height": 75
-            }
-        },
-        "\\log\\placeholder": {
-            "sprite": "all",
-            "pos": {
-                "x": 88 ,
-                "y": 2314
-            },
-            "size": {
-                "width": 56,
-                "height": 75
-            }
-        },
-        "\\lim_{\\placeholder}\\placeholder": {
-            "sprite": "all",
-            "pos": {
-                "x": 168,
-                "y": 2314
-            },
-            "size": {
-                "width": 56,
-                "height": 75
-            }
-        },
-        "\\min_{\\placeholder}\\placeholder": {
-            "sprite": "all",
-            "pos": {
-                "x": 248,
-                "y": 2314
-            },
-            "size": {
-                "width": 56,
-                "height": 75
-            }
-        },
-        "\\max_{\\placeholder}\\placeholder": {
-            "sprite": "all",
-            "pos": {
-                "x": 328,
-                "y": 2314
-            },
-            "size": {
-                "width": 56,
-                "height": 75
-            }
-        },
-        "\\ln\\placeholder": {
-            "sprite": "all",
-            "pos": {
-                "x": 408,
-                "y": 2314
-            },
-            "size": {
-                "width": 56,
-                "height": 75
-            }
-        },
-        "\\lim_{n\\rightarrow \\infty} \\left ( {1+ \\frac{1}{n}} \\right )^{n}": {
-            "sprite": "all",
-            "pos": {
-                "x": 8,
-                "y": 2408
-            },
-            "size": {
-                "width": 103,
-                "height": 75
-            }
-        },
-        "\\max_{0 \\le x \\le 1}xe^{-x^2}": {
-            "sprite": "all",
-            "pos": {
-                "x": 134,
-                "y": 2408
-            },
-            "size": {
-                "width": 88,
-                "height": 75
-            }
-        },
+        }
     };
+
 } );

Разлика између датотеке није приказан због своје велике величине
+ 604 - 710
TEAMModelOS/ClientApp/public/kityformula/src/ui/toolbar-ele-list.js


+ 1 - 1
TEAMModelOS/ClientApp/public/kityformula/src/ui/toolbar/toolbar.js

@@ -20,7 +20,7 @@ define( function ( require ) {
                 this.uiComponent = uiComponent;
 
                 // 工具栏元素定义列表
-                this.elementList = elementList;
+                this.elementList = elementList(kfEditor);
 
                 this.elements = [];
 

+ 4 - 10
TEAMModelOS/ClientApp/public/kityformula/src/ui/ui-impl/box.js

@@ -243,7 +243,7 @@ define( function ( require ) {
                         fixOffset: this.options.fixOffset
                     } ),
                     overlapListObject = createOverlapList( this.doc, {
-                        width: 150,
+                        width: 220,
                         items: classifyList
                     } ),
                     wrapNode = $$.ele( this.doc, "div", {
@@ -593,14 +593,8 @@ define( function ( require ) {
         // background
         var style = 'background: url( '+ data.img +' ) no-repeat ';
 
-        try {
-            style += -data.pos.x + 'px ';
-            style += -data.pos.y + 'px;';
-        }
-        catch (err) {
-           console.log(data);
-           console.log(err);
-        }
+        style += -data.pos.x + 'px ';
+        style += -data.pos.y + 'px;';
 
         // width height
         style += ' width: ' + data.size.width + 'px;';
@@ -612,4 +606,4 @@ define( function ( require ) {
 
     return Box;
 
-} );
+} );

+ 15 - 2
TEAMModelOS/ClientApp/src/common/BaseClassSelect.vue

@@ -19,7 +19,7 @@
 		},
 		data() {
 			return {
-				defaultArr:['hbcn0906'],
+				defaultArr:[],
 				props: {
 					multiple: true,
 					value: 'id',
@@ -78,6 +78,7 @@
 				return data
 			},
 			treeChange(data) {
+				console.log(data);
 				let classIds = data.map(i => i[i.length - 1])
 				this.$emit('onChange', classIds)
 			}
@@ -87,7 +88,6 @@
 		},
 		computed: {
 			csOptions() {
-				console.log(this.scope)
 				if (this.$store.state.user.schoolProfile) {
 					let periodList = this.$store.state.user.schoolProfile.school_base.period.map(i => {
 						return {
@@ -101,6 +101,19 @@
 					return []
 				}
 			},
+		},
+		watch:{
+			classes:{
+				handler(n,o){
+					if(n.length){
+						let curYear = new Date().getFullYear()
+						this.defaultArr = n.map(i => [i.periodId,'class',curYear - i.year - 1,i.id])
+						console.log(this.defaultArr);
+					}
+				},
+				immediate:true,
+				deep:true
+			}
 		}
 	};
 </script>

+ 1 - 1
TEAMModelOS/ClientApp/src/components/vote/BaseVoteForm.vue

@@ -18,7 +18,7 @@
 					<Option v-for="(item,index) in classRooms.filter(i=>i.scope === classType)" :value="item.id" :key="index">{{ item.name }}</Option>
 				</Select> -->
 				<div v-else>
-					<BaseClassSelect :classes="voteForm.classes" @onChange="onTargetChange" v-if="getCurScope === 'school'"></BaseClassSelect>
+					<BaseClassSelect :classes="classNameArr" @onChange="onTargetChange" v-if="getCurScope === 'school'"></BaseClassSelect>
 					<BaseClassSelectPri @onChange="onTargetChange" v-else></BaseClassSelectPri>
 				</div>
 				

+ 5 - 4
TEAMModelOS/ClientApp/src/view/answersheet/index.vue

@@ -327,13 +327,14 @@
 				return new Promise((r,j) => {
 					let paperInfo = this.$store.state.answerSheet.paperItem
 					let configParams = this.$store.state.answerSheet.config
-					console.log(paperInfo);
+					let curCode = paperInfo.examCode || paperInfo.code
+					let curScope = paperInfo.examScope || paperInfo.scope
 					if(paperInfo.sheet){
 						configParams.id = paperInfo.sheet
 					}
-					configParams.code = paperInfo.examCode ? paperInfo.examCode.replace('Exam-','') : paperInfo.code.replace('Paper-','')
-					configParams.school = paperInfo.examScope === 'school' ? this.$store.state.userInfo.schoolCode : ''
-					configParams.scope = paperInfo.examScope || paperInfo.scope
+					configParams.code = curCode.replace('Paper-','')
+					configParams.school = curScope === 'school' ? this.$store.state.userInfo.schoolCode : ''
+					configParams.scope = curScope
 					configParams.creatorId =  this.$store.state.userInfo.TEAMModelId
 					this.$api.evaluation.upsertSheet(configParams).then(res => {
 						if(!res.error){

+ 6 - 5
TEAMModelOS/ClientApp/src/view/learnactivity/AutoCreateNew.vue

@@ -299,7 +299,7 @@
 			async onCondChange(){
 				if(!this.isSchoolPaper) return
 				this.itemConds = this.itemConds.length ? this.itemConds : await this.getFilterCount()
-				if(this.itemConds.length){
+				if(this.itemConds.length && this.periodCode){
 					console.log(this.periodCode)
 					let types = this.quInfos.map(i => i.type)
 					let curSubjectCond = this.itemConds.find(i => i.id === this.periodCode).subjects.find(j => j.id === this.subjectCode)
@@ -359,18 +359,19 @@
 				handler(n){
 					if(n && this.periodList.length){
 						this.periodCode = n
-						this.subjectList = this.periodList.filter(i => i.id === n)[0].subjects
+						this.subjectList = this.periodList.filter(i => i.id === n)[0].subjects3
 						this.onCondChange()
 					}
-					
-				}
+				},
+				immediate:true
 			},
 			subject:{
 				handler(n){
 					console.log('自动组题科目',n)
 					this.subjectCode = n
 					this.onCondChange()
-				}
+				},
+				immediate:true
 			}
 		}
 	}