jquery.lang.helper-api

本文介绍了一个轻量级的JavaScript MVCHelper库,包括其核心功能如对象比较、属性观察、字符串操作等,旨在简化JavaScript应用的开发流程。

Language Helpers  page     

Source

JavaScriptMVC has several lightweight language helper plugins.

Object

Methods useful for comparing Objects. For example, if two objects are thesame:

$.Object.same({foo: "bar"}, {foo: "bar"});

Observe

Makes an Object's properties observable:

var person = new $.Observe({ name: "Justin" })

person.bind('change', function(){ ... })

person.attr('name', "Brian");

String

String helpers capitalize, underscore, and perform similar manipulationson strings. They can also lookup a value in an object:

$.String.getObject("foo.bar",{foo: {bar: "car"}})

toJSON

Used to create or consume JSON strings.

Vector

Used for vector math.

jQuery.Object  class     

Source

Object contains several helper methods that help compare objects.

same

Returns true if two objects are similar.

$.Object.same({foo: "bar"} , {bar: "foo"}) //-> false

subset

Returns true if an object is a set of another set.

$.Object.subset({}, {foo: "bar"} ) //-> true

subsets

Returns the subsets of an object

$.Object.subsets({userId: 20},

                 [

                  {userId: 20, limit: 30},

                  {userId: 5},

                  {}

                 ])

         //->    [{userId: 20, limit: 30}]

jQuery.Object.same  function     

Source

Returns if two objects are the same. It takes an optional compares objectthat can be used to make comparisons.

This function does not work with objects that create circular references.

Examples

$.Object.same({name: "Justin"},

              {name: "JUSTIN"}) //-> false

 

// ignore the name property

$.Object.same({name: "Brian"},

              {name: "JUSTIN"},

              {name: null})      //->true

 

// ignore case

$.Object.same({name: "Justin"},

              {name: "JUSTIN"},

              {name: "i"})      //->true

 

// deep rule

$.Object.same({ person : { name: "Justin" } },

              { person : { name: "JUSTIN" } },

              { person : { name: "i"      } }) //-> true

 

// supplied compare function

$.Object.same({age: "Thirty"},

              {age: 30},

              {age: function( a, b ){

                      if( a == "Thirty" ) {

                        a = 30

                      }

                      if( b == "Thirty" ) {

                        b = 30

                      }

                      return a === b;

                    }})      //->true

API

$.Object.same(a, b, compares,aParent, bParent, deep) -> undefined

a {Object}

an object to compare

b {Object}

an object to compare

compares {optional:Object}

an object that indicates how to compare specific properties. Typicallythis is a name / value pair

$.Object.same({name: "Justin"},{name: "JUSTIN"},{name: "i"})

There are two compare functions that you can specify with a string:

  • 'i' - ignores case
  • null - ignores this property

aParent {}

bParent {}

deep {optional:Object}

used internally

returns {undefined}

jQuery.Object.subset  function     

Source

Compares if checkSet is a subset of set

API

$.Object.subset(subset, set,compares, checkSet, checkPropCount) -> undefined

subset {}

set {Object}

compares {optional:Object}

checkSet {Object}

checkPropCount {optional:Object}

returns {undefined}

jQuery.Object.subsets  function     

Source

Returns the sets in 'sets' that are a subset of checkSet

API

$.Object.subsets(checkSet, sets,compares) -> undefined

checkSet {Object}

sets {Object}

compares {}

returns {undefined}

jQuery.Observe  class     

test: qunit.html

Source

Observe provides the awesome observable pattern for JavaScript Objects andArrays. It lets you

  • Set and remove property or property values on objects and arrays
  • Listen for changes in objects and arrays
  • Work with nested properties

Creating an $.Observe

To create an $.Observe, or $.Observe.List, you can simply use the $.O(data) shortcut like:

var person = $.O({name: 'justin', age: 29}),

    hobbies = $.O(['programming', 'basketball', 'nose picking'])

Depending on the type of data passed to $.O, it will create an instance ofeither:

  • $.Observe, which is used for objects like: {foo: 'bar'}, and
  • $.Observe.List, which is used for arrays like ['foo','bar']

$.Observe.List and $.Observe are very similar. In fact, $.Observe.Listinherits $.Observe and only adds a few extra methods for manipulating arrayslike push.Go to $.Observe.Listfor more information about $.Observe.List.

You can also create a new $.Observe simply by pass it the datayou want to observe:

var data = {

 addresses : [

    {

      city: 'Chicago',

      state: 'IL'

    },

    {

      city: 'Boston',

      state : 'MA'

    }

    ],

 name : "Justin Meyer"

},

o = new$.Observe(data);

o now represents an observablecopy of data.

Getting and Setting Properties

Use attrand attrsto get and set properties.

For example, you can read the property values of o with observe.attr( name ) like:

// read name

o.attr('name') //-> Justin Meyer

And set property names of o with observe.attr( name, value ) like:

// update name

o.attr('name', "Brian Moschel") //-> o

Observe handles nested data. Nested Objects and Arrays are converted to$.Observe and $.Observe.Lists. This lets you read nested properties and use$.Observe methods on them. The following updates the second address (Boston) to'New York':

o.attr('addresses.1').attrs({

 city: 'New York',

 state: 'NY'

})

attrs() can be used toget all properties back from the observe:

o.attrs() // ->

{

 addresses : [

    {

      city: 'Chicago',

      state: 'IL'

    },

    {

      city: 'New York',

      state : 'MA'

    }

 ],

 name : "Brian Moschel"

}

Listening to property changes

When a property value is changed, it creates events that you can listento. There are two ways to listen for events:

  • bind - listen for any type of change
  • delegate - listen to a specific type of change

With bind("change" , handler( ev, attr, how, newVal, oldVal ) ), you can listen to any change that happens within theobserve. The handler gets called with the property name that was changed, howit was changed ['add','remove','set'], the new value and the old value.

o.bind('change', function( ev, attr, how, nevVal, oldVal ) {

 

})

delegate( attr, event, handler(ev, newVal, oldVal ) ) lets you listen to a specific event on a specificattribute.

// listen for name changes

o.delegate("name","set", function(){

 

})

Delegate lets you specify multiple attributes and values to match for thecallback. For example,

r = $.O({type: "video", id : 5})

r.delegate("type=images id","set", function(){})

This is used heavily by $.route.

API

$.Observe(obj) ->jquery.observe

obj {Object}

a JavaScript Object that will be converted to an observable

returns {jquery.observe}

jQuery.Observe.List  class     

inherits: jQuery.Observe

Source

An observable list. You can listen to when items are push, popped,spliced, shifted, and unshifted on this array.

jQuery.Observe.List.prototype.attrs  function    

Source

Updates an array with a new array. It is able to handle removes in themiddle of the array.

API

observe.list.attrs(props, remove)-> undefined

props {Array}

remove {Boolean}

returns {undefined}

jQuery.Observe.List.prototype.indexOf  function    

Source

Returns the position of the item in the array. Returns -1 if the item isnot in the array.

API

observe.list.indexOf(item) ->Number

item {Object}

returns {Number}

jQuery.Observe.List.prototype.pop  function    

Source

Removes an item from the end of the list.

var l = new $.Observe.List([0,1,2]);

 

l.bind('change', function(

    ev,        // the change event

    attr,      // the attr that was changed, formultiple items, "*" is used

    how,       // "remove"

    newVals,   // undefined

    oldVals,   // 2

    where      // the location where these items whereadded

    ) {

 

})

 

l.pop();

API

observe.list.pop() -> Object

returns {Object}

the element at the end of the list

jQuery.Observe.List.prototype.push  function    

Source

Add items to the end of the list.

var l = new $.Observe.List([]);

 

l.bind('change', function(

    ev,        // the change event

    attr,      // the attr that was changed, formultiple items, "*" is used

    how,       // "add"

    newVals,   // an array of new values pushed

    oldVals,   // undefined

    where      // the location where these items whereadded

    ) {

 

})

 

l.push('0','1','2');

API

observe.list.push() -> Number

returns {Number}

the number of items in the array

jQuery.Observe.List.prototype.serialize  function    

Source

Returns the serialized form of this list.

API

observe.list.serialize() ->undefined

returns {undefined}

jQuery.Observe.List.prototype.shift  function    

Source

Removes an item from the start of the list. This is very similar to[jQuery.Observe.prototype.pop].

API

observe.list.shift() -> Object

returns {Object}

the element at the start of the list

jQuery.Observe.List.prototype.splice  function     

Source

Remove items or add items from a specific point in thelist.

Example

The following creates a list of numbers and replaces 2 and3 with "a", and "b".

var l = new $.Observe.List([0,1,2,3]);
 
l.bind('change', function( ev, attr, how, newVals, oldVals, where ) { ... })
 
l.splice(1,2, "a", "b"); // results in [0,"a","b",3]

This creates 2 change events. The first event is theremoval of numbers one and two where it's callback values will be:

  • attr - "1" - indicates where the remove event took place
  • how - "remove"
  • newVals - undefined
  • oldVals - [1,2] -the array of removed values
  • where - 1 - the location of where these items where removed

The second change event is the addition of the"a", and "b" values where the callback values will be:

  • attr - "1" - indicates where the add event took place
  • how - "added"
  • newVals - ["a","b"]
  • oldVals - [1, 2] - the array of removed values
  • where - 1 - the location of where these items where added

API

observe.list.splice(index, count, added) -> undefined

 {Number}

where to start removing or adding items

 {Object}

the number of items to remove

 {optional:Object}

an object to add to

 {undefined}

jQuery.Observe.List.prototype.unshift  function    

Source

Add items to the start of the list. This is very similar to[jQuery.Observe.prototype.push].

API

observe.list.unshift()

jQuery.Observe.prototype.attr  function     

Source

Get or set an attribute on the observe.

o = new$.Observe({});

 

// sets a user property

o.attr('user',{name: 'hank'});

 

// read the user's name

o.attr('user.name') //-> 'hank'

If a value is set for the first time, it will trigger an 'add' and 'set' change event. Once the value has been added. Any futurevalue changes will trigger only 'set' events.

API

observe.attr(attr, val) ->Object

attr {String}

the attribute to read or write.

o.attr('name') //-> reads the name

o.attr('name', 'Justin') //-> writes the name

You can read or write deep property names. For example:

o.attr('person', {name: 'Justin'})

o.attr('person.name') //-> 'Justin'

val {optional:Object}

if provided, sets the value.

returns {Object}

the observable or the attribute property.

If you are reading, the property value is returned:

o.attr('name') //-> Justin

If you are writing, the observe is returned for chaining:

o.attr('name',"Brian").attr('name') //-> Justin

jQuery.Observe.prototype.attrs  function     

Source

Set multiple properties on the observable

API

observe.attrs(props, remove)-> undefined

props {Object}

remove {Boolean}

true if you should remove properties that are not in props

returns {undefined}

jQuery.Observe.prototype.bind  function     

Source

Listens to changes on a jQuery.Observe.

When attributes of an observe change, including attributes on nestedobjects, a 'change' event is triggered on the observe. These events come inthree flavors:

  • add - a attribute is added
  • set - an existing attribute's value is changed
  • remove - an attribute is removed

The change event is fired with:

  • the attribute changed
  • how it was changed
  • the newValue of the attribute
  • the oldValue of the attribute

Example:

o = new$.Observe({name : "Payal"});

o.bind('change', function(ev, attr, how, newVal, oldVal){

 // ev    -> {type: 'change'}

 // attr  -> "name"

 // how   -> "add"

 // newVal-> "Justin"

 // oldVal-> undefined

})

 

o.attr('name', 'Justin')

Listening to change is only useful for when you want to know every change onan Observe. For most applications, delegateis much more useful as it lets you listen to specific attribute changes andsepecific types of changes.

API

observe.bind(eventType,handler(event, attr, how, newVal, oldVal)) -> undefined

eventType {String}

the event name. Currently, only 'change' events are supported. For morefine grained control, use jQuery.Observe.prototype.delegate.

handler(event, attr, how, newVal, oldVal) {Function}

A callback function where

  • event - the event
  • attr - the name of the attribute changed
  • how - how the attribute was changed (add, set, remove)
  • newVal - the new value of the attribute
  • oldVal - the old value of the attribute

·        jQuery.Observe.prototype.delegate function     

·        plugin:jquery/lang/observe/delegate

·        Source

·        Listen for changesin a child attribute from the parent. The child attribute does not have toexist.

·        // create anobservable

·        var observe = $.O({

·          foo : {

·            bar : "Hello World"

·          }

·        })

·         

·        //listen tochanges on a property

·        observe.delegate("foo.bar","change", function(ev, prop, how, newVal,oldVal){

·          // foo.bar has been added, set, or removed

·          this //->

·        });

·         

·        // change theproperty

·        observe.attr('foo.bar',"Goodbye Cruel World")

·        Types of events

·        Delegate lets youlisten to add, set, remove, and change events on property.

·        add

·        An add event isfired when a new property has been added.

·        var o = new$.Observe({});

·        o.delegate("name","add", function(ev, value){

·          // called once

·          $('#name').show()

·        })

·        o.attr('name',"Justin")

·        o.attr('name',"Brian");

·        Listening to addevents is useful for 'setup' functionality (in this case showing the #name element.

·        set

·        Set events are firedwhen a property takes on a new value. set events are always fired after an add.

·        o.delegate("name","set", function(ev, value){

·          // called twice

·          $('#name').text(value)

·        })

·        o.attr('name',"Justin")

·        o.attr('name',"Brian");

·        remove

·        Remove events arefired after a property is removed.

·        o.delegate("name","remove", function(ev){

·          // called once

·          $('#name').text(value)

·        })

·        o.attr('name',"Justin");

·        o.removeAttr('name');

·        Wildcards -matching multiple properties

·        Sometimes, youwant to know when any property within some part of an observe has changed.Delegate lets you use wildcards to match any property name. The followinglistens for any change on an attribute of the params attribute:

·        var o = $.Observe({

·          options : {

·            limit : 100,

·            offset: 0,

·            params : {

·              parentId: 5

·            }

·          }

·        })

·        o.delegate('options.*','change', function(){

·          alert('1');

·        })

·        o.delegate('options.**','change', function(){

·          alert('2');

·        })

·         

·        // alerts 1

·        // alerts 2

·        o.attr('options.offset',100)

·         

·        // alerts 2

·        o.attr('options.params.parentId',6);

·        Using a singlewildcard () matches single level properties. Using a double wildcard (*) matches any deep property.

·        Listening onmultiple properties and values

·        Delegate lets youlisten on multiple values at once, for example,

·        API

·        observe.delegate(selector, event, cb) -> jQuery.Delegate

·        selector {String}

·        the attributes youwant to listen for changes in.

·        event {String}

·        the event name

·        cb {Function}

·        the callbackhandler

·        returns {jQuery.Delegate}

·        the delegate forchaining

·        jQuery.Observe.prototype.each function     

·        Source

·        Iterates througheach attribute, calling handler with each attribute name and value.

·        new Observe({foo: 'bar'})

·          .each(function(name, value){

·            equals(name, 'foo')

·            equals(value,'bar')

·          })

·        API

·        observe.each(handler(attrName,value)) -> jQuery.Observe

·        handler(attrName,value){function}

·        A function thatwill get called back with the name and value of each attribute on the observe.

·        Returning false breaks the looping. The following will never log 3:

·        new Observe({a : 1, b : 2, c: 3})

·          .each(function(name, value){

·            console.log(value)

·            if(name == 2){

·              return false;

·            }

·          })

·        returns {jQuery.Observe}

·        the originalobservable.

·        jQuery.Observe.prototype.removeAttr function     

·        Source

·        Removes a property

·        o =  new$.Observe({foo: 'bar'});

·        o.removeAttr('foo'); //-> 'bar'

·        This creates a 'remove' change event. Learn more about events in bindand delegate.

·        API

·        observe.removeAttr(attr) -> Object

·        attr {String}

·        the attribute nameto remove.

·        returns {Object}

·        the value that wasremoved.

·        jQuery.Observe.prototype.serialize function     

·        Source

·        Get the serializedObject form of the observe. Serialized data is typically used to send back to aserver.

·        o.serialize() //-> { name: 'Justin' }

·        Serializecurrently returns the same data as jQuery.Observe.prototype.attrs.However, in future versions, serialize will be able to return serialized datasimilar to jQuery.Model.The following will work:

·        new Observe({time: new Date()})

·          .serialize() //-> { time: 1319666613663 }

·        API

·        observe.serialize() -> Object

·        returns {Object}

·        a JavaScriptObject that can be serialized with JSON.stringify or othermethods.

jQuery.Observe.prototype.unbind  function     

Source

Unbinds a listener. This uses jQuery.unbindand works very similar. This means you can use namespaces or unbind all eventhandlers for a given event:

// unbind a specific event handler

o.unbind('change', handler)

 

// unbind all change event handlers bound with the

// foo namespace

o.unbind('change.foo')

 

// unbind all change event handlers

o.unbind('change')

API

observe.unbind(eventType,handler) -> jQuery.Observe

eventType {String}

  • the type of event with any optional namespaces. Currently, only change events are supported with bind.

handler {optional:Function}

  • The original handler function passed to bind.

returns {jQuery.Observe}

the original observe for chaining.

jQuery.Observe.prototype.undelegate  function    

plugin: jquery/lang/observe/delegate

Source

Removes a delegate event handler.

observe.undelegate("name","set", function(){ ... })

API

observe.undelegate(selector,event, cb) -> jQuery.Delegate

selector {String}

the attribute name of the object you want to undelegate from.

event {String}

the event name

cb {Function}

the callback handler

returns {jQuery.Delegate}

the delegate for chaining

jQuery.String  class     

Source

A collection of useful string helpers. Available helpers are:

  • capitalize: Capitalizes a string (some_string » Some_string)
  • camelize: Capitalizes a string from something undercored (some_string » someString, some-string » someString)
  • classize: Like camelize, but the first part is also capitalized (some_string » SomeString)
  • niceName: Like classize, but a space separates each 'word' (some_string » Some String)
  • underscore: Underscores a string (SomeString » some_string)
  • sub: Returns a string with {param} replaced values from data.

·              $.String.sub("foo {bar}",{bar:"far"})

      //-> "foofar"

jQuery.String.camelize  function     

Source

Capitalizes a string from something undercored. Examples:

jQuery.String.camelize("one_two") //-> "oneTwo"

"three-four".camelize() //->threeFour

API

$.String.camelize(s) -> String

s {String}

returns {String}

a the camelized string

jQuery.String.capitalize  function     

Source

Capitalizes a string

API

$.String.capitalize(s, cache)-> String

s {String}

the string.

cache {}

returns {String}

a string with the first character capitalized.

© Bitovi - JavaScriptMVCTraining and Support

jQuery.String.classize  function     

Source

Like camelize,but the first part is also capitalized

API

$.String.classize(s, join) ->String

s {String}

join {}

returns {String}

the classized string

jQuery.String.deparam  function     

Source

Takes a string of name value pairs and returns a Object literal thatrepresents those params.

API

$.String.deparam(params) ->Object

params {String}

a string like "foo=bar&person[age]=3"

returns {Object}

A JavaScript Object that represents the params:

{

 foo: "bar",

 person: {

    age: "3"

 }

}

jQuery.String.getObject  function     

Source

Gets an object from a string. It can also modify objects on the 'objectpath' by removing or adding properties.

Foo = {Bar: {Zar: {"Ted"}}}

$.String.getObject("Foo.Bar.Zar") //->"Ted"

API

$.String.getObject(name, roots,add) -> Object

name {String}

the name of the object to look for

roots {optional:Array}

an array of root objects to look for the name. If roots is not provided,the window is used.

add {optional:Boolean}

true to add missing objects to the path. false to remove found properties.undefined to not modify the root object

returns {Object}

The object.

jQuery.String.niceName  function     

Source

Like classize,but a space separates each 'word'

jQuery.String.niceName("one_two") //-> "OneTwo"

API

$.String.niceName(s) -> String

s {String}

returns {String}

the niceName

jQuery.String.rsplit  function     

Source

Splits a string with a regex correctly cross browser

$.String.rsplit("a.b.c.d", /\./) //-> ['a','b','c','d']

API

$.String.rsplit(string, regex)-> Array

string {String}

The string to split

regex {RegExp}

A regular expression

returns {Array}

An array of strings

jQuery.String.sub  function     

Source

Returns a string with {param} replaced values from data.

$.String.sub("foo {bar}",{bar: "far"})

//-> "foo far"

API

$.String.sub(s, data, remove)-> undefined

s {String}

The string to replace

data {Object}

The data to be used to look for properties. If it's an array, multipleobjects can be used.

remove {optional:Boolean}

if a match is found, remove the property from the object

returns {undefined}

jQuery.String.underscore  function     

Source

Underscores a string.

jQuery.String.underscore("OneTwo") //->"one_two"

API

$.String.underscore(s) ->String

s {String}

returns {String}

the underscored string

jQuery.toJSON  page     

Source

jQuery.toJSON( json-serializble )

Converts the given argument into a JSON respresentation.

If an object has a "toJSON" function, that will be used to getthe representation. Non-integer/string keys are skipped in the object, as arekeys that point to a function.

json-serializble: The thing to be converted.

jQuery.evalJSON  function     

Source

Evaluates a given piece of json source.

Evaluates a given piece of json source.

API

$.evalJSON(src) -> undefined

src {}

returns {undefined}

jQuery.quoteString  function     

Source

Returns a string-repr of a string, escaping quotes intelligently.
Mostly a support function for toJSON.

Examples:

 jQuery.quoteString("apple") //-> "apple"

 

 jQuery.quoteString('"Where are we going?", she asked.')

  // -> "\"Where arewe going?\", she asked."

Returns a string-repr of a string, escaping quotes intelligently.
Mostly a support function for toJSON.

Examples:

 jQuery.quoteString("apple") //-> "apple"

 

 jQuery.quoteString('"Where are we going?", she asked.')

  // -> "\"Where arewe going?\", she asked."

API

$.quoteString(string) ->undefined

string {}

returns {undefined}

jQuery.secureEvalJSON  function     

Source

Evals JSON in a way that is more secure.

Evals JSON in a way that is more secure.

API

$.secureEvalJSON(src) ->undefined

src {}

returns {undefined}

jQuery.Vector  class     

Source

A vector class

Constructor

creates a new vector instance from the arguments. Example:

new jQuery.Vector(1,2)

new $.Vector() -> jquery.vector

returns {jquery.vector}

jQuery.Vector.prototype.app  function     

Source

Applys the function to every item in the vector. Returns the new vector.

API

vector.app(f) -> jQuery.Vector

f {Function}

returns {jQuery.Vector}

new vector class.

jQuery.Vector.prototype.equals  function     

Source

Returns the current vector if it is equal to the vector passed in.
False if otherwise.

API

vector.equals() ->jQuery.Vector

returns {jQuery.Vector}

jQuery.Vector.prototype.height  attribute     

Source

Returns the 2nd value of the vector

jQuery.Vector.prototype.left  attribute     

Source

same as x()

jQuery.Vector.prototype.minus  function     

Source

Like plus but subtracts 2 vectors

API

vector.minus() -> jQuery.Vector

returns {jQuery.Vector}

jQuery.Vector.prototype.plus  function     

Source

Adds two vectors together. Example:

new Vector(1,2).plus(2,3) //-> <3,5>

new Vector(3,5).plus(new Vector(4,5)) //-><7,10>

API

vector.plus() -> undefined

jQuery.Vector.prototype.top  attribute     

Source

Same as y()

jQuery.Vector.prototype.toString  function     

Source

returns (x,y)

API

vector.toString() -> String

returns {String}

jQuery.Vector.prototype.update  function     

Source

Replaces the vectors contents

API

vector.update(array) ->undefined

array {Object}

returns {undefined}

jQuery.Vector.prototype.width  attribute     

Source

Returns the first value of the vector

jQuery.Vector.prototype.x  attribute     

Source

Returns the first value of the vector

jQuery.Vector.prototype.y  attribute     

Source

Returns the 2nd value of the vector

 

[root@yfw ~]# cd /www/wwwroot/szrengjing.com/jsxc/jsxc-master [root@yfw jsxc-master]# cd /www/wwwroot/szrengjing.com/jsxc/jsxc-master [root@yfw jsxc-master]# [root@yfw jsxc-master]# # 初始化 git 仓库 [root@yfw jsxc-master]# sudo -u www git init Initialized empty Git repository in /www/wwwroot/szrengjing.com/jsxc/jsxc-master/.git/ [root@yfw jsxc-master]# sudo -u www git add . [root@yfw jsxc-master]# sudo -u www git commit -m "Initial commit for build" *** Please tell me who you are. Run git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository. fatal: empty ident name (for <www@yfw.szrengjing.com>) not allowed [root@yfw jsxc-master]# npm list git-revision-webpack-plugin @jsxc/jsxc@4.4.0 /www/wwwroot/szrengjing.com/jsxc/jsxc-master └── git-revision-webpack-plugin@3.0.6 [root@yfw jsxc-master]# sudo -u www yarn build yarn run v1.22.22 warning ../../package.json: No license field $ webpack --progress --config webpack.config.js --mode production fatal: Not a valid object name HEAD [webpack-cli] Failed to load '/www/wwwroot/szrengjing.com/jsxc/jsxc-master/webpack.config.js' config [webpack-cli] Error: Command failed: git describe --always fatal: Not a valid object name HEAD at checkExecSyncError (child_process.js:635:11) at execSync (child_process.js:671:15) at module.exports (/www/wwwroot/szrengjing.com/jsxc/jsxc-master/node_modules/git-revision-webpack-plugin/lib/helpers/run-git-command.js:25:34) at GitRevisionPlugin.version (/www/wwwroot/szrengjing.com/jsxc/jsxc-master/node_modules/git-revision-webpack-plugin/lib/index.js:65:10) at Object.<anonymous> (/www/wwwroot/szrengjing.com/jsxc/jsxc-master/webpack.config.js:52:85) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Module.require (internal/modules/cjs/loader.js:887:19) { status: 128, signal: null, output: [ null, <Buffer >, <Buffer 66 61 74 61 6c 3a 20 4e 6f 74 20 61 20 76 61 6c 69 64 20 6f 62 6a 65 63 74 20 6e 61 6d 65 20 48 45 41 44 0a> ], pid: 647253, stdout: <Buffer >, stderr: <Buffer 66 61 74 61 6c 3a 20 4e 6f 74 20 61 20 76 61 6c 69 64 20 6f 62 6a 65 63 74 20 6e 61 6d 65 20 48 45 41 44 0a> } error Command failed with exit code 2. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. [root@yfw jsxc-master]# sudo -u www yarn build --bundleAnalyzer yarn run v1.22.22 warning ../../package.json: No license field $ webpack --progress --config webpack.config.js --mode production --bundleAnalyzer [webpack-cli] Error: Unknown option '--bundleAnalyzer' [webpack-cli] Run 'webpack --help' to see available commands and options error Command failed with exit code 2. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. [root@yfw jsxc-master]# # 为 www 用户设置 Git 身份(局部设置,仅对当前项目) [root@yfw jsxc-master]# sudo -u www git config user.name "JSXC Builder" [root@yfw jsxc-master]# sudo -u www git config user.email "builder@localhost" [root@yfw jsxc-master]# sudo -u www git commit -m "Initial commit for build" [master (root-commit) ad2386e] Initial commit for build 510 files changed, 61602 insertions(+) create mode 100755 .commitlintrc.json create mode 100755 .editorconfig create mode 100755 .eslintrc.js create mode 100755 .fantasticonrc.js create mode 100755 .github/FUNDING.yml create mode 100755 .github/ISSUE_TEMPLATE/bug_report.md create mode 100755 .github/ISSUE_TEMPLATE/feature-request.md create mode 100755 .github/workflows/commitlint.yml create mode 100755 .github/workflows/wti.yml create mode 100755 .github/workflows/yarn.yml create mode 100755 .gitignore create mode 100755 .lgtm.yml create mode 100755 .npmignore create mode 100755 .prettierrc.json create mode 100755 .stylelintrc create mode 100755 .vscode/settings.json create mode 100755 CHANGELOG.md create mode 100755 CODE_OF_CONDUCT.md create mode 100755 CONTRIBUTING.md create mode 100755 LICENSE create mode 100755 README.md create mode 100755 custom.d.ts create mode 100755 example/ajax/getturncredentials.json create mode 100755 example/css/bootstrap.min.css create mode 100755 example/css/example.css create mode 100755 example/css/images/ui-icons_444444_256x240.png create mode 100755 example/css/images/ui-icons_555555_256x240.png create mode 100755 example/css/images/ui-icons_777620_256x240.png create mode 100755 example/css/images/ui-icons_777777_256x240.png create mode 100755 example/css/images/ui-icons_cc0000_256x240.png create mode 100755 example/css/images/ui-icons_ffffff_256x240.png create mode 100755 example/favicon.ico create mode 100755 example/fonts/glyphicons-halflings-regular.eot create mode 100755 example/fonts/glyphicons-halflings-regular.svg create mode 100755 example/fonts/glyphicons-halflings-regular.ttf create mode 100755 example/fonts/glyphicons-halflings-regular.woff create mode 100755 example/fonts/glyphicons-halflings-regular.woff2 create mode 100755 example/index.html create mode 100755 example/js/example.js create mode 100755 example/js/helper.js create mode 100755 example/js/jquery.min.js create mode 100755 example/login.html create mode 100755 fonts/jsxc-icons.eot create mode 100755 fonts/jsxc-icons.scss create mode 100755 fonts/jsxc-icons.woff create mode 100755 fonts/jsxc-icons.woff2 create mode 100755 images/XMPP_logo.png create mode 100755 images/camera_disabled_icon_white.svg create mode 100755 images/download_icon_black.svg create mode 100755 images/dragover_white.svg create mode 100755 images/drop_white.svg create mode 100755 images/emoticons/jabber.svg create mode 100755 images/emoticons/jsxc.svg create mode 100755 images/emoticons/klaus.svg create mode 100755 images/emoticons/nextcloud.svg create mode 100755 images/emoticons/owncloud.svg create mode 100755 images/emoticons/xmpp.svg create mode 100755 images/filetypes/application-pdf.png create mode 100755 images/filetypes/application-pdf.svg create mode 100755 images/filetypes/application.png create mode 100755 images/filetypes/application.svg create mode 100755 images/filetypes/audio.png create mode 100755 images/filetypes/audio.svg create mode 100755 images/filetypes/file.png create mode 100755 images/filetypes/file.svg create mode 100755 images/filetypes/folder-drag-accept.png create mode 100755 images/filetypes/folder-drag-accept.svg create mode 100755 images/filetypes/folder-external.png create mode 100755 images/filetypes/folder-external.svg create mode 100755 images/filetypes/folder-public.png create mode 100755 images/filetypes/folder-public.svg create mode 100755 images/filetypes/folder-shared.png create mode 100755 images/filetypes/folder-shared.svg create mode 100755 images/filetypes/folder-starred.png create mode 100755 images/filetypes/folder-starred.svg create mode 100755 images/filetypes/folder.png create mode 100755 images/filetypes/folder.svg create mode 100755 images/filetypes/image.png create mode 100755 images/filetypes/image.svg create mode 100755 images/filetypes/package-x-generic.png create mode 100755 images/filetypes/package-x-generic.svg create mode 100755 images/filetypes/text-calendar.png create mode 100755 images/filetypes/text-calendar.svg create mode 100755 images/filetypes/text-code.png create mode 100755 images/filetypes/text-code.svg create mode 100755 images/filetypes/text-vcard.png create mode 100755 images/filetypes/text-vcard.svg create mode 100755 images/filetypes/text.png create mode 100755 images/filetypes/text.svg create mode 100755 images/filetypes/video.png create mode 100755 images/filetypes/video.svg create mode 100755 images/filetypes/x-office-document.png create mode 100755 images/filetypes/x-office-document.svg create mode 100755 images/filetypes/x-office-presentation.png create mode 100755 images/filetypes/x-office-presentation.svg create mode 100755 images/filetypes/x-office-spreadsheet.png create mode 100755 images/filetypes/x-office-spreadsheet.svg create mode 100755 images/group_white.svg create mode 100755 images/icons/attachment.svg create mode 100755 images/icons/bell.svg create mode 100755 images/icons/bookmark.svg create mode 100755 images/icons/camera-disabled.svg create mode 100755 images/icons/camera.svg create mode 100755 images/icons/channel.svg create mode 100755 images/icons/close.svg create mode 100755 images/icons/contact.svg create mode 100755 images/icons/delete.svg create mode 100755 images/icons/download.svg create mode 100755 images/icons/dragover.svg create mode 100755 images/icons/drop.svg create mode 100755 images/icons/edit.svg create mode 100755 images/icons/fullscreen.svg create mode 100755 images/icons/gear.svg create mode 100755 images/icons/group.svg create mode 100755 images/icons/groupcontact.svg create mode 100755 images/icons/hang-up.svg create mode 100755 images/icons/help.svg create mode 100755 images/icons/info.svg create mode 100755 images/icons/jsxc.svg create mode 100755 images/icons/location.svg create mode 100755 images/icons/maximize.svg create mode 100755 images/icons/megaphone.svg create mode 100755 images/icons/menu.svg create mode 100755 images/icons/microphone-disabled.svg create mode 100755 images/icons/microphone.svg create mode 100755 images/icons/minimize.svg create mode 100755 images/icons/more.svg create mode 100755 images/icons/mute.svg create mode 100755 images/icons/nonanonymous-group.svg create mode 100755 images/icons/padlock-close.svg create mode 100755 images/icons/padlock-open-disabled.svg create mode 100755 images/icons/padlock-open.svg create mode 100755 images/icons/pick-up-disabled.svg create mode 100755 images/icons/pick-up.svg create mode 100755 images/icons/placeholder.svg create mode 100755 images/icons/quotation.svg create mode 100755 images/icons/resize.svg create mode 100755 images/icons/search.svg create mode 100755 images/icons/smiley.svg create mode 100755 images/icons/speech-balloon.svg create mode 100755 images/jsxc_white.svg create mode 100755 images/loading.gif create mode 100755 images/location_icon.svg create mode 100755 images/placeholder_image.svg create mode 100755 images/presence/away.svg create mode 100755 images/presence/chat.svg create mode 100755 images/presence/dnd.svg create mode 100755 images/presence/online.svg create mode 100755 images/presence/xa.svg create mode 100755 images/resize_gray.svg create mode 100755 karma.conf.js create mode 100755 locales/ar.json create mode 100755 locales/bg.json create mode 100755 locales/bn-BD.json create mode 100755 locales/cs.json create mode 100755 locales/de.json create mode 100755 locales/el.json create mode 100755 locales/en.json create mode 100755 locales/es.json create mode 100755 locales/fa-AF.json create mode 100755 locales/fi.json create mode 100755 locales/fr.json create mode 100755 locales/hu-HU.json create mode 100755 locales/it.json create mode 100755 locales/ja.json create mode 100755 locales/ko.json create mode 100755 locales/nds.json create mode 100755 locales/nl-NL.json create mode 100755 locales/pl.json create mode 100755 locales/pt-BR.json create mode 100755 locales/ro.json create mode 100755 locales/ru.json create mode 100755 locales/sk.json create mode 100755 locales/sq.json create mode 100755 locales/sv-SE.json create mode 100755 locales/th.json create mode 100755 locales/tr-TR.json create mode 100755 locales/uk-UA.json create mode 100755 locales/vi-VN.json create mode 100755 locales/zh-TW.json create mode 100755 locales/zh.json create mode 100755 package.json create mode 100755 scripts/build-release.js create mode 100755 scripts/prepare-commit-msg.js create mode 100755 scripts/publish-release.js create mode 100755 scss/main.scss create mode 100755 scss/modules/_all.scss create mode 100755 scss/modules/_animation.scss create mode 100755 scss/modules/_colors.scss create mode 100755 scss/modules/_muc.scss create mode 100755 scss/modules/_presence.scss create mode 100755 scss/modules/_scrollbar.scss create mode 100755 scss/modules/_webrtc.scss create mode 100755 scss/partials/_avatar.scss create mode 100755 scss/partials/_bar.scss create mode 100755 scss/partials/_button.scss create mode 100755 scss/partials/_dialog.scss create mode 100755 scss/partials/_emoticons.scss create mode 100755 scss/partials/_icon.scss create mode 100755 scss/partials/_jsxc.scss create mode 100755 scss/partials/_layout.scss create mode 100755 scss/partials/_menu.scss create mode 100755 scss/partials/_muc.scss create mode 100755 scss/partials/_roster.scss create mode 100755 scss/partials/_webrtc.scss create mode 100755 scss/partials/_window-list.scss create mode 100755 scss/partials/_window.scss create mode 100755 scss/vendor/_all.scss create mode 100755 sound/credential create mode 100755 sound/incoming-call.mp3 create mode 100755 sound/notification.mp3 create mode 100755 sound/ping.mp3 create mode 100755 src/Account.ts create mode 100755 src/AccountManager.ts create mode 100755 src/Attachment.ts create mode 100755 src/Avatar.interface.ts create mode 100755 src/Avatar.ts create mode 100755 src/CONST.ts create mode 100755 src/Call.ts create mode 100755 src/CallManager.ts create mode 100755 src/ChatWindowController.ts create mode 100755 src/Client.interface.ts create mode 100755 src/Client.ts create mode 100755 src/ClientAvatar.ts create mode 100755 src/CommandRepository.ts create mode 100755 src/Contact.interface.ts create mode 100755 src/Contact.ts create mode 100755 src/ContactManager.ts create mode 100755 src/ContactProvider.ts create mode 100755 src/DiscoInfo.interface.ts create mode 100755 src/DiscoInfo.ts create mode 100755 src/DiscoInfoChangeable.ts create mode 100755 src/DiscoInfoRepository.interface.ts create mode 100755 src/DiscoInfoRepository.ts create mode 100755 src/DiscoInfoVersion.ts create mode 100755 src/Emoticons.ts create mode 100755 src/FallbackContactProvider.ts create mode 100755 src/FormWatcher.ts create mode 100755 src/IceServers.ts create mode 100755 src/Identifiable.interface.ts create mode 100755 src/JID.interface.ts create mode 100755 src/JID.ts create mode 100755 src/JingleAbstractSession.ts create mode 100755 src/JingleCallFactory.ts create mode 100755 src/JingleCallSession.ts create mode 100755 src/JingleMediaSession.ts create mode 100755 src/JingleSessionFactory.ts create mode 100755 src/JingleStreamSession.ts create mode 100755 src/LinkHandler.interface.ts create mode 100755 src/LinkHandlerGeo.ts create mode 100755 src/LinkHandlerXMPP.ts create mode 100755 src/Menu.ts create mode 100755 src/MenuChatMessage.ts create mode 100755 src/MenuItemFactory.interface.ts create mode 100755 src/MenuItemStaticFactory.ts create mode 100755 src/Message.interface.ts create mode 100755 src/Message.ts create mode 100755 src/Migration.ts create mode 100755 src/MultiUserContact.ts create mode 100755 src/Notice.ts create mode 100755 src/NoticeManager.ts create mode 100755 src/Notification.ts create mode 100755 src/Options.ts create mode 100755 src/OptionsDefault.ts create mode 100755 src/PageVisibility.ts create mode 100755 src/PresenceController.ts create mode 100755 src/RoleAllocator.ts create mode 100755 src/RosterContactProvider.ts create mode 100755 src/StateMachine.ts create mode 100755 src/StorableAbstract.ts create mode 100755 src/Storage.interface.ts create mode 100755 src/Storage.ts create mode 100755 src/Transcript.ts create mode 100755 src/UserMedia.ts create mode 100755 src/api/index.ts create mode 100755 src/api/v1/Account.ts create mode 100755 src/api/v1/debug.ts create mode 100755 src/api/v1/disconnect.ts create mode 100755 src/api/v1/index.ts create mode 100755 src/api/v1/register.ts create mode 100755 src/api/v1/start.ts create mode 100755 src/api/v1/testBOSHServer.ts create mode 100755 src/bootstrap/plugins.ts create mode 100755 src/bootstrap/webpackPublicPath.ts create mode 100755 src/connection/AbstractConnection.ts create mode 100755 src/connection/Connection.interface.ts create mode 100755 src/connection/Form.ts create mode 100755 src/connection/FormField.ts create mode 100755 src/connection/FormItemField.ts create mode 100755 src/connection/FormReportedField.ts create mode 100755 src/connection/JingleHandler.ts create mode 100755 src/connection/services/AbstractService.ts create mode 100755 src/connection/services/Disco.ts create mode 100755 src/connection/services/MUC.ts create mode 100755 src/connection/services/PEP.ts create mode 100755 src/connection/services/PubSub.ts create mode 100755 src/connection/services/Roster.ts create mode 100755 src/connection/services/Search.ts create mode 100755 src/connection/services/Vcard.ts create mode 100755 src/connection/storage/Connection.ts create mode 100755 src/connection/xmpp/AbstractHandler.ts create mode 100755 src/connection/xmpp/ConnectHelper.ts create mode 100755 src/connection/xmpp/Connection.ts create mode 100755 src/connection/xmpp/Connector.ts create mode 100755 src/connection/xmpp/JingleHandler.ts create mode 100755 src/connection/xmpp/MessageElement.ts create mode 100755 src/connection/xmpp/handler.ts create mode 100755 src/connection/xmpp/handlers/caps.ts create mode 100755 src/connection/xmpp/handlers/chatMessage.ts create mode 100755 src/connection/xmpp/handlers/disco.ts create mode 100755 src/connection/xmpp/handlers/errorMessage.ts create mode 100755 src/connection/xmpp/handlers/headlineMessage.ts create mode 100755 src/connection/xmpp/handlers/jingle.ts create mode 100755 src/connection/xmpp/handlers/multiUser/DirectInvitation.ts create mode 100755 src/connection/xmpp/handlers/multiUser/Presence.ts create mode 100755 src/connection/xmpp/handlers/multiUser/PresenceProcessor.ts create mode 100755 src/connection/xmpp/handlers/multiUser/StatusCodeHandler.ts create mode 100755 src/connection/xmpp/handlers/multiUser/XMessage.ts create mode 100755 src/connection/xmpp/handlers/multiUser/groupChatMessage.ts create mode 100755 src/connection/xmpp/handlers/presence.ts create mode 100755 src/connection/xmpp/namespace.ts create mode 100755 src/errors/AuthenticationError.ts create mode 100755 src/errors/BaseError.ts create mode 100755 src/errors/ConnectionError.ts create mode 100755 src/errors/InvalidParameterError.ts create mode 100755 src/errors/ParsingError.ts create mode 100755 src/index.ts create mode 100755 src/plugin/AbstractPlugin.ts create mode 100755 src/plugin/EncryptionPlugin.ts create mode 100755 src/plugin/PluginAPI.interface.ts create mode 100755 src/plugin/PluginAPI.ts create mode 100755 src/plugin/PluginRepository.ts create mode 100755 src/plugins/AvatarPEPPlugin.ts create mode 100755 src/plugins/AvatarVCardPlugin.ts create mode 100755 src/plugins/BlockingCommandPlugin.ts create mode 100755 src/plugins/CommandPlugin.ts create mode 100755 src/plugins/JingleMessageInitiationPlugin.ts create mode 100755 src/plugins/LastMessageCorrectionPlugin.ts create mode 100755 src/plugins/MeCommandPlugin.ts create mode 100755 src/plugins/MessageCarbonsPlugin.ts create mode 100755 src/plugins/MessageDeliveryReceiptsPlugin.ts create mode 100755 src/plugins/NotificationPlugin.ts create mode 100755 src/plugins/PingPlugin.ts create mode 100755 src/plugins/TimePlugin.ts create mode 100755 src/plugins/VersionPlugin.ts create mode 100755 src/plugins/bookmarks/BookmarkProvider.ts create mode 100755 src/plugins/bookmarks/BookmarksPlugin.ts create mode 100755 src/plugins/bookmarks/RoomBookmark.ts create mode 100755 src/plugins/bookmarks/services/AbstractService.ts create mode 100755 src/plugins/bookmarks/services/LocalService.ts create mode 100755 src/plugins/bookmarks/services/PubSubService.ts create mode 100755 src/plugins/chatMarkers/ChatMarkersPlugin.ts create mode 100755 src/plugins/chatState/ChatStateConnection.ts create mode 100755 src/plugins/chatState/ChatStateMachine.ts create mode 100755 src/plugins/chatState/ChatStatePlugin.ts create mode 100755 src/plugins/chatState/State.ts create mode 100755 src/plugins/httpUpload/HttpUploadPlugin.ts create mode 100755 src/plugins/httpUpload/HttpUploadService.ts create mode 100755 src/plugins/mam/Archive.ts create mode 100755 src/plugins/mam/Plugin.ts create mode 100755 src/plugins/omemo/AttachmentHandler.ts create mode 100755 src/plugins/omemo/Plugin.ts create mode 100755 src/plugins/omemo/lib/Bootstrap.ts create mode 100755 src/plugins/omemo/lib/Bundle.ts create mode 100755 src/plugins/omemo/lib/BundleManager.ts create mode 100755 src/plugins/omemo/lib/Device.ts create mode 100755 src/plugins/omemo/lib/IdentityManager.ts create mode 100755 src/plugins/omemo/lib/Omemo.ts create mode 100755 src/plugins/omemo/lib/Peer.ts create mode 100755 src/plugins/omemo/lib/Session.ts create mode 100755 src/plugins/omemo/lib/Store.ts create mode 100755 src/plugins/omemo/model/EncryptedDeviceMessage.ts create mode 100755 src/plugins/omemo/model/Exportable.ts create mode 100755 src/plugins/omemo/model/IdentityKey.ts create mode 100755 src/plugins/omemo/model/PreKey.ts create mode 100755 src/plugins/omemo/model/RegistrationId.ts create mode 100755 src/plugins/omemo/model/SignedPreKey.ts create mode 100755 src/plugins/omemo/util/AES.ts create mode 100755 src/plugins/omemo/util/ArrayBuffer.ts create mode 100755 src/plugins/omemo/util/Const.ts create mode 100755 src/plugins/omemo/util/Formatter.ts create mode 100755 src/plugins/omemo/util/Stanza.ts create mode 100755 src/plugins/omemo/vendor/Address.ts create mode 100755 src/plugins/omemo/vendor/KeyHelper.ts create mode 100755 src/plugins/omemo/vendor/SessionBuilder.ts create mode 100755 src/plugins/omemo/vendor/SessionCipher.ts create mode 100755 src/plugins/omemo/vendor/Signal.ts create mode 100755 src/plugins/omemo/vendor/SignalStore.interface.ts create mode 100755 src/plugins/omemo/vendor/SignalStore.ts create mode 100755 src/plugins/otr/Plugin.ts create mode 100755 src/plugins/otr/Session.ts create mode 100755 src/ui/AvatarSet.ts create mode 100755 src/ui/ChatWindow.ts create mode 100755 src/ui/ChatWindowFileTransferHandler.ts create mode 100755 src/ui/ChatWindowList.ts create mode 100755 src/ui/ChatWindowMessage.ts create mode 100755 src/ui/Dialog.ts create mode 100755 src/ui/DialogList.ts create mode 100755 src/ui/DialogListItem.ts create mode 100755 src/ui/DialogNavigation.ts create mode 100755 src/ui/DialogPage.ts create mode 100755 src/ui/DialogSection.ts create mode 100755 src/ui/MenuComponent.ts create mode 100755 src/ui/MultiUserChatWindow.ts create mode 100755 src/ui/Overlay.ts create mode 100755 src/ui/Roster.ts create mode 100755 src/ui/RosterItem.ts create mode 100755 src/ui/VideoDialog.ts create mode 100755 src/ui/VideoWindow.ts create mode 100755 src/ui/actions/call.ts create mode 100755 src/ui/dialogs/about.ts create mode 100755 src/ui/dialogs/avatarupload.ts create mode 100755 src/ui/dialogs/commandHelp.ts create mode 100755 src/ui/dialogs/confirm.ts create mode 100755 src/ui/dialogs/contact.ts create mode 100755 src/ui/dialogs/contactBlock.ts create mode 100755 src/ui/dialogs/contactsearch.ts create mode 100755 src/ui/dialogs/debugLog.ts create mode 100755 src/ui/dialogs/exstatus.ts create mode 100755 src/ui/dialogs/fingerprints.ts create mode 100755 src/ui/dialogs/loginBox.ts create mode 100755 src/ui/dialogs/messageHistory.ts create mode 100755 src/ui/dialogs/multiUserInvitation.ts create mode 100755 src/ui/dialogs/multiUserInvite.ts create mode 100755 src/ui/dialogs/multiUserJoin.ts create mode 100755 src/ui/dialogs/multiUserMemberlist.ts create mode 100755 src/ui/dialogs/multiUserRoomConfiguration.ts create mode 100755 src/ui/dialogs/notification.ts create mode 100755 src/ui/dialogs/omemoDevices.ts create mode 100755 src/ui/dialogs/selection.ts create mode 100755 src/ui/dialogs/settings.ts create mode 100755 src/ui/dialogs/unknownSender.ts create mode 100755 src/ui/dialogs/vcard.ts create mode 100755 src/ui/dialogs/verification.ts create mode 100755 src/ui/util/ByteBeautifier.ts create mode 100755 src/ui/util/DateTime.ts create mode 100755 src/ui/util/ElementHandler.ts create mode 100755 src/ui/util/LongPress.ts create mode 100755 src/ui/util/Menu.ts create mode 100755 src/ui/util/TableElement.ts create mode 100755 src/ui/web.ts create mode 100755 src/util/Color.ts create mode 100755 src/util/FileHelper.ts create mode 100755 src/util/Hash.ts create mode 100755 src/util/HookRepository.ts create mode 100755 src/util/ImageHelper.ts create mode 100755 src/util/Location.ts create mode 100755 src/util/Log.interface.ts create mode 100755 src/util/Log.ts create mode 100755 src/util/PersistentArray.ts create mode 100755 src/util/PersistentMap.ts create mode 100755 src/util/Pipe.ts create mode 100755 src/util/Random.ts create mode 100755 src/util/SortedPersistentMap.ts create mode 100755 src/util/Translation.ts create mode 100755 src/util/UUID.ts create mode 100755 src/util/Utils.ts create mode 100755 src/vendor/Jingle.interface.ts create mode 100755 src/vendor/Strophe.ts create mode 100755 template/about.hbs create mode 100755 template/avatarUploadTemplate.hbs create mode 100755 template/bookmark.hbs create mode 100755 template/chat-window-message.hbs create mode 100755 template/chatWindow.hbs create mode 100755 template/chatWindowList.hbs create mode 100755 template/commandHelpDialog.hbs create mode 100755 template/confirm.hbs create mode 100755 template/contact.hbs create mode 100755 template/contactBlock.hbs create mode 100755 template/contactsearch.hbs create mode 100755 template/debugLog.hbs create mode 100755 template/dialog.hbs create mode 100755 template/dialogOmemoDeviceItem.hbs create mode 100755 template/dialogOmemoDeviceList.hbs create mode 100755 template/extensiveStatus.hbs create mode 100755 template/fingerprints.hbs create mode 100755 template/helpers/breaklines.js create mode 100755 template/helpers/t.js create mode 100755 template/helpers/tr.js create mode 100755 template/loginBox.hbs create mode 100755 template/menu.hbs create mode 100755 template/messageHistory.hbs create mode 100755 template/multiUserInvitation.hbs create mode 100755 template/multiUserInvite.hbs create mode 100755 template/multiUserJoin.hbs create mode 100755 template/multiUserMemberlist.hbs create mode 100755 template/notification.hbs create mode 100755 template/partials/menu.hbs create mode 100755 template/roster-form.hbs create mode 100755 template/roster-item.hbs create mode 100755 template/roster.hbs create mode 100755 template/selection.hbs create mode 100755 template/vcard-body.hbs create mode 100755 template/vcard.hbs create mode 100755 template/verification.hbs create mode 100755 template/videoDialog.hbs create mode 100755 test/AccountStub.ts create mode 100755 test/Client.ts create mode 100755 test/DiscoInfoVersion.spec.ts create mode 100755 test/JID.spec.ts create mode 100755 test/Options.spec.ts create mode 100755 test/Storage.spec.ts create mode 100755 test/connection/Form.spec.ts create mode 100755 test/connection/xmpp/handlers/presence.spec.ts create mode 100755 test/util/HookRepository.spec.ts create mode 100755 test/util/Pipe.spec.ts create mode 100755 test/util/Utils.spec.ts create mode 100755 tsconfig.json create mode 100755 webpack.config.js create mode 100755 yarn.lock [root@yfw jsxc-master]# sudo -u www yarn build yarn run v1.22.22 warning ../../package.json: No license field $ webpack --progress --config webpack.config.js --mode production 10% building 0/2 entries 2/2 dependencies 0/2 modulesDeprecation Warning: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0. Recommendation: math.div($grid-gutter-width, 2) or calc($grid-gutter-width / 2) More info and automated migrator: https://sass-lang.com/d/slash-div ╷ 368 │ $navbar-padding-horizontal: floor(($grid-gutter-width / 2)) !default; │ ^^^^^^^^^^^^^^^^^^^^^^ ╵ node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_variables.scss 368:43 @import scss/vendor/_all.scss 25:9 @import scss/main.scss 13:9 root stylesheet Deprecation Warning: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0. Recommendation: math.div($navbar-height - $line-height-computed, 2) or calc(($navbar-height - $line-height-computed) / 2) More info and automated migrator: https://sass-lang.com/d/slash-div ╷ 369 │ $navbar-padding-vertical: (($navbar-height - $line-height-computed) / 2) !default; │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_variables.scss 369:37 @import scss/vendor/_all.scss 25:9 @import scss/main.scss 13:9 root stylesheet Deprecation Warning: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0. Recommendation: math.div($line-height-computed - 1, 2) or calc(($line-height-computed - 1) / 2) More info and automated migrator: https://sass-lang.com/d/slash-div ╷ 43 │ padding: (($line-height-computed - 1) / 2); │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_code.scss 43:13 @import scss/vendor/_all.scss 51:11 @import scss/main.scss 13:9 root stylesheet Deprecation Warning: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0. Recommendation: math.div($line-height-computed, 2) or calc($line-height-computed / 2) More info and automated migrator: https://sass-lang.com/d/slash-div ╷ 44 │ margin: 0 0 ($line-height-computed / 2); │ ^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_code.scss 44:16 @import scss/vendor/_all.scss 51:11 @import scss/main.scss 13:9 root stylesheet Deprecation Warning: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0. Recommendation: math.div($gutter, 2) or calc($gutter / 2) More info and automated migrator: https://sass-lang.com/d/slash-div ╷ 7 │ padding-right: ceil(($gutter / 2)); │ ^^^^^^^^^^^ ╵ node_modules/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_grid.scss 7:24 container-fixed() node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_grid.scss 11:3 @import scss/vendor/_all.scss 52:11 @import scss/main.scss 13:9 root stylesheet Warning: 10 repetitive deprecation warnings omitted. assets by path images/emojione/*.svg 3.05 MiB 1832 assets assets by path images/icons/*.svg 95.1 KiB 42 assets assets by path images/filetypes/ 29.9 KiB 40 assets assets by path images/*.svg 14.8 KiB 9 assets assets by path assets/ 145 KiB 6 assets assets by path images/emoticons/*.svg 36.7 KiB 6 assets assets by path images/presence/*.svg 9.21 KiB 5 assets assets by path fonts/ 28 KiB 4 assets assets by chunk 2.7 MiB (name: main) asset jsxc.bundle.js 2.44 MiB [emitted] [minimized] (name: main) 1 related asset asset styles/jsxc.bundle.css 264 KiB [emitted] (name: main) asset images/XMPP_logo.png 9.35 KiB [emitted] [from: images/XMPP_logo.png] [copied] asset images/loading.gif 2.7 KiB [emitted] [from: images/loading.gif] [copied] asset LICENSE 1.08 KiB [emitted] [from: LICENSE] [copied] Entrypoint main 2.7 MiB (145 KiB) = styles/jsxc.bundle.css 264 KiB jsxc.bundle.js 2.44 MiB 6 auxiliary assets orphan modules 139 KiB [orphan] 27 modules runtime modules 1.65 KiB 9 modules javascript modules 4.35 MiB modules by path ./node_modules/ 3.14 MiB 268 modules modules by path ./src/ 1.11 MiB 226 modules modules by path ./template/ 95.6 KiB modules by path ./template/*.hbs 95.1 KiB 30 modules modules by path ./template/helpers/*.js 535 bytes 2 modules modules by path ./sound/*.mp3 239 bytes 3 modules modules by path ./images/ 168 bytes ./images/XMPP_logo.png 80 bytes [built] [code generated] ./images/icons/placeholder.svg 88 bytes [built] [code generated] json modules 461 KiB 30 modules css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!./node_modules/sass-loader/dist/cjs.js!./scss/main.scss 263 KiB [built] [code generated] WARNING in ./node_modules/strophe.js/dist/strophe.umd.js 66:44-71 Module not found: Error: Can't resolve 'xmldom' in '/www/wwwroot/szrengjing.com/jsxc/jsxc-master/node_modules/strophe.js/dist' @ ./src/vendor/Strophe.ts 4:17-38 @ ./src/plugins/MessageDeliveryReceiptsPlugin.ts 22:16-44 @ ./src/bootstrap/plugins.ts 5:38-89 @ ./src/index.ts 3:0-30 1 warning has detailed information that is not shown. Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it. webpack 5.65.0 compiled with 1 warning in 38502 ms Done in 40.43s. [root@yfw jsxc-master]# yarn build --bundleAnalyzer yarn run v1.22.22 warning ../../package.json: No license field $ webpack --progress --config webpack.config.js --mode production --bundleAnalyzer [webpack-cli] Error: Unknown option '--bundleAnalyzer' [webpack-cli] Run 'webpack --help' to see available commands and options error Command failed with exit code 2. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. [root@yfw jsxc-master]# sudo -u www yarn build -- --bundleAnalyzer yarn run v1.22.22 warning ../../package.json: No license field warning From Yarn 1.0 onwards, scripts don't require "--" for options to be forwarded. In a future version, any explicit "--" will be forwarded as-is to the scripts. $ webpack --progress --config webpack.config.js --mode production --bundleAnalyzer [webpack-cli] Error: Unknown option '--bundleAnalyzer' [webpack-cli] Run 'webpack --help' to see available commands and options error Command failed with exit code 2. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. [root@yfw jsxc-master]# sudo -u www yarn build:analyze yarn run v1.22.22 warning ../../package.json: No license field error Command "build:analyze" not found. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. [root@yfw jsxc-master]#
11-11
<template> <AuiGrid ref="viewTree" :data="data" :tree-config="{ children: 'children', renderIcon }" :show-header="false" :stripe="false" row-id="oid" height="auto" :auto-resize="true" :sync-resize="true" highlight-current-row @toggle-tree-change="handTreeExpand" > <AuiGridColumn field="label" tree-node show-overflow> <template #default="data"> <div> <AuiCheckbox v-model="data.row.checked" class="checkbox" :indeterminate="data.row.indeterminate" @change="checkboxChangeEvent($event, data.row)" ></AuiCheckbox> <IconLoading v-if="data.row.isLoading" class="loading-folder"></IconLoading> <span class="item_icon_new" :class="$util.getClassesExt(data.row)"></span> <span class="label">{{ data.row.label }}</span> </div> </template> </AuiGridColumn> <template #empty></template> </AuiGrid> </template> <script lang="jsx"> import { Grid, GridColumn, Checkbox } from '@aurora/vue3'; import { IconPlusSquare, IconMinusSquare, IconLoading } from '@aurora/vue3-icon'; import DBoxUtil from '../../common/utils/DBoxUtil'; import ShellItemHelper from '../../common/Helper/ShellItemHelper'; import ConstantParams from '../../common/ConstantParams'; import StringUtil from '../../common/utils/StringUtil'; import ViewExpandTree from './ViewExpandTree.vue'; import NodeFactory from '../../common/NodeFactory'; import UrlHelper from '../../common/Helper/UrlHelper'; import FileManager from '../../common/FileBrowser/FileManager'; export default { name: 'ViewDepthExpandTree', components: { AuiGrid: Grid, AuiGridColumn: GridColumn, AuiCheckbox: Checkbox, IconLoading: IconLoading() }, extends: ViewExpandTree, props: { rootNode: Object, sysConfig: Object, viewConfig: Object, defaultCheckedKeyItems: { type: Array, default: () => { return []; } }, defaultExpandedKeyItems: { type: Array, default: () => { return []; } }, serverCreateNodes: { type: Array, default: () => { return []; } }, isUpdate: { type: Boolean, default: false }, isSelectAll: { type: String, default: '0' } }, emits: {'cancelSelectAll': null, 'emptyDir': null}, methods: { renderIcon(h, { row, active }) { if (!row.isFolder) { return; } const expandIcon = IconMinusSquare(); const closeIcon = IconPlusSquare(); return active ? <expandIcon></expandIcon> : <closeIcon></closeIcon>; }, // 动态加载文件夹内容 async handTreeExpand({ row }) { if (row.loaded) { return; } row.children = []; if (!row.isFolder) { return; } row.isLoading = true; try { let res = await this.getServerData({ data: row }); row.isLoading = false; row.loaded = true; row.children = res; if (this.isUpdate) { this.setCheckedForLocal(row); } else { this.setChecked(row.children, row.checked); } } catch (e) { row.isLoading = false; row.loaded = true; } }, // 文件夹展开后根据本地节点设置选中 setCheckedForLocal(row) { if (this.isSelectAll === '1') { row.children.forEach(item => { item.checked = true; }); return; } if (this.isSelectAll === '2') { row.children.forEach(item => { item.checked = false; }); return; } if (!row.checked) { return; } let viewNodeDAL = NodeFactory.GetDAL(this.viewConfig.viewname); viewNodeDAL.getChildViewNodesByOid(row.oid).then(viewNodes => { let selectedNum = 0; row.children.forEach(item => { if (viewNodes.find(n => item.oid.includes(n.oid) || item.label === n.name)) { selectedNum++; item.checked = true; } else { item.checked = false; } }); if (selectedNum < row.children.length) { row.checked = false; row.indeterminate = true; row.isSelectChild = true; } }); }, // 复选框change事件 checkboxChangeEvent(checked, row) { if (!checked) { this.$emit('cancelSelectAll'); } if (!row.isFolder || !row.loaded) { this.setParentChecked(row); return; } const isExpand = this.$refs.viewTree.hasTreeExpand(row); if (isExpand) { if (!checked) { // 第二次点击选中子 if (row.isSelectChild) { row.checked = true; row.indeterminate = false; row.isSelectChild = false; this.setChecked(row.children, true); this.setParentChecked(row); return; } // 取消所有选中 row.isSelectChild = false; this.setChecked(row.children, false); } else if (row.isSelectChild && row.indeterminate) { row.checked = true; row.indeterminate = false; row.isSelectChild = false; this.setChecked(row.children, true); } else if (row.children.length) { row.checked = false; row.indeterminate = true; row.isSelectChild = true; } this.setParentChecked(row); return; } if (!checked) { row.isSelectChild = false; this.setChecked(row.children, false); this.setParentChecked(row); } else { row.isSelectChild = false; row.indeterminate = false; this.setChecked(row.children, true); this.setParentChecked(row); } }, // 递归设置子节点选中 setChecked(children, checked) { children.forEach(item => { item.checked = checked; item.indeterminate = false; if (item.isFolder) { this.setChecked(item.children, checked); } }); }, // 设置父节点选中 setParentChecked(row) { const findRes = this.getParents(row); if (!findRes.isFind || !findRes.parents.length) { return; } for (let i = findRes.parents.length - 1; i >= 0; i--) { let cur = findRes.parents[i]; let isSelectAll = true; for (let item of cur.children) { if (!item.checked) { isSelectAll = false; } } if (isSelectAll) { cur.checked = true; cur.indeterminate = false; cur.isSelectChild = false; } else { cur.checked = false; cur.indeterminate = true; cur.isSelectChild = true; } } }, // 获取所有祖先节点 getParents(row, childs, result = []) { if (!childs) { childs = this.$refs.viewTree.getData(); } for (const item of childs) { if (item.label === row.label && item.oid === row.oid) { return { isFind: true, parents: result }; } if (item.isFolder && item.loaded) { result.push(item); const findRes = this.getParents(row, item.children); if (!findRes.isFind) { result.pop(); continue; } result = result.concat(findRes.parents); return { isFind: true, parents: result }; } } return { isFind: false, parents: result }; }, // 请求文件夹内容 getTreeData(dirNode, resolve) { if (!this.sysConfig) { return; } if (dirNode.level === 0) { resolve(this.data); return; } if (dirNode.data.oid.includes('wt.doc.WTDocument')) { resolve([]); return; } this.getServerData(dirNode).then(children => { if (this.data.length === 0) { this.$util.showDBoxMessage(this.$t('reminder'), this.$t('directoryIsNull'), 'warning', { onConfirm: () => { this.$emit('emptyDir'); } }); } resolve(children); this.$nextTick(() => { // 设置子节点选中 let firstItem; this.data.forEach(item => { const isFind = this.defaultCheckedKeyItems.find(c => c.oid === item.oid || DBoxUtil.fillORStr(c.oid) === item.oid || c.name === item.label); if (isFind) { item.checked = true; firstItem = item; } }); if (this.defaultCheckedKeyItems.length === 1 && firstItem) { setTimeout(() => { this.$refs.viewTree.scrollToRow(firstItem); }, 300); } this.locateNode(); }); }); }, // 智能地址栏新增节点选中 async locateNode() { if (!this.serverCreateNodes || this.serverCreateNodes.length <= 1) { return; } const firstData = this.data.find(item => item.name.toLowerCase() === this.serverCreateNodes[0].toLowerCase()); if (!firstData) { return; } let firstNode = this.$refs.viewTree.getRowById(UrlHelper.UrlEncode(DBoxUtil.fillORStr(firstData.oid))); if (!firstNode) { firstNode = this.$refs.viewTree.getRowById(UrlHelper.UrlEncode(DBoxUtil.GetSimpleOid(firstData.oid))); if (!firstNode) { return; } } this.$refs.viewTree.scrollToRow(firstNode); await this.handTreeExpand({ row: firstNode }); this.$refs.viewTree.setTreeExpansion([firstData], true); const expandNodes = this.serverCreateNodes.slice(1); let curNode = firstNode; for (let i = 0; i < expandNodes.length; i++) { const nodeName = expandNodes[i]; let nextNode = curNode.children.find(n => { if (n.name.toLowerCase() === nodeName.toLowerCase()) { return true; } if (!n.isFolder && n.name.includes('.')) { const nameNoExt = n.name.substring(0, n.name.lastIndexOf('.')); return nameNoExt.toLowerCase() === nodeName.toLowerCase(); } }); if (!nextNode) { return; } await this.handTreeExpand({ row: nextNode }); this.$refs.viewTree.setTreeExpansion([nextNode], true); const rowEle = document.querySelector(`[data-rowid="${UrlHelper.UrlEncode(nextNode.oid)}"]`); if (rowEle) { rowEle.scrollIntoView(); } curNode = nextNode; if (i === expandNodes.length - 1) { curNode.checked = true; this.setParentChecked(curNode); } } }, createTreeDataByFolderVO(folderVO, parentPath) { let nd = { label: folderVO.name, oid: folderVO.oid, checked: false, isFolder: true, selectType: 0, oldUpdateType: 0, docNumber: null, oldNdOid: null, children: [ { label: '' } ], loaded: false, isLoading: false, isSelectChild: false, fullPath: parentPath + '\\' + folderVO.name, ...folderVO }; return nd; }, createFileViewNode(node, treeNode) { let viewNode = { name: node.label, localrelpath: this.rootNode.localrelpath, oid: DBoxUtil.fillORStr(StringUtil.isNullOrEmpty(node.oldNdOid) ? node.oid : node.oldNdOid), viewid: this.viewConfig ? this.viewConfig.viewid : 0, type: 'file', fileSize: 0, state: ConstantParams.STATE.NormalState, md5: '', updatetype: ShellItemHelper.UpdateType.folderAllSelectType, primaryoid: '', oidpath: this.getOidPath(node), viewConfig: ShellItemHelper.getNodeRoot(this.rootNode), parentrelpath: treeNode.parent.level < 1 ? this.rootNode.localrelpath : FileManager.pathJoin(this.rootNode.localrelpath, treeNode.parent.data.fullPath) }; return viewNode; }, createFolderViewNode(node, treeNode, isHalfChecked) { let viewNode = { name: node.label, localrelpath: this.rootNode.localrelpath, parentrelpath: treeNode.parent.level < 1 ? this.rootNode.localrelpath : FileManager.pathJoin(this.rootNode.localrelpath, treeNode.parent.data.fullPath), oid: node.oid, viewid: this.viewConfig ? this.viewConfig.viewid : 0, type: 'folder', fileSize: 0, state: ConstantParams.STATE.NormalState, md5: '', updatetype: isHalfChecked ? ShellItemHelper.UpdateType.currentFolderOnly : ShellItemHelper.UpdateType.folderAllSelectType, primaryoid: '', oidpath: this.getOidPath(node), viewConfig: ShellItemHelper.getNodeRoot(this.rootNode) }; return viewNode; }, getTreeNodes(tableData = this.$refs.viewTree.getData(), parent = { level: 0 }) { let treeData = []; tableData.forEach(item => { let treeItem = { checked: item.checked, indeterminate: item.indeterminate, data: item, loaded: item.loaded, childNodes: [], parent, level: parent.level + 1 }; if (item.isFolder) { treeItem.childNodes = this.getTreeNodes(item.children, treeItem); } treeData.push(treeItem); }); return treeData; }, getSelectedTreeNodes(tableData = this.$refs.viewTree.getData(), parent = { level: 0 }) { let halfChecked = []; let checked = []; tableData.forEach(item => { if (!item.checked && !item.indeterminate) { return; } let treeItem = { checked: item.checked, indeterminate: item.indeterminate, data: item, loaded: item.loaded, childNodes: [], parent, level: parent.level + 1 }; if (item.isFolder) { treeItem.childNodes = this.getTreeNodes(item.children, treeItem); } item.indeterminate ? halfChecked.push(treeItem) : checked.push(treeItem); }); return { halfChecked, checked }; }, // 获取选中节点 getSelectedData() { let lstFullUpdateNode = []; let lstOneFldUpdateNode = []; let lstOneFileUpdateNode = []; let { checked, halfChecked } = this.getSelectedTreeNodes(); checked.forEach(f => { if (f.isFolder) { lstFullUpdateNode.push(this.createFolderViewNode(f.data, f)); } else { lstOneFileUpdateNode.push(this.createFileViewNode(f.data, f)); } }); halfChecked.forEach(f => { lstOneFldUpdateNode.push(this.createFolderViewNode(f.data, f, true)); }); let isFullSelected = halfChecked.length === 0 && checked.length === this.data.length; isFullSelected = this.isFullSelected && isFullSelected; let isFullUnSelected = this.isFullUnSelected && halfChecked.length === 0 && checked.length === 0; return { checkedTreeNode: checked, halfCheckTreeNode: halfChecked, lstFullUpdateNode, lstOneFldUpdateNode, lstOneFileUpdateNode, isFullSelected, isFullUnSelected }; }, selectAll() { const treeData = this.$refs.viewTree.getData(); this.setChecked(treeData, true); this.isFullSelected = true; this.isFullUnSelected = false; }, deselectAll() { const treeData = this.$refs.viewTree.getData(); this.setChecked(treeData, false); this.isFullSelected = false; this.isFullUnSelected = true; } } }; </script> <style scoped> :deep(.aui-grid .aui-grid-body__row.row__current), :deep(.aui-grid .row__selected) { background-color: #bae7ff !important; } .loading-folder { font-size: 14px; margin-right: 5px; } .label { position: absolute; vertical-align: middle; display: inline-block; width: 85%; text-overflow: ellipsis; overflow: hidden; } :deep(.aui-grid .aui-grid-body__column.col__treenode .aui-grid-cell .aui-grid-tree-wrapper) { flex-shrink: 0; } .checkbox { margin-right: 5px; } :deep(.aui-grid-body__row:hover) { background-color: #e6f7ff; } :deep(.aui-grid-body__column .col__treenode) { padding: 0px 8px; } :deep(.aui-grid.size__mini .aui-grid-body__column.col__ellipsis), :deep(.aui-grid.size__mini .aui-grid-footer__column.col__ellipsis), :deep(.aui-grid.size__mini .aui-grid-header__column.col__ellipsis) { height: 22px; } .unknown { background: url('../../assets/image/unknown-circle.svg') no-repeat 100% / cover; } </style> 这是客户端ViewDepthExpandTree.vue的代码下边是ViewDepthUpdateDialog.vue的代码: <template> <div style="z-index: 9999"> <DialogBase :title="$t('expandViewFolder')" :width="`${624}px`" :box-visibility="true" :is-can-drag="true" :show-max="true" :drag-event="dragEvent" @close="close" @confirm="confirm" @open="open" @maximize="setMaxStyle" > <template #content> <div class="tree-panel-content"> <div class="tree-panel"> <img v-if="isLoading" src="../../assets/image/loading.gif" /> <ViewDepthExpandTree ref="viewTree" :root-node="rootNode" :default-checked-key-items="defaultCheckedKeyList" :default-expanded-key-items="defaultExpandedKeyList" :server-create-nodes="options.serverCreateNodes" :sys-config="sysConfig" :view-config="viewConfig" :is-update="true" :is-select-all="isSelectAll" @tree-loaded="treeLoaded" @empty-dir="close" @permission="showPermissionDialog" @cancel-select-all="isSelectAll = '0'" ></ViewDepthExpandTree> </div> </div> </template> <template #footer> <div> <AuiRadio v-model="isSelectAll" label="1">{{ $t('selectAll') }}</AuiRadio> <AuiRadio v-model="isSelectAll" label="2">{{ $t('deselectAll') }}</AuiRadio> <AuiButton type="primary" @click="confirm">{{ $t('ok') }}</AuiButton> <AuiButton @click="close">{{ $t('cancel') }}</AuiButton> </div> </template> </DialogBase> <!--权限申请弹窗--> <PermissionApplicationDialog v-if="permission.isVisible" :options="permission" @close="closePermissionApplicationDialog"></PermissionApplicationDialog > </div> </template> <script> import DialogBase from './DialogBase'; import { Button, Radio } from '@aurora/vue3'; import { IconPlusSquare, IconMinusSquare, IconFolderClosed } from '@aurora/vue3-icon'; import ViewDepthExpandTree from './ViewDepthExpandTree'; import EnumConst from '../../common/EnumConst'; import DBoxUtil from '../../common/utils/DBoxUtil'; import ShellItemHelper from '../../common/Helper/ShellItemHelper'; import LogUtil from '../../common/utils/LogUtil'; import NodeFactory from '../../common/NodeFactory'; import PermissionApplicationDialog from './PermissionApplicationDialog'; import CustomTreeDataBase from './CustomTreeDataBase'; import $ from 'jquery'; export default { name: 'ViewDepthUpdateDialog', components: { AuiButton: Button, AuiRadio: Radio, ViewDepthExpandTree, DialogBase, PermissionApplicationDialog }, mixins: [CustomTreeDataBase], props: { options: { isVisible: Boolean, sysConfig: Object, viewConfig: Object, rootNode: Object, defaultCheckedKeyList: Array, defaultExpandedKeyList: Array, serverCreateNodes: Array, closeCallBack: Function } }, emits: ['close'], data() { return { IconPlusSquare: IconPlusSquare(), IconMinusSquare: IconMinusSquare(), IconFolderClosed: IconFolderClosed(), isLoading: true, viewFolder: null, sysConfig: null, viewConfig: null, rootNode: null, data: [], localNodes: [], defaultCheckedKeyList: [], defaultExpandedKeyList: [], selectedNode: null, isSelectAll: '0', radioLabel: ['1', '2'], folderView: null, permission: { isVisible: false, permInfo: null } }; }, watch: { isSelectAll: { handler(newVal, oldVal) { if (newVal === this.radioLabel[0]) { this.$refs.viewTree.selectAll(); } else if (newVal === this.radioLabel[1]) { this.$refs.viewTree.deselectAll(); } } }, item: { handler(val, oldVal) { this.folderView = val; } } }, created() { this.sysConfig = this.options.sysConfig; this.viewConfig = this.options.viewConfig; this.rootNode = this.options.rootNode; this.rootNode.oid = DBoxUtil.IsBookmarkEntity(this.rootNode.oid) ? this.rootNode.primaryoid : this.rootNode.oid; this.rootNode.selectType = ShellItemHelper.UpdateType.customerType; this.defaultCheckedKeyList = this.options.defaultCheckedKeys; this.defaultExpandedKeyList = this.options.defaultExpandedKeyList; this.open(); }, methods: { open() { this.isLoading = true; let viewname = this.viewConfig.viewname; this.$util.uemTrack('PA86C41B814DB84', this.sysConfig.username); LogUtil.info('ViewDepthUpdate Operation: ' + this.sysConfig.username + ' ' + viewname); let viewNodeDAL = NodeFactory.GetDAL(this.viewConfig.viewname); viewNodeDAL.findByPaths([this.viewConfig.viewname]).then(res => { this.localNodes = res; }); }, showPermissionDialog(permParams) { this.isLoading = false; this.permission.permInfo = permParams; this.permission.userConfig = this.sysConfig; this.permission.isVisible = true; }, treeLoaded(isLoading) { this.isLoading = isLoading; }, closePermissionApplicationDialog() { this.permission.isVisible = false; this.$emit('close'); }, confirm() { this.parseInfo(this.rootNode.oid, this.$refs.viewTree.getTreeNodes(), this.localNodes); let serverParameters = { customOnlyFolderOids: this.customOnlyFolderOids, oids: this.oids, onlyFolderOids: this.onlyFolderOids, updateType: EnumConst.ViewUpdateType.Custom, parentNode: {}, ...this.rootNode }; let viewNode = {}; viewNode.oid = this.rootNode.oid; viewNode.localrelpath = this.rootNode.localrelpath; serverParameters.parentNode = viewNode; // 全选时使用全递归 if (this.isSelectAll === this.radioLabel[0] || this.isSelectAll === '1') { serverParameters.updateType = EnumConst.ViewUpdateType.Recursion; serverParameters.oids = [this.rootNode.oid]; } this.options.closeCallBack({ isOpenUpdate: true, serverParameters, isDepthUpdate: true }); this.$store.commit('setIsClickDialogConfirm', true); this.$emit('close'); }, close() { this.$emit('close'); }, // 树节点点击事件 handleItemClick(data, node, vm) { LogUtil.info(node); }, dragEvent() { const container = $('.tree-panel', this.$el)[0]; const rect = container.parentNode.getBoundingClientRect(); const MIN_HEIGHT = 465; // 边框余量 const MARGIN = 5; if (rect.height - MARGIN < MIN_HEIGHT) { return; } container.style.height = rect.height - MARGIN + 'px'; }, setMaxStyle(isMaximize) { const container = $('.tree-panel', this.$el)[0]; const rect = container.parentNode.getBoundingClientRect(); const MIN_HEIGHT = 465; // 边框余量 const MARGIN = 5; if (isMaximize) { if (rect.height - MARGIN < MIN_HEIGHT) { return; } container.style.height = rect.height - MARGIN + 'px'; } else { // 原始高度 const ORIGIN_HEIGHT = 465; container.style.height = ORIGIN_HEIGHT + 'px'; this.messageHeight = ORIGIN_HEIGHT; } } } }; </script> <style scoped> :deep(.content) { border: none; } .tree-content { width: calc(100%-15px); min-height: 285px; background: white; border: 1px solid #666; margin: 0 auto; margin-top: 3px; padding: 7px; } .tree-panel { border: 1px solid #666; width: 99.5%; height: 465px; overflow: auto; } .tree-panel img { display: table-cell; vertical-align: middle; margin: 0 auto; margin-top: 20%; } :deep(.aui-radio__inner::after) { width: 7px; height: 7px; background: #333; } :deep(.tree-panel::-webkit-scrollbar-thumb) { border-radius: 0; } :deep(.aui-radio) { float: left; line-height: 26px; margin-right: 20px; } .tree-panel-content { height: 100%; overflow: auto; } </style> 现在问题是,当我点开弹窗后,里边的table表格总是和弹窗底部有空白距离,当我放大和缩小弹窗时空白距离会自动被表格中的突然出现的数据填补,当我快速上下拖动弹窗下方时,空白距离又会时不时的显现,我怎么才能让打开弹窗时没有空白距离且表格填满弹窗?
10-30
e inject success iframeid VM8582 html_helper.js:3 note html_helper inject success VM8586:185 [CodeLive] HTTP detected: Connecting using WS DataManager.js:44 Uncaught SyntaxError: Unexpected token '{' (at DataManager.js:44:10) VM8592 chunk-BrS3hlmy.js:2 [AttaTransport] addReadyCallback is unimplements method, callback: function jsyilai.js:98 所有脚本加载并执行完成 DevTools failed to load source map: Could not load content for http://127.0.0.1:8080/KuCun2/main/bootstrap-3.3.7-dist/css/bootstrap.css.map: Unexpected token '/', "/*! * Boo"... is not valid JSON VM8589 bancai.js:44 初始化失败: Error: 无法从父窗口获取 DataManager at VM8589 bancai.js:18:24 at new Promise (<anonymous>) at waitForDataManager (VM8589 bancai.js:14:16) at initialize (VM8589 bancai.js:26:33) at HTMLDocument.<anonymous> (VM8589 bancai.js:232:5) at e (VM8610 jquery-3.6.0.min.js:2:30038) ------------------------ bancai.js ------------------------ // bancai.js $(document).ready(function () { const modal = new bootstrap.Modal('#bancaiModal'); let currentMode = 'view'; let caizhiList = []; let mupiList = []; let currentSearchText = ''; // 从父窗口获取 DataManager let dataManager = null; // 等待父窗口的 DataManager 准备就绪 async function waitForDataManager() { return new Promise((resolve, reject) => { if (window.parent && window.parent.dataManager) { resolve(window.parent.dataManager); } else { reject(new Error('无法从父窗口获取 DataManager')); } }); } // 初始化函数 async function initialize() { try { dataManager = await waitForDataManager(); if (!dataManager || typeof dataManager.fetchAll !== 'function') { throw new Error('无效的 DataManager 实例'); } // 解构需要的方法和属性 const { data, addEntity, updateEntity, deleteEntity, fetchAll } = dataManager; // 确保数据已加载 await fetchAll(); // 更新材质和木皮选项 updateOptions(); // 渲染板材表格 refreshTable(); } catch (error) { console.error('初始化失败:', error); alert('系统初始化失败,请刷新页面或联系管理员'); } } // 更新材质和木皮选项 function updateOptions() { caizhiList = data.caizhis; updateSelectOptions('#caizhiSelect', caizhiList); mupiList = data.mupis.map(m => ({ ...m, name: m.you ? `${m.name}(油漆)` : m.name, })); updateSelectOptions('#mupi1Select', mupiList); updateSelectOptions('#mupi2Select', mupiList); } // 更新下拉框选项 function updateSelectOptions(selector, data) { $(selector).empty(); data.forEach(item => { $(selector).append(`<option value="${item.id}">${item.name}</option>`); }); } // 刷新表格 function refreshTable() { const filteredData = filterBancais(currentSearchText); renderBancaiTable(filteredData); } // 搜索过滤 function filterBancais(searchText) { if (!searchText) return data.bancais; return data.bancais.filter(bancai => { const caizhiName = bancai.caizhi?.name || ''; const mupi1Name = bancai.mupi1?.name || ''; const mupi2Name = bancai.mupi2?.name || ''; const houdu = bancai.houdu.toString(); return [ caizhiName.toLowerCase(), mupi1Name.toLowerCase(), mupi2Name.toLowerCase(), houdu.toLowerCase(), ].some(field => field.includes(searchText.toLowerCase())); }); } // 渲染表格 function renderBancaiTable(bancais) { const $tbody = $('#bancaiTable tbody'); $tbody.empty(); bancais.forEach(bancai => { const caizhiName = bancai.caizhi?.name || '未知'; const mupi1Name = bancai.mupi1?.name || '未知'; const mupi2Name = bancai.mupi2?.name || '未知'; const row = ` <tr data-id="${bancai.id}"> <td>${bancai.id}</td> <td>${caizhiName}</td> <td>${mupi1Name} ${bancai.mupi1?.you ? '(油漆)' : ''}</td> <td>${mupi2Name} ${bancai.mupi2?.you ? '(油漆)' : ''}</td> <td>${bancai.houdu}</td> <td> <button class="btn btn-sm btn-info view-btn">查看</button> <button class="btn btn-sm btn-warning edit-btn">编辑</button> <button class="btn btn-sm btn-danger delete-btn">删除</button> </td> </tr> `; $tbody.append(row); }); bindTableEvents(); } // 绑定表格事件 function bindTableEvents() { $('.view-btn').click(function () { const id = $(this).closest('tr').data('id'); openModalForBancai(id, 'view'); }); $('.edit-btn').click(function () { const id = $(this).closest('tr').data('id'); openModalForBancai(id, 'edit'); }); $('.delete-btn').click(function () { const id = $(this).closest('tr').data('id'); deleteBancai(id); }); } // 添加按钮事件 $('#addBancaiBtn').click(function () { $('#bancaiForm')[0].reset(); $('#modalTitle').text('添加新板材'); currentMode = 'add'; enableForm(true); updateOptions(); modal.show(); }); // 搜索按钮事件 $('#searchBtn').click(function () { currentSearchText = $('#searchInput').val(); refreshTable(); }); // 输入框实时搜索 $('#searchInput').on('input', function () { currentSearchText = $(this).val(); refreshTable(); }); // 打开弹窗显示板材数据 function openModalForBancai(id, mode) { const bancai = data.bancais.find(b => b.id === id); if (!bancai) return; currentMode = mode; $('#bancaiId').val(bancai.id); $('#caizhiSelect').val(bancai.caizhi.id); $('#mupi1Select').val(bancai.mupi1.id); $('#mupi2Select').val(bancai.mupi2.id); $('#houdu').val(bancai.houdu); $('#modalTitle').text(mode === 'view' ? '板材详情' : '编辑板材'); enableForm(mode === 'edit'); modal.show(); } // 启用/禁用表单 function enableForm(enable) { $('#caizhiSelect').prop('disabled', !enable); $('#mupi1Select').prop('disabled', !enable); $('#mupi2Select').prop('disabled', !enable); $('#houdu').prop('disabled', !enable); $('#saveBtn').toggle(enable); } // 保存按钮点击事件 $('#saveBtn').click(async function () { const formData = { id: $('#bancaiId').val(), caizhiId: parseInt($('#caizhiSelect').val()), mupi1Id: parseInt($('#mupi1Select').val()), mupi2Id: parseInt($('#mupi2Select').val()), houdu: parseFloat($('#houdu').val()), }; try { if (currentMode === 'add') { await addEntity('bancais', formData); } else { await updateEntity('bancais', formData); } refreshTable(); modal.hide(); } catch (error) { console.error('操作失败:', error); alert('操作失败,请重试'); } }); // 删除板材 async function deleteBancai(id) { if (!confirm('确定要删除此板材吗?')) return; try { await deleteEntity('bancais', id); refreshTable(); } catch (error) { console.error('删除失败:', error); alert('删除失败,请重试'); } } // 初始化应用 initialize(); }); ------------------------ index.js ------------------------ $().ready(function () { const username = localStorage.getItem("name"); $("#username").text(username) const $username = $('#username'); // 获取用户名元素 const $menu = $('.menu'); // 获取菜单元素 let hideTimeout = null; // 用于存储延迟隐藏的定时器 // 点击用户名时显示菜单 $username.on('click', function() { const usernamePosition = $username.position(); // 获取用户名的位置 $menu.css({ top: usernamePosition.top + $username.outerHeight(), // 设置菜单顶部位置 left: usernamePosition.left // 设置菜单左侧位置 }).show(); // 显示菜单 }); // 鼠标移入菜单时清除隐藏定时器 $menu.on('mouseenter', function() { clearTimeout(hideTimeout); }); // 鼠标移出菜单时设置延迟隐藏 $menu.on('mouseleave', function() { hideTimeout = setTimeout(function() { $menu.hide(); // 隐藏菜单 }, 500); // 延迟 500 毫秒 }); $("#main_u li a").click(function() {loadIframe($(this).attr("href"));return false;}) function loadIframe(url) { let iframe=$("#iframeid") iframe.attr("src", url + '?v=' + new Date().getTime()); // 添加时间戳 } }); ------------------------ main.js ------------------------ async function https(url,data,callback){ const defaultConfig = { contentType: 'application/json', dataType: 'json', timeout: 10000 }; try { const response = await $.ajax({ ...defaultConfig, url: url, method: 'POST', data: JSON.stringify(data) }); if (response.status === 200) { callback?.(response.data); return response.data; } else { handleBusinessError(response); return null; } } catch (error) { handleNetworkError(error+">="+url); return null; } } // 错误处理 function handleBusinessError(response) { console.error('业务错误:', response.text); alert(`操作失败: ${response.text}`); } function handleNetworkError(error) { console.error('网络错误:', error); alert('网络连接异常,请检查网络后重试'); } function checkLoginStatus() { } function deepMergeArrays(frontend, backend) { const resultMap = new Map(); // 遍历前端数据并存入 Map 中以便快速查找 frontend.forEach(item => resultMap.set(item.id, { ...item })); // 遍历后端数据并与前端数据进行合并 backend.forEach(item => { if (resultMap.has(item.id)) { // 如果存在相同 ID,则合并两者的内容 resultMap.set( item.id, Object.assign(resultMap.get(item.id), item) ); } else { // 如果不存在相同 ID,则新增该条目 resultMap.set(item.id, { ...item }); } }); // 将最终结果转回数组形式 return Array.from(resultMap.values()); } //(function ($){ // // // // // // 页面加载时检查登录状态 // checkLoginStatus(); // //})(jQuery); // // // function removeSpecificCharactersAndConvertToNumber(str, charsToRemove) { const regex = new RegExp(`[${charsToRemove}]`, 'g'); // 创建用于匹配指定字符的正则表达式 const cleanedStr = str.replace(regex, ''); // 移除指定字符 const numberValue = parseFloat(cleanedStr); // 转换为浮点数 return isNaN(numberValue) ? null : numberValue; // 如果无法解析,则返回 null } ------------------------ bancai.html ------------------------ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>板材数据管理</title> <!-- 引入 Bootstrap CSS --> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> <!-- 引入 jQuery --> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> </head> <body> <div class="container mt-4"> <h1 class="mb-4">板材数据管理</h1> <!-- 搜索框 --> <div class="row mb-3"> <div class="col-md-6"> <div class="input-group"> <input type="text" class="form-control" id="searchInput" placeholder="搜索材质、木皮或厚度..."> <button class="btn btn-outline-secondary" type="button" id="searchBtn"> <i class="bi bi-search"></i> 搜索 </button> </div> </div> <div class="col-md-6 text-end"> <button class="btn btn-primary" id="addBancaiBtn">添加新板材</button> </div> </div> <table class="table table-striped mt-3" id="bancaiTable"> <thead> <tr> <th>ID</th> <th>材质</th> <th>木皮1</th> <th>木皮2</th> <th>厚度</th> <th>操作</th> </tr> </thead> <tbody> <!-- 数据将通过 DataManager 加载 --> </tbody> </table> </div> <!-- 模态框保持不变 --> <div class="modal fade" id="bancaiModal" tabindex="-1" aria-hidden="true"> <!-- ... 原有模态框内容 ... --> </div> <!-- 查看/编辑弹窗 --> <div class="modal fade" id="bancaiModal" tabindex="-1" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="modalTitle">板材详情</h5> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> </div> <div class="modal-body"> <form id="bancaiForm"> <input type="hidden" id="bancaiId"> <div class="mb-3"> <label class="form-label">材质</label> <select class="form-select" id="caizhiSelect" name="caizhi"></select> </div> <div class="mb-3"> <label class="form-label">木皮1</label> <select class="form-select" id="mupi1Select" name="mupi1"></select> </div> <div class="mb-3"> <label class="form-label">木皮2</label> <select class="form-select" id="mupi2Select" name="mupi2"></select> </div> <div class="mb-3"> <label class="form-label">厚度</label> <input type="number" step="0.01" class="form-control" id="houdu" name="houdu"> </div> </form> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button> <button type="button" class="btn btn-primary" id="saveBtn">保存</button> </div> </div> </div> </div> <!-- 引入 Bootstrap JS --> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script> <script type="module" src="../js/bancai.js"></script> <!-- 改为模块方式导入 --> </body> </html> ------------------------ index.html ------------------------ <!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <title>峤丞板材库存管理</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" type="text/css" href="main/bootstrap-3.3.7-dist/css/bootstrap.css.map"> <link rel="stylesheet" type="text/css" href="css/util.css"> <link rel="stylesheet" type="text/css" href="css/main.css"> <link rel="stylesheet" type="text/css" href="css/index2.css"> <script type="text/javascript" src="js/jquery-3.2.1.min.js"></script> <script type="text/javascript" src="js/jsyilai.js"></script> <script type="module"> // 共享的DataManager类 // 导入并创建 DataManager 单例 import { DataManager } from './data/DataManager.js'; // 创建单例实例并挂载到 window window.dataManager = new DataManager('http://127.0.0.1:8080'); console.log(dataManager) // 初始化时获取所有数据 window.dataManager.fetchAll().then(() => { console.log('Initial data loaded in main window'); console.log(dataManager) }); document.addEventListener('DOMContentLoaded', async () => { try { // 创建 DataManager 单例 window.dataManager = new DataManager('http://127.0.0.1:8080'); // 初始化时获取所有数据 await window.dataManager.fetchAll(); console.log('Data Manager initialized successfully'); // 触发一个自定义事件,通知子页面可以安全访问 dataManager const iframe = document.getElementById('iframeid'); iframe.onload = () => { console.log('Iframe loaded successfully'); iframe.contentWindow.postMessage('DataManagerReady', '*'); }; } catch (error) { console.error('Failed to initialize DataManager:', error); } }); </script> <style type="text/css"> *{ margin:0; padding:0; } .frame-header { height: 60px; background-color: #23262E; justify-content: space-between; } .frame-header-li{ font-family: Arial, Helvetica, sans-serif; font-size:40px; } .frame-ul{ } .frame-ul li{ border-style: solid; border-width:1px 0px 1px 0px; margin-top: 1px; height: 35px; text-align: center } #username{ position: absolute; right: 0; /* 靠右 */ } .frame-body { position: fixed; top: 60px; right: 0; bottom: 0; left: 0; display: flex; flex-direction: row; } .frame-side { scrollbar-width: none; /* firefox隐藏滚动条 */ -ms-overflow-style: none; /* IE 10+隐藏滚动条 */ overflow-x: hidden; overflow-y: auto; width: 200px; background-color:#9e5; } .frame-side::-webkit-scrollbar { display: none; /* Chrome Safari 隐藏滚动条*/ } .frame-main { flex-grow: 1; background-color:#fff; } .jiaoluo{ margin: auto; margin-right: 0px; } .menu { display: none; position: absolute; background-color: #f9f9f9; border: 1px solid #ccc; padding: 10px; list-style-type: none; margin: 0; z-index: 10; } </style> </head> <body> <div class="frame-header"> <a class='frame-header-li' style="color:#fff">峤丞木材仓库管理</a> <a id="username" class='frame-header-li' style="color:#520">峤丞木材仓库管理</a> <!-- 菜单 --> <ul class="menu"> <li>选项 1</li> <li>选项 2</li> <li>选项 3</li> </ul> </div> <div class="frame-body"> <div class="frame-side"> <ul id="main_u" class='frame-ul' style="text-align:center;"> <li ><a href="main/test.html" target="main">首页</a></li> <li><a href="main/dingdan.html" target="main">订单查询</a></li> <li><a href="main/bancai.html" target="main">板材查询</a></li> <li><a href="main/Guanli.html" target="main">人员管理</a></li> <li><a href="main/test.html" target="main">test</a></li> <li><a href="main/tianjia.html" target="main">test</a></li> </ul> </div> <div class="frame-main"> <!-- 内容主体区域 --> <iframe id="iframeid" name="main" src="main/bancai.html" width="100%" height="100%" frameborder="0"> </iframe> </div> </div> </body> </html>
06-14
【完美复现】面向配电网韧性提升的移动储能预布局与动态调度策略【IEEE33节点】(Matlab代码实现)内容概要:本文介绍了基于IEEE33节点的配电网韧性提升方法,重点研究了移动储能系统的预布局与动态调度策略。通过Matlab代码实现,提出了一种结合预配置和动态调度的两阶段优化模型,旨在应对电网故障或极端事件时快速恢复供电能力。文中采用了多种智能优化算法(如PSO、MPSO、TACPSO、SOA、GA等)进行对比分析,验证所提策略的有效性和优越性。研究不仅关注移动储能单元的初始部署位置,还深入探讨其在故障发生后的动态路径规划与电力支援过程,从而全面提升配电网的韧性水平。; 适合人群:具备电力系统基础知识和Matlab编程能力的研究生、科研人员及从事智能电网、能源系统优化等相关领域的工程技术人员。; 使用场景及目标:①用于科研复现,特别是IEEE顶刊或SCI一区论文中关于配电网韧性、应急电源调度的研究;②支撑电力系统在灾害或故障条件下的恢复力优化设计,提升实际电网应对突发事件的能力;③为移动储能系统在智能配电网中的应用提供理论依据和技术支持。; 阅读建议:建议读者结合提供的Matlab代码逐模块分析,重点关注目标函数建模、约束条件设置以及智能算法的实现细节。同时推荐参考文中提及的MPS预配置与动态调度上下两部分,系统掌握完整的技术路线,并可通过替换不同算法或测试系统进一步拓展研究。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值