From dd85d52f4d46c44a1f3830622af454d087aa5821 Mon Sep 17 00:00:00 2001
From: wanggang <76527413@qq.com>
Date: Mon, 6 Jul 2020 15:05:10 +0800
Subject: [PATCH] update
Former-commit-id: fcf21ad1ac5698b6a8c7cb6892467ce26b97425f
Former-commit-id: cd703fb1341908c86dc15cdeea9bf913b5678d67
---
projects/WebMVC/libman.json | 18 ++++++----
projects/WebMVC/wwwroot/index.html | 4 ++-
projects/WebMVC/wwwroot/js/common.js | 1 +
projects/WebMVC/wwwroot/js/form.js | 1 +
.../lib/cronstrue/dist/cronstrue-i18n.min.js | 1 -
.../lib/cronstrue/dist/cronstrue.min.js | 1 -
.../jquery.tree-multiselect.min.css | 2 ++
.../jquery.tree-multiselect.min.js | 2 ++
.../lib/vuelidate/dist/vuelidate.min.js | 1 +
.../wwwroot/router/shared/edit/boolean.html | 4 ++-
.../router/shared/edit/multiselectlist.html | 35 +++++++++++++++++++
11 files changed, 60 insertions(+), 10 deletions(-)
delete mode 100644 projects/WebMVC/wwwroot/lib/cronstrue/dist/cronstrue-i18n.min.js
delete mode 100644 projects/WebMVC/wwwroot/lib/cronstrue/dist/cronstrue.min.js
create mode 100644 projects/WebMVC/wwwroot/lib/tree-multiselect/jquery.tree-multiselect.min.css
create mode 100644 projects/WebMVC/wwwroot/lib/tree-multiselect/jquery.tree-multiselect.min.js
create mode 100644 projects/WebMVC/wwwroot/lib/vuelidate/dist/vuelidate.min.js
create mode 100644 projects/WebMVC/wwwroot/router/shared/edit/multiselectlist.html
diff --git a/projects/WebMVC/libman.json b/projects/WebMVC/libman.json
index 988d589f..f244ac63 100644
--- a/projects/WebMVC/libman.json
+++ b/projects/WebMVC/libman.json
@@ -2,6 +2,12 @@
"version": "1.0",
"defaultProvider": "cdnjs",
"libraries": [
+ {
+ "provider": "filesystem",
+ "library": "../lib/local/tree-multiselect/dist",
+ "destination": "wwwroot/lib/tree-multiselect/",
+ "files": [ "jquery.tree-multiselect.min.css", "jquery.tree-multiselect.min.js" ]
+ },
{
"provider": "filesystem",
"library": "../lib/local/jqcron-master/src/",
@@ -47,6 +53,12 @@
"destination": "wwwroot/lib/vuex",
"files": [ "vuex.min.js" ]
},
+ {
+ "provider": "unpkg",
+ "library": "vuelidate@0.7.5",
+ "destination": "wwwroot/lib/vuelidate",
+ "files": [ "dist/vuelidate.min.js" ]
+ },
{
"library": "popper.js@2.4.2",
"destination": "wwwroot/lib/popper.js",
@@ -140,12 +152,6 @@
"library": "flv.js@1.5.0",
"destination": "wwwroot/lib/flv.js/",
"files": [ "flv.min.js" ]
- },
- {
- "provider": "unpkg",
- "library": "cronstrue@1.94.0",
- "destination": "wwwroot/lib/cronstrue",
- "files": [ "dist/cronstrue.min.js", "dist/cronstrue-i18n.min.js" ]
}
]
}
\ No newline at end of file
diff --git a/projects/WebMVC/wwwroot/index.html b/projects/WebMVC/wwwroot/index.html
index ebe9ce88..788c24b2 100644
--- a/projects/WebMVC/wwwroot/index.html
+++ b/projects/WebMVC/wwwroot/index.html
@@ -13,6 +13,7 @@
+
@@ -36,6 +37,7 @@
+
@@ -43,7 +45,7 @@
-
+
diff --git a/projects/WebMVC/wwwroot/js/common.js b/projects/WebMVC/wwwroot/js/common.js
index 99ebd645..e1af19d3 100644
--- a/projects/WebMVC/wwwroot/js/common.js
+++ b/projects/WebMVC/wwwroot/js/common.js
@@ -1,5 +1,6 @@
Vue.prototype.baseUrl = config.baseUrl;
Vue.prototype.isMobile = config.isMobile;
+Vue.use(window.vuelidate.default);
function vueComponent(name, url) {
Vue.component(name, function (resolve, reject) {
diff --git a/projects/WebMVC/wwwroot/js/form.js b/projects/WebMVC/wwwroot/js/form.js
index 5e69fbb7..b851114a 100644
--- a/projects/WebMVC/wwwroot/js/form.js
+++ b/projects/WebMVC/wwwroot/js/form.js
@@ -11,6 +11,7 @@
'edit-boolean',
'edit-integer',
'edit-selectlist',
+ 'edit-multiselectlist',
'edit-cron',
];
for (var i = 0; i < formComponents.length; i++) {
diff --git a/projects/WebMVC/wwwroot/lib/cronstrue/dist/cronstrue-i18n.min.js b/projects/WebMVC/wwwroot/lib/cronstrue/dist/cronstrue-i18n.min.js
deleted file mode 100644
index 0cbfb4c3..00000000
--- a/projects/WebMVC/wwwroot/lib/cronstrue/dist/cronstrue-i18n.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("cronstrue",[],e):"object"==typeof exports?exports.cronstrue=e():t.cronstrue=e()}("undefined"!=typeof self?self:this,function(){return o={},r.m=n=[function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var m=n(1),u=n(2),o=(y.toString=function(t,e){var n=void 0===e?{}:e,o=n.throwExceptionOnParseError,r=void 0===o||o,u=n.verbose,i=void 0!==u&&u,a=n.dayOfWeekStartIndexZero,p=void 0===a||a,s=n.use24HourTimeFormat,c=n.locale;return new y(t,{throwExceptionOnParseError:r,verbose:i,dayOfWeekStartIndexZero:p,use24HourTimeFormat:s,locale:void 0===c?"en":c}).getFullDescription()},y.initialize=function(t){y.specialCharacters=["/","-",",","*"],t.load(y.locales)},y.prototype.getFullDescription=function(){var e="";try{var t=new u.CronParser(this.expression,this.options.dayOfWeekStartIndexZero);this.expressionParts=t.parse();var n=this.getTimeOfDayDescription(),o=this.getDayOfMonthDescription(),r=this.getMonthDescription();e+=n+o+this.getDayOfWeekDescription()+r+this.getYearDescription(),e=(e=this.transformVerbosity(e,this.options.verbose)).charAt(0).toLocaleUpperCase()+e.substr(1)}catch(t){if(this.options.throwExceptionOnParseError)throw""+t;e=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD()}return e},y.prototype.getTimeOfDayDescription=function(){var t=this.expressionParts[0],e=this.expressionParts[1],n=this.expressionParts[2],o="";if(m.StringUtilities.containsAny(e,y.specialCharacters)||m.StringUtilities.containsAny(n,y.specialCharacters)||m.StringUtilities.containsAny(t,y.specialCharacters))if(t||!(-1div.selected,div.tree-multiselect>div.selections{display:inline-block;box-sizing:border-box;overflow:auto;padding:1%;vertical-align:top;width:50%}div.tree-multiselect>div.selections{border-right:solid 2px #D8D8D8}div.tree-multiselect>div.selections div.item{margin-left:16px}div.tree-multiselect>div.selections div.item label{cursor:pointer;display:inline}div.tree-multiselect>div.selections div.item label.disabled{color:#D8D8D8}div.tree-multiselect>div.selections *[searchhit=false]{display:none}div.tree-multiselect>div.selections.no-border{border-right:none}div.tree-multiselect>div.selected>div.item{background:#EAEAEA;border-radius:2px;padding:2px 5px;overflow:auto}div.tree-multiselect>div.selected.ui-sortable>div.item:hover{cursor:move}div.tree-multiselect div.section>div.section,div.tree-multiselect div.section>div.item{padding-left:20px}div.tree-multiselect div.section.collapsed>div.title span.collapse-section:after{content:"+"}div.tree-multiselect div.section.collapsed:not([searchhit])>.item,div.tree-multiselect div.section.collapsed:not([searchhit])>.section{display:none}div.tree-multiselect div.title,div.tree-multiselect div.item{margin-bottom:2px}div.tree-multiselect div.title{background:#777;color:white;padding:2px}div.tree-multiselect div.title>*{display:inline-block}div.tree-multiselect div.title>span.collapse-section{margin:0 3px;width:8px}div.tree-multiselect div.title>span.collapse-section:after{content:"-"}div.tree-multiselect div.title:hover{cursor:pointer}div.tree-multiselect input[type=checkbox]{display:inline;margin-right:5px}div.tree-multiselect input[type=checkbox]:not([disabled]):hover{cursor:pointer}div.tree-multiselect span.remove-selected,div.tree-multiselect span.description{background:#777;border-radius:2px;color:white;margin-right:5px;padding:0 3px}div.tree-multiselect span.remove-selected:hover{cursor:pointer}div.tree-multiselect span.description:hover{cursor:help}div.tree-multiselect div.temp-description-popup{background:#EAEAEA;border:2px solid #676767;border-radius:3px;padding:5px}div.tree-multiselect span.section-name{float:right;font-style:italic}div.tree-multiselect .auxiliary{display:table;width:100%}div.tree-multiselect .auxiliary input.search{border:2px solid #D8D8D8;display:table-cell;margin:0;padding:5px;width:100%}div.tree-multiselect .auxiliary .select-all-container{display:table-cell;text-align:right}div.tree-multiselect .auxiliary .select-all-container span.select-all,div.tree-multiselect .auxiliary .select-all-container span.unselect-all{margin-right:5px;padding-right:5px}div.tree-multiselect .auxiliary .select-all-container span.select-all:hover,div.tree-multiselect .auxiliary .select-all-container span.unselect-all:hover{cursor:pointer}div.tree-multiselect .auxiliary .select-all-container span.select-all{border-right:2px solid #D8D8D8}
diff --git a/projects/WebMVC/wwwroot/lib/tree-multiselect/jquery.tree-multiselect.min.js b/projects/WebMVC/wwwroot/lib/tree-multiselect/jquery.tree-multiselect.min.js
new file mode 100644
index 00000000..c94c7c2d
--- /dev/null
+++ b/projects/WebMVC/wwwroot/lib/tree-multiselect/jquery.tree-multiselect.min.js
@@ -0,0 +1,2 @@
+/* jQuery Tree Multiselect v2.6.1 | (c) Patrick Tsai | MIT Licensed */
+!function n(a,o,c){function l(t,e){if(!o[t]){if(!a[t]){var i="function"==typeof require&&require;if(!e&&i)return i(t,!0);if(d)return d(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var s=o[t]={exports:{}};a[t][0].call(s.exports,function(e){return l(a[t][1][e]||e)},s,s.exports,n,a,o,c)}return o[t].exports}for(var d="function"==typeof require&&require,e=0;e span.description",function(){var e=jQuery(this).parent(),t=e.attr("data-description"),i=document.createElement("div");i.className="temp-description-popup",i.innerHTML=t,i.style.position="absolute",e.append(i)}),this.$selectionContainer.on("mouseleave","div.item > span.description",function(){jQuery(this).parent().find("div.temp-description-popup").remove()})},a.prototype.handleSectionCheckboxMarkings=function(){var s=this;this.$selectionContainer.on("click","input.section[type=checkbox]",function(){var e,t,i=jQuery(this).closest("div.section").find("div.item").map(function(e,t){var i=C.getKey(t),r=s.astItems[i];if(!r.disabled&&!r.isNotSearchHit())return i}).get();this.checked?((e=s.keysToAdd).push.apply(e,b(i)),C.array.uniq(s.keysToAdd)):((t=s.keysToRemove).push.apply(t,b(i)),C.array.uniq(s.keysToRemove));s.render()})},a.prototype.redrawSectionCheckboxes=function(e){e=e||this.$selectionContainer;var t=3,i=this;if(e.find("> div.section").each(function(){var e=i.redrawSectionCheckboxes(jQuery(this));t&=e}),t)for(var r=e.find("> div.item > input[type=checkbox]"),s=0;s div.title > input[type=checkbox]");return n.length&&((n=n[0]).indeterminate=1&t?!(n.checked=!0):2&t?n.checked=!1:!(n.checked=!1)),t},a.prototype.addCollapsibility=function(){var e="div.title",t=this.$selectionContainer.find(e),i=C.dom.createNode("span",{class:"collapse-section"});t.prepend(i);var r=this.$selectionContainer.find("div.section");this.params.startCollapsed&&r.addClass("collapsed"),this.$selectionContainer.on("click",e,function(e){"INPUT"!==e.target.nodeName&&(jQuery(this).parent().toggleClass("collapsed"),e.stopPropagation())})},a.prototype.createSearchBar=function(e){var t=new r(n,this.astItems,this.astSections,this.params.searchParams),i=C.dom.createNode("input",{class:"search",placeholder:"Search..."});e.appendChild(i),this.$selectionContainer.on("input","input.search",function(){var e=this.value;t.search(e)})},a.prototype.createSelectAllButtons=function(e){var t=C.dom.createNode("span",{class:"select-all",text:this.params.selectAllText}),i=C.dom.createNode("span",{class:"unselect-all",text:this.params.unselectAllText}),r=C.dom.createNode("div",{class:"select-all-container"});r.appendChild(t),r.appendChild(i),e.appendChild(r);var s=this;this.$selectionContainer.on("click","span.select-all",function(){var e;(e=s.keysToAdd).push.apply(e,b(s.unfilteredNodeIds())),s.render()}),this.$selectionContainer.on("click","span.unselect-all",function(){var e;(e=s.keysToRemove).push.apply(e,b(s.unfilteredNodeIds())),s.render()})},a.prototype.unfilteredNodeIds=function(){var t=this;return Object.keys(t.astItems).filter(function(e){return!t.astItems[e].node.hasAttribute(n)||"true"===t.astItems[e].node.getAttribute(n)})},a.prototype.armRemoveSelectedOnClick=function(){var i=this;this.$selectedContainer.on("click","span.remove-selected",function(){var e=this.parentNode,t=C.getKey(e);i.keysToRemove.push(t),i.render()})},a.prototype.updateSelectedAndOnChange=function(){var i=this;if(this.$selectionContainer.on("click","input.option[type=checkbox]",function(){var e=this.parentNode,t=C.getKey(e);C.assert(t||0===t),this.checked?i.keysToAdd.push(t):i.keysToRemove.push(t),i.render()}),this.params.sortable&&!this.params.freeze){var r=null,s=null;this.$selectedContainer.sortable({start:function(e,t){r=t.item.index()},stop:function(e,t){s=t.item.index(),r!==s&&(C.array.moveEl(i.selectedKeys,r,s),i.render())}})}},a.prototype.render=function(e){var t,i=this;if(C.array.uniq(this.keysToAdd),C.array.uniq(this.keysToRemove),C.array.subtract(this.keysToAdd,this.selectedKeys),C.array.intersect(this.keysToRemove,this.selectedKeys),C.isInteger(this.params.maxSelections)&&0this.params.maxSelections){var s,n=r-this.params.maxSelections,a=[];n>this.selectedKeys.length?(a.push.apply(a,b(this.selectedKeys)),n-=this.selectedKeys.length,a.push.apply(a,b(this.keysToAdd.splice(0,n)))):a.push.apply(a,b(this.selectedKeys.slice(0,n))),(s=this.keysToRemove).push.apply(s,a)}}for(var o=0;o'),r=jQuery('');t&&r.addClass("no-border"),i.append(r);var s=jQuery('');t||i.append(s),this.$el=e,this.$treeContainer=i,this.$selectionContainer=r,this.$selectedContainer=s}r.prototype.attach=function(){this.$el.after(this.$treeContainer)},r.prototype.remove=function(){this.$treeContainer.remove()},t.exports=r},{}],10:[function(e,t,r){"use strict";function s(e,t){for(var i=0,r=0;ri[n]){s=!0;break}}if(s)break;for(var a=!0,o=1;op?l(e,h,m):h>m&&c(t,y,p)}(t,e):o(e)?l(e,0,e.length-1):o(t)&&c(t,0,t.length-1)}function d(t,e,r){return{tag:t,key:e,args:r}}function y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function h(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}r.r(e);var v=[],b=null;function m(){null!==b&&v.push(b),b={}}function g(){var t=b,e=b=v.pop()||null;return e&&(Array.isArray(e.$sub)||(e.$sub=[]),e.$sub.push(t)),t}function M(t){if("object"!==p(t)||Array.isArray(t))throw new Error("params must be an object");b=function(t){for(var e=1;e1?u:u.$sub[0]:null}}},computed:{run:function(){var t=this,e=this.lazyParentModel();if(Array.isArray(e)&&e.__ob__){var r=e.__ob__.dep;r.depend();var n=r.constructor.target;if(!this._indirectWatcher){var o=n.constructor;this._indirectWatcher=new o(this,(function(){return t.runRule(e)}),null,{lazy:!0})}var i=this.getModel();if(!this._indirectWatcher.dirty&&this._lastModel===i)return this._indirectWatcher.depend(),n.value;this._lastModel=i,this._indirectWatcher.evaluate(),this._indirectWatcher.depend()}else this._indirectWatcher&&(this._indirectWatcher.teardown(),this._indirectWatcher=null);return this._indirectWatcher?this._indirectWatcher.value:this.runRule(e)},$params:function(){return this.run.params},proxy:function(){var t=this.run.output;return t.__isVuelidateAsyncVm?!!t.v:!!t},$pending:function(){var t=this.run.output;return!!t.__isVuelidateAsyncVm&&t.p}},destroyed:function(){this._indirectWatcher&&(this._indirectWatcher.teardown(),this._indirectWatcher=null)}}),n=e.extend({data:function(){return{dirty:!1,validations:null,lazyModel:null,model:null,prop:null,lazyParentModel:null,rootModel:null}},methods:P({},E,{refProxy:function(t){return this.getRef(t).proxy},getRef:function(t){return this.refs[t]},isNested:function(t){return"function"!=typeof this.validations[t]}}),computed:P({},W,{nestedKeys:function(){return this.keys.filter(this.isNested)},ruleKeys:function(){var t=this;return this.keys.filter((function(e){return!t.isNested(e)}))},keys:function(){return Object.keys(this.validations).filter((function(t){return"$params"!==t}))},proxy:function(){var t=this,e=z(this.keys,(function(e){return{enumerable:!0,configurable:!0,get:function(){return t.refProxy(e)}}})),r=z(V,(function(e){return{enumerable:!0,configurable:!0,get:function(){return t[e]}}})),n=z(R,(function(e){return{enumerable:!1,configurable:!0,get:function(){return t[e]}}})),o=this.hasIter()?{$iter:{enumerable:!0,value:Object.defineProperties({},P({},e))}}:{};return Object.defineProperties({},P({},e,{},o,{$model:{enumerable:!0,get:function(){var e=t.lazyParentModel();return null!=e?e[t.prop]:null},set:function(e){var r=t.lazyParentModel();null!=r&&(r[t.prop]=e,t.$touch())}}},r,{},n))},children:function(){var t=this;return[].concat(j(this.nestedKeys.map((function(e){return u(t,e)}))),j(this.ruleKeys.map((function(e){return a(t,e)})))).filter(Boolean)}})}),o=n.extend({methods:{isNested:function(t){return void 0!==this.validations[t]()},getRef:function(t){var e=this;return{get proxy(){return e.validations[t]()||!1}}}}}),i=n.extend({computed:{keys:function(){var t=this.getModel();return S(t)?Object.keys(t):[]},tracker:function(){var t=this,e=this.validations.$trackBy;return e?function(r){return"".concat(K(t.rootModel,t.getModelKey(r),e))}:function(t){return"".concat(t)}},getModelLazy:function(){var t=this;return function(){return t.getModel()}},children:function(){var t=this,e=this.validations,r=this.getModel(),o=P({},e);delete o.$trackBy;var i={};return this.keys.map((function(e){var u=t.tracker(e);return i.hasOwnProperty(u)?null:(i[u]=!0,d(n,u,{validations:o,prop:e,lazyParentModel:t.getModelLazy,model:r[e],rootModel:t.rootModel}))})).filter(Boolean)}},methods:{isNested:function(){return!0},getRef:function(t){return this.refs[this.tracker(t)]},hasIter:function(){return!0}}}),u=function(t,e){if("$each"===e)return d(i,e,{validations:t.validations[e],lazyParentModel:t.lazyParentModel,prop:e,lazyModel:t.getModel,rootModel:t.rootModel});var r=t.validations[e];if(Array.isArray(r)){var u=t.rootModel,a=z(r,(function(t){return function(){return K(u,u.$v,t)}}),(function(t){return Array.isArray(t)?t.join("."):t}));return d(o,e,{validations:a,lazyParentModel:k,prop:e,lazyModel:k,rootModel:u})}return d(n,e,{validations:r,lazyParentModel:t.getModel,prop:e,lazyModel:t.getModelKey,rootModel:t.rootModel})},a=function(t,e){return d(r,e,{rule:t.validations[e],lazyParentModel:t.lazyParentModel,lazyModel:t.getModel,rootModel:t.rootModel})};return B={VBase:e,Validation:n}},I=null;var T=function(t,e){var r=function(t){if(I)return I;for(var e=t.constructor;e.super;)e=e.super;return I=e,e}(t),n=N(r),o=n.Validation;return new(0,n.VBase)({computed:{children:function(){var r="function"==typeof e?e.call(t):e;return[d(o,"$v",{validations:r,lazyParentModel:k,prop:"$v",model:t,rootModel:t})]}}})},C={data:function(){var t=this.$options.validations;return t&&(this._vuelidate=T(this,t)),{}},beforeCreate:function(){var t=this.$options;t.validations&&(t.computed||(t.computed={}),t.computed.$v||(t.computed.$v=function(){return this._vuelidate?this._vuelidate.refs.$v.proxy:null}))},beforeDestroy:function(){this._vuelidate&&(this._vuelidate.$destroy(),this._vuelidate=null)}};function L(t){t.mixin(C)}e.default=L}})}));
\ No newline at end of file
diff --git a/projects/WebMVC/wwwroot/router/shared/edit/boolean.html b/projects/WebMVC/wwwroot/router/shared/edit/boolean.html
index e3ef1f73..e674d663 100644
--- a/projects/WebMVC/wwwroot/router/shared/edit/boolean.html
+++ b/projects/WebMVC/wwwroot/router/shared/edit/boolean.html
@@ -1,5 +1,7 @@
-
+
+
+
\ No newline at end of file