初始化项目

This commit is contained in:
liaozetao
2023-11-09 10:23:48 +08:00
parent a0cc10e7e3
commit 4de97fa88d
407 changed files with 157371 additions and 0 deletions

4
.browserslistrc Normal file
View File

@@ -0,0 +1,4 @@
> 1%
last 2 versions
not dead
not ie 11

0
.env Normal file
View File

2
.env.development Normal file
View File

@@ -0,0 +1,2 @@
VUE_APP_API_BASE_URL='http://beta.admin.nnbc123.cn'
VUE_APP_DEBUG_MODE=true

2
.env.production Normal file
View File

@@ -0,0 +1,2 @@
VUE_APP_API_BASE_URL='http://admin.nnbc123.cn'
VUE_APP_DEBUG_MODE=false

21
.eslintrc.js Normal file
View File

@@ -0,0 +1,21 @@
module.exports = {
root: true,
env: {
node: true,
jquery: true
},
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended'
],
parserOptions: {
parser: '@babel/eslint-parser'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-unused-vars': 'off',
'no-useless-escape': 'off',
'no-control-regex': 'off',
}
}

23
.gitignore vendored Normal file
View File

@@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@@ -1 +1,24 @@
# yinmeng-admin-web
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

5
babel.config.js Normal file
View File

@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

19
jsconfig.json Normal file
View File

@@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"baseUrl": "./",
"moduleResolution": "node",
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
}
}

11366
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

41
package.json Normal file
View File

@@ -0,0 +1,41 @@
{
"name": "yinmeng-admin-web",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "vue-cli-service serve --mode development --report",
"build": "vue-cli-service build --mode production",
"lint": "vue-cli-service lint"
},
"dependencies": {
"admin-lte": "^2.3.2",
"axios": "^1.5.1",
"bootstrap": "^3.3.5",
"core-js": "^3.8.3",
"font-awesome": "^4.6.3",
"ionicons": "^2.0.1",
"jquery": "^2.2.0",
"jquery.md5": "^1.0.0",
"knockout": "^3.5.1",
"less": "^4.2.0",
"less-loader": "^11.1.3",
"popper.js": "^1.16.1",
"vue": "^3.2.13",
"vue-router": "^4.0.3",
"vuex": "^4.0.0"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-plugin-vuex": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3",
"sass": "^1.32.7",
"sass-loader": "^12.0.0",
"webpack-bundle-analyzer": "^4.9.1"
}
}

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

29
public/index.html Normal file
View File

@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<title>
<%= htmlWebpackPlugin.options.title %>
</title>
</head>
<body class="hold-transition skin-yellow-light sidebar-mini">
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

36
src/App.vue Normal file
View File

@@ -0,0 +1,36 @@
<template>
<div>
<router-view />
</div>
</template>
<script>
const debounce = (fn, delay) => {
let timer = null;
return function () {
let context = this;
let args = arguments;
clearTimeout(timer);
timer = setTimeout(function () {
fn.apply(context, args);
}, delay);
};
};
const _ResizeObserver = window.ResizeObserver;
window.ResizeObserver = class ResizeObserver extends _ResizeObserver {
constructor(callback) {
callback = debounce(callback, 16);
super(callback);
}
};
export default {
name: "app",
data() {
return {};
},
watch: {},
created() {},
methods: {},
computed: {},
};
</script>

8
src/api/common/menu.js Normal file
View File

@@ -0,0 +1,8 @@
import request from "@/utils/request";
export function getMenuAll() {
return request({
url: '/admin/menu/getall',
method: 'get'
});
}

15
src/api/common/user.js Normal file
View File

@@ -0,0 +1,15 @@
import request from "@/utils/request";
export function getUser(adminId) {
return request({
url: '/admin/user/getone?uid=' + adminId,
method: 'get'
});
}
export function logout() {
return request({
url: '/login/logout',
method: 'get'
});
}

View File

@@ -0,0 +1,8 @@
import request from "@/utils/request";
export function getSysConfList() {
return request({
url: '/admin/sysConf/getList',
method: 'get'
});
}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

BIN
src/assets/images/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
src/assets/images/woman.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@@ -0,0 +1,55 @@
@media (min-width: 768px) {
.form-search .combobox-container,
.form-inline .combobox-container {
display: inline-block;
margin-bottom: 0;
vertical-align: top;
}
.form-search .combobox-container .input-group-addon,
.form-inline .combobox-container .input-group-addon {
width: auto;
}
}
.combobox-selected .caret {
display: none;
}
/* :not doesn't work in IE8 */
.combobox-container:not(.combobox-selected) .glyphicon-remove {
display: none;
}
.typeahead-long {
max-height: 300px;
overflow-y: auto;
}
.control-group.error .combobox-container .add-on {
color: #B94A48;
border-color: #B94A48;
}
.control-group.error .combobox-container .caret {
border-top-color: #B94A48;
}
.control-group.warning .combobox-container .add-on {
color: #C09853;
border-color: #C09853;
}
.control-group.warning .combobox-container .caret {
border-top-color: #C09853;
}
.control-group.success .combobox-container .add-on {
color: #468847;
border-color: #468847;
}
.control-group.success .combobox-container .caret {
border-top-color: #468847;
}

View File

@@ -0,0 +1,62 @@
import $ from 'jquery';
import '@/assets/plugins/bootstrap-combobox/js/bootstrap-combobox';
export default {
getSelected: function (idstr) {
let value;
for (let i = 0, len = $(idstr + ' option').length; i < len; i++) {
let $option = $(idstr + ' option:eq(' + i + ')');
if ($option.prop('selected')) {
value = $option.val();
break;
}
}
return value;
},
// 设置默认值
setDef: function (idstr, defval) {
if (defval) {
for (let i = 0, len = $(idstr + ' option').length; i < len; i++) {
let $option = $(idstr + ' option:eq(' + i + ')');
if ($option.val() == defval) {
$option.prop('selected', true);
} else {
$option.prop('selected', false);
}
}
$(idstr).btComboBox('parse');
}
},
// 构建下拉组合框
build: function (val, idstr, defval) {
var _this = this;
if (val) {
if (Object.prototype.toString.call(val) === '[object Array]') {
$(idstr).empty();
$.each(val, function (n, obj) {
$(idstr).append("<option value='" + obj.value + "' data-value='" + obj.value + "'>" + obj.text + "</option>");
});
$(idstr).btComboBox();
_this.setDef(idstr, defval);
} else {
$.ajax({
type: 'post',
url: val,
dataType: 'json',
success: function (json) {
$(idstr).empty();
$.each(json, function (n, value) {
$(idstr).append("<option value='" + value.oval + "' data-value='" + value.oval + "'>" + value.otxt + "</option>");
});
$(idstr).btComboBox();
_this.setDef(idstr, defval);
}
});
}
} else {
$(idstr).btComboBox();
_this.setDef(idstr, defval);
}
}
}

View File

@@ -0,0 +1,493 @@
/* =============================================================
* bootstrap-combobox.js v1.1.8
* =============================================================
* Copyright 2012 Daniel Farrell
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================ */
/*!
* Bootstrap-select v1.10.0 (http://silviomoreto.github.io/bootstrap-select)
*
* Copyright 2013-2016 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
(function (root, factory) {
var define;
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module unless amdModuleId is set
define(["jquery"], function (a0) {
return (factory(a0));
});
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require("jquery"));
} else {
factory(jQuery);
}
}(this, function (jQuery) {
(function ($) {
"use strict";
/* COMBOBOX PUBLIC CLASS DEFINITION
* ================================ */
var Combobox = function (element, options) {
this.options = $.extend({}, $.fn.combobox.defaults, options);
this.template = this.options.template || this.template
this.$source = $(element);
this.$container = this.setup();
this.$element = this.$container.find('input[type=text]');
this.$target = this.$container.find('input[type=hidden]');
this.$button = this.$container.find('.dropdown-toggle');
this.$menu = $(this.options.menu).appendTo('body');
this.matcher = this.options.matcher || this.matcher;
this.sorter = this.options.sorter || this.sorter;
this.highlighter = this.options.highlighter || this.highlighter;
this.shown = false;
this.selected = false;
this.refresh();
this.transferAttributes();
this.listen();
};
Combobox.prototype = {
constructor: Combobox
, setup: function () {
var combobox = $(this.template());
this.$source.before(combobox);
this.$source.hide();
return combobox;
}
, disable: function () {
this.$element.prop('disabled', true);
this.$button.attr('disabled', true);
this.disabled = true;
this.$container.addClass('combobox-disabled');
}
, enable: function () {
this.$element.prop('disabled', false);
this.$button.attr('disabled', false);
this.disabled = false;
this.$container.removeClass('combobox-disabled');
}
, parse: function () {
var that = this
, map = {}
, source = []
, selected = false
, selectedValue = '';
this.$source.find('option').each(function () {
var option = $(this);
if (option.val() === '') {
that.options.placeholder = option.text();
return;
}
map[option.text()] = option.val();
source.push(option.text());
if (option.prop('selected')) {
selected = option.text();
selectedValue = option.val();
}
})
this.map = map;
if (selected) {
this.$element.val(selected);
this.$target.val(selectedValue);
this.$container.addClass('combobox-selected');
this.selected = true;
}
return source;
}
, transferAttributes: function () {
this.options.placeholder = this.$source.attr('data-placeholder') || this.options.placeholder
if (this.options.appendId !== undefined) {
this.$element.attr('id', this.$source.attr('id') + this.options.appendId);
}
this.$element.attr('placeholder', this.options.placeholder)
this.$target.prop('name', this.$source.prop('name'))
this.$target.val(this.$source.val())
this.$source.removeAttr('name') // Remove from source otherwise form will pass parameter twice.
this.$element.attr('required', this.$source.attr('required'))
this.$element.attr('rel', this.$source.attr('rel'))
this.$element.attr('title', this.$source.attr('title'))
this.$element.attr('class', this.$source.attr('class'))
this.$element.attr('tabindex', this.$source.attr('tabindex'))
this.$source.removeAttr('tabindex')
if (this.$source.attr('disabled') !== undefined)
this.disable();
}
, select: function () {
var val = this.$menu.find('.active').attr('data-value');
this.$element.val(this.updater(val)).trigger('change');
this.$target.val(this.map[val]).trigger('change');
this.$source.val(this.map[val]).trigger('change');
this.$container.addClass('combobox-selected');
this.selected = true;
return this.hide();
}
, updater: function (item) {
return item;
}
, show: function () {
var pos = $.extend({}, this.$element.position(), {
height: this.$element[0].offsetHeight
});
this.$menu
.insertAfter(this.$element)
.css({
top: pos.top + pos.height
, left: pos.left
})
.show();
$('.dropdown-menu').on('mousedown', $.proxy(this.scrollSafety, this));
this.shown = true;
return this;
}
, hide: function () {
this.$menu.hide();
$('.dropdown-menu').off('mousedown', $.proxy(this.scrollSafety, this));
this.$element.on('blur', $.proxy(this.blur, this));
this.shown = false;
return this;
}
, lookup: function (event) {
this.query = this.$element.val();
return this.process(this.source);
}
, process: function (items) {
var that = this;
items = $.grep(items, function (item) {
return that.matcher(item);
})
items = this.sorter(items);
if (!items.length) {
return this.shown ? this.hide() : this;
}
return this.render(items.slice(0, this.options.items)).show();
}
, template: function () {
if (this.options.bsVersion == '2') {
return '<div class="combobox-container"><input type="hidden" /> <div class="input-append"> <input type="text" autocomplete="off" /> <span class="add-on dropdown-toggle" data-dropdown="dropdown"> <span class="caret"/> <i class="icon-remove"/> </span> </div> </div>'
} else {
return '<div class="combobox-container"> <input type="hidden" /> <div class="input-group"> <input type="text" autocomplete="off" /> <span class="input-group-addon dropdown-toggle" data-dropdown="dropdown"> <span class="caret" /> <span class="glyphicon glyphicon-remove" /> </span> </div> </div>'
}
}
, matcher: function (item) {
return ~item.toLowerCase().indexOf(this.query.toLowerCase());
}
, sorter: function (items) {
var beginswith = []
, caseSensitive = []
, caseInsensitive = []
, item;
item = items.shift();
while (item) {
if (!item.toLowerCase().indexOf(this.query.toLowerCase())) { beginswith.push(item); }
else if (~item.indexOf(this.query)) { caseSensitive.push(item); }
else { caseInsensitive.push(item); }
item = items.shift();
}
return beginswith.concat(caseSensitive, caseInsensitive);
}
, highlighter: function (item) {
var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&');
return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
return '<strong>' + match + '</strong>';
})
}
, render: function (items) {
var that = this;
items = $(items).map(function (i, item) {
i = $(that.options.item).attr('data-value', item);
i.find('a').html(that.highlighter(item));
return i[0];
})
items.first().addClass('active');
this.$menu.html(items);
return this;
}
, next: function (event) {
var active = this.$menu.find('.active').removeClass('active')
, next = active.next();
if (!next.length) {
next = $(this.$menu.find('li')[0]);
}
next.addClass('active');
}
, prev: function (event) {
var active = this.$menu.find('.active').removeClass('active')
, prev = active.prev();
if (!prev.length) {
prev = this.$menu.find('li').last();
}
prev.addClass('active');
}
, toggle: function () {
if (!this.disabled) {
if (this.$container.hasClass('combobox-selected')) {
this.clearTarget();
this.triggerChange();
this.clearElement();
} else {
if (this.shown) {
this.hide();
} else {
this.clearElement();
this.lookup();
}
}
}
}
, scrollSafety: function (e) {
if (e.target.tagName == 'UL') {
this.$element.off('blur');
}
}
, clearElement: function () {
this.$element.val('').focus();
}
, clearTarget: function () {
this.$source.val('');
this.$target.val('');
this.$container.removeClass('combobox-selected');
this.selected = false;
}
, triggerChange: function () {
this.$source.trigger('change');
}
, refresh: function () {
this.source = this.parse();
this.options.items = this.source.length;
}
, listen: function () {
this.$element
.on('focus', $.proxy(this.focus, this))
.on('blur', $.proxy(this.blur, this))
.on('keypress', $.proxy(this.keypress, this))
.on('keyup', $.proxy(this.keyup, this));
if (this.eventSupported('keydown')) {
this.$element.on('keydown', $.proxy(this.keydown, this));
}
this.$menu
.on('click', $.proxy(this.click, this))
.on('mouseenter', 'li', $.proxy(this.mouseenter, this))
.on('mouseleave', 'li', $.proxy(this.mouseleave, this));
this.$button
.on('click', $.proxy(this.toggle, this));
}
, eventSupported: function (eventName) {
var isSupported = eventName in this.$element;
if (!isSupported) {
this.$element.setAttribute(eventName, 'return;');
isSupported = typeof this.$element[eventName] === 'function';
}
return isSupported;
}
, move: function (e) {
if (!this.shown) { return; }
switch (e.keyCode) {
case 9: // tab
case 13: // enter
case 27: // escape
e.preventDefault();
break;
case 38: // up arrow
e.preventDefault();
this.prev();
this.fixMenuScroll();
break;
case 40: // down arrow
e.preventDefault();
this.next();
this.fixMenuScroll();
break;
}
e.stopPropagation();
}
, fixMenuScroll: function () {
var active = this.$menu.find('.active');
if (active.length) {
var top = active.position().top;
var bottom = top + active.height();
var scrollTop = this.$menu.scrollTop();
var menuHeight = this.$menu.height();
if (bottom > menuHeight) {
this.$menu.scrollTop(scrollTop + bottom - menuHeight);
} else if (top < 0) {
this.$menu.scrollTop(scrollTop + top);
}
}
}
, keydown: function (e) {
this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40, 38, 9, 13, 27]);
this.move(e);
}
, keypress: function (e) {
if (this.suppressKeyPressRepeat) { return; }
this.move(e);
}
, keyup: function (e) {
switch (e.keyCode) {
case 40: // down arrow
if (!this.shown) {
this.toggle();
}
break;
case 39: // right arrow
case 38: // up arrow
case 37: // left arrow
case 36: // home
case 35: // end
case 16: // shift
case 17: // ctrl
case 18: // alt
break;
case 9: // tab
case 13: // enter
if (!this.shown) { return; }
this.select();
break;
case 27: // escape
if (!this.shown) { return; }
this.hide();
break;
default:
this.clearTarget();
this.lookup();
}
e.stopPropagation();
e.preventDefault();
}
, focus: function (e) {
this.focused = true;
}
, blur: function (e) {
var that = this;
this.focused = false;
var val = this.$element.val();
if (!this.selected && val !== '') {
this.$element.val('');
this.$source.val('').trigger('change');
this.$target.val('').trigger('change');
}
if (!this.mousedover && this.shown) { setTimeout(function () { that.hide(); }, 200); }
}
, click: function (e) {
e.stopPropagation();
e.preventDefault();
this.select();
this.$element.focus();
}
, mouseenter: function (e) {
this.mousedover = true;
this.$menu.find('.active').removeClass('active');
$(e.currentTarget).addClass('active');
}
, mouseleave: function (e) {
this.mousedover = false;
}
};
/* COMBOBOX PLUGIN DEFINITION
* =========================== */
$.fn.combobox = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('combobox')
, options = typeof option == 'object' && option;
if (!data) { $this.data('combobox', (data = new Combobox(this, options))); }
if (typeof option == 'string') { data[option](); }
});
};
$.fn.combobox.defaults = {
bsVersion: '4'
, menu: '<ul class="typeahead typeahead-long dropdown-menu"></ul>'
, item: '<li><a href="#" class="dropdown-item"></a></li>'
};
$.fn.combobox.Constructor = Combobox;
$.fn.btComboBox = $.fn.combobox;
$.fn.btComboBox.defaults = $.fn.combobox.defaults;
$.fn.btComboBox.Constructor = Combobox;
}(jQuery));
}));

View File

@@ -0,0 +1,853 @@
/*!
* Datepicker for Bootstrap
*
* Copyright 2012 Stefan Petre
* Improvements by Andrew Rowls
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
*/
.datepicker {
padding: 4px;
border-radius: 4px;
direction: ltr;
/*.dow {
border-top: 1px solid #ddd !important;
}*/
}
.datepicker-inline {
width: 100%;
}
.datepicker.datepicker-rtl {
direction: rtl;
}
.datepicker.datepicker-rtl table tr td span {
float: right;
}
.datepicker-dropdown {
top: 0;
left: 0;
}
.datepicker-dropdown:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 7px solid #ccc;
border-top: 0;
border-bottom-color: rgba(0, 0, 0, 0.2);
position: absolute;
}
.datepicker-dropdown:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #fff;
border-top: 0;
position: absolute;
}
.datepicker-dropdown.datepicker-orient-left:before {
left: 6px;
}
.datepicker-dropdown.datepicker-orient-left:after {
left: 7px;
}
.datepicker-dropdown.datepicker-orient-right:before {
right: 6px;
}
.datepicker-dropdown.datepicker-orient-right:after {
right: 7px;
}
.datepicker-dropdown.datepicker-orient-top:before {
top: -7px;
}
.datepicker-dropdown.datepicker-orient-top:after {
top: -6px;
}
.datepicker-dropdown.datepicker-orient-bottom:before {
bottom: -7px;
border-bottom: 0;
border-top: 7px solid #999;
}
.datepicker-dropdown.datepicker-orient-bottom:after {
bottom: -6px;
border-bottom: 0;
border-top: 6px solid #fff;
}
.datepicker>div {
display: none;
}
.datepicker.days div.datepicker-days {
display: block;
}
.datepicker.months div.datepicker-months {
display: block;
}
.datepicker.years div.datepicker-years {
display: block;
}
.datepicker table {
margin: 0;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.datepicker table tr td,
.datepicker table tr th {
text-align: center;
width: 30px;
height: 30px;
border-radius: 4px;
border: none;
}
.table-striped .datepicker table tr td,
.table-striped .datepicker table tr th {
background-color: transparent;
}
.datepicker table tr td.day:hover,
.datepicker table tr td.day.focused {
background: rgba(0, 0, 0, 0.2);
cursor: pointer;
}
.datepicker table tr td.old,
.datepicker table tr td.new {
color: #777;
}
.datepicker table tr td.disabled,
.datepicker table tr td.disabled:hover {
background: none;
color: #444;
cursor: default;
}
.datepicker table tr td.today,
.datepicker table tr td.today:hover,
.datepicker table tr td.today.disabled,
.datepicker table tr td.today.disabled:hover {
color: #000000;
background: rgba(0, 0, 0, 0.2);
border-color: #ffb733;
}
.datepicker table tr td.today:hover,
.datepicker table tr td.today:hover:hover,
.datepicker table tr td.today.disabled:hover,
.datepicker table tr td.today.disabled:hover:hover,
.datepicker table tr td.today:focus,
.datepicker table tr td.today:hover:focus,
.datepicker table tr td.today.disabled:focus,
.datepicker table tr td.today.disabled:hover:focus,
.datepicker table tr td.today:active,
.datepicker table tr td.today:hover:active,
.datepicker table tr td.today.disabled:active,
.datepicker table tr td.today.disabled:hover:active,
.datepicker table tr td.today.active,
.datepicker table tr td.today:hover.active,
.datepicker table tr td.today.disabled.active,
.datepicker table tr td.today.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.today,
.open .dropdown-toggle.datepicker table tr td.today:hover,
.open .dropdown-toggle.datepicker table tr td.today.disabled,
.open .dropdown-toggle.datepicker table tr td.today.disabled:hover {
color: #000000;
background: rgba(0, 0, 0, 0.2);
border-color: #f59e00;
}
.datepicker table tr td.today:active,
.datepicker table tr td.today:hover:active,
.datepicker table tr td.today.disabled:active,
.datepicker table tr td.today.disabled:hover:active,
.datepicker table tr td.today.active,
.datepicker table tr td.today:hover.active,
.datepicker table tr td.today.disabled.active,
.datepicker table tr td.today.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.today,
.open .dropdown-toggle.datepicker table tr td.today:hover,
.open .dropdown-toggle.datepicker table tr td.today.disabled,
.open .dropdown-toggle.datepicker table tr td.today.disabled:hover {
background-image: none;
}
.datepicker table tr td.today.disabled,
.datepicker table tr td.today:hover.disabled,
.datepicker table tr td.today.disabled.disabled,
.datepicker table tr td.today.disabled:hover.disabled,
.datepicker table tr td.today[disabled],
.datepicker table tr td.today:hover[disabled],
.datepicker table tr td.today.disabled[disabled],
.datepicker table tr td.today.disabled:hover[disabled],
fieldset[disabled] .datepicker table tr td.today,
fieldset[disabled] .datepicker table tr td.today:hover,
fieldset[disabled] .datepicker table tr td.today.disabled,
fieldset[disabled] .datepicker table tr td.today.disabled:hover,
.datepicker table tr td.today.disabled:hover,
.datepicker table tr td.today:hover.disabled:hover,
.datepicker table tr td.today.disabled.disabled:hover,
.datepicker table tr td.today.disabled:hover.disabled:hover,
.datepicker table tr td.today[disabled]:hover,
.datepicker table tr td.today:hover[disabled]:hover,
.datepicker table tr td.today.disabled[disabled]:hover,
.datepicker table tr td.today.disabled:hover[disabled]:hover,
fieldset[disabled] .datepicker table tr td.today:hover,
fieldset[disabled] .datepicker table tr td.today:hover:hover,
fieldset[disabled] .datepicker table tr td.today.disabled:hover,
fieldset[disabled] .datepicker table tr td.today.disabled:hover:hover,
.datepicker table tr td.today.disabled:focus,
.datepicker table tr td.today:hover.disabled:focus,
.datepicker table tr td.today.disabled.disabled:focus,
.datepicker table tr td.today.disabled:hover.disabled:focus,
.datepicker table tr td.today[disabled]:focus,
.datepicker table tr td.today:hover[disabled]:focus,
.datepicker table tr td.today.disabled[disabled]:focus,
.datepicker table tr td.today.disabled:hover[disabled]:focus,
fieldset[disabled] .datepicker table tr td.today:focus,
fieldset[disabled] .datepicker table tr td.today:hover:focus,
fieldset[disabled] .datepicker table tr td.today.disabled:focus,
fieldset[disabled] .datepicker table tr td.today.disabled:hover:focus,
.datepicker table tr td.today.disabled:active,
.datepicker table tr td.today:hover.disabled:active,
.datepicker table tr td.today.disabled.disabled:active,
.datepicker table tr td.today.disabled:hover.disabled:active,
.datepicker table tr td.today[disabled]:active,
.datepicker table tr td.today:hover[disabled]:active,
.datepicker table tr td.today.disabled[disabled]:active,
.datepicker table tr td.today.disabled:hover[disabled]:active,
fieldset[disabled] .datepicker table tr td.today:active,
fieldset[disabled] .datepicker table tr td.today:hover:active,
fieldset[disabled] .datepicker table tr td.today.disabled:active,
fieldset[disabled] .datepicker table tr td.today.disabled:hover:active,
.datepicker table tr td.today.disabled.active,
.datepicker table tr td.today:hover.disabled.active,
.datepicker table tr td.today.disabled.disabled.active,
.datepicker table tr td.today.disabled:hover.disabled.active,
.datepicker table tr td.today[disabled].active,
.datepicker table tr td.today:hover[disabled].active,
.datepicker table tr td.today.disabled[disabled].active,
.datepicker table tr td.today.disabled:hover[disabled].active,
fieldset[disabled] .datepicker table tr td.today.active,
fieldset[disabled] .datepicker table tr td.today:hover.active,
fieldset[disabled] .datepicker table tr td.today.disabled.active,
fieldset[disabled] .datepicker table tr td.today.disabled:hover.active {
background: rgba(0, 0, 0, 0.2);
border-color: #ffb733;
}
.datepicker table tr td.today:hover:hover {
color: #000;
}
.datepicker table tr td.today.active:hover {
color: #fff;
}
.datepicker table tr td.range,
.datepicker table tr td.range:hover,
.datepicker table tr td.range.disabled,
.datepicker table tr td.range.disabled:hover {
background: rgba(0, 0, 0, 0.2);
border-radius: 0;
}
.datepicker table tr td.range.today,
.datepicker table tr td.range.today:hover,
.datepicker table tr td.range.today.disabled,
.datepicker table tr td.range.today.disabled:hover {
color: #000000;
background: rgba(0, 0, 0, 0.2);
border-color: #f1a417;
border-radius: 0;
}
.datepicker table tr td.range.today:hover,
.datepicker table tr td.range.today:hover:hover,
.datepicker table tr td.range.today.disabled:hover,
.datepicker table tr td.range.today.disabled:hover:hover,
.datepicker table tr td.range.today:focus,
.datepicker table tr td.range.today:hover:focus,
.datepicker table tr td.range.today.disabled:focus,
.datepicker table tr td.range.today.disabled:hover:focus,
.datepicker table tr td.range.today:active,
.datepicker table tr td.range.today:hover:active,
.datepicker table tr td.range.today.disabled:active,
.datepicker table tr td.range.today.disabled:hover:active,
.datepicker table tr td.range.today.active,
.datepicker table tr td.range.today:hover.active,
.datepicker table tr td.range.today.disabled.active,
.datepicker table tr td.range.today.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.range.today,
.open .dropdown-toggle.datepicker table tr td.range.today:hover,
.open .dropdown-toggle.datepicker table tr td.range.today.disabled,
.open .dropdown-toggle.datepicker table tr td.range.today.disabled:hover {
color: #000000;
background: rgba(0, 0, 0, 0.2);
border-color: #bf800c;
}
.datepicker table tr td.range.today:active,
.datepicker table tr td.range.today:hover:active,
.datepicker table tr td.range.today.disabled:active,
.datepicker table tr td.range.today.disabled:hover:active,
.datepicker table tr td.range.today.active,
.datepicker table tr td.range.today:hover.active,
.datepicker table tr td.range.today.disabled.active,
.datepicker table tr td.range.today.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.range.today,
.open .dropdown-toggle.datepicker table tr td.range.today:hover,
.open .dropdown-toggle.datepicker table tr td.range.today.disabled,
.open .dropdown-toggle.datepicker table tr td.range.today.disabled:hover {
background-image: none;
}
.datepicker table tr td.range.today.disabled,
.datepicker table tr td.range.today:hover.disabled,
.datepicker table tr td.range.today.disabled.disabled,
.datepicker table tr td.range.today.disabled:hover.disabled,
.datepicker table tr td.range.today[disabled],
.datepicker table tr td.range.today:hover[disabled],
.datepicker table tr td.range.today.disabled[disabled],
.datepicker table tr td.range.today.disabled:hover[disabled],
fieldset[disabled] .datepicker table tr td.range.today,
fieldset[disabled] .datepicker table tr td.range.today:hover,
fieldset[disabled] .datepicker table tr td.range.today.disabled,
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover,
.datepicker table tr td.range.today.disabled:hover,
.datepicker table tr td.range.today:hover.disabled:hover,
.datepicker table tr td.range.today.disabled.disabled:hover,
.datepicker table tr td.range.today.disabled:hover.disabled:hover,
.datepicker table tr td.range.today[disabled]:hover,
.datepicker table tr td.range.today:hover[disabled]:hover,
.datepicker table tr td.range.today.disabled[disabled]:hover,
.datepicker table tr td.range.today.disabled:hover[disabled]:hover,
fieldset[disabled] .datepicker table tr td.range.today:hover,
fieldset[disabled] .datepicker table tr td.range.today:hover:hover,
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover,
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover:hover,
.datepicker table tr td.range.today.disabled:focus,
.datepicker table tr td.range.today:hover.disabled:focus,
.datepicker table tr td.range.today.disabled.disabled:focus,
.datepicker table tr td.range.today.disabled:hover.disabled:focus,
.datepicker table tr td.range.today[disabled]:focus,
.datepicker table tr td.range.today:hover[disabled]:focus,
.datepicker table tr td.range.today.disabled[disabled]:focus,
.datepicker table tr td.range.today.disabled:hover[disabled]:focus,
fieldset[disabled] .datepicker table tr td.range.today:focus,
fieldset[disabled] .datepicker table tr td.range.today:hover:focus,
fieldset[disabled] .datepicker table tr td.range.today.disabled:focus,
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover:focus,
.datepicker table tr td.range.today.disabled:active,
.datepicker table tr td.range.today:hover.disabled:active,
.datepicker table tr td.range.today.disabled.disabled:active,
.datepicker table tr td.range.today.disabled:hover.disabled:active,
.datepicker table tr td.range.today[disabled]:active,
.datepicker table tr td.range.today:hover[disabled]:active,
.datepicker table tr td.range.today.disabled[disabled]:active,
.datepicker table tr td.range.today.disabled:hover[disabled]:active,
fieldset[disabled] .datepicker table tr td.range.today:active,
fieldset[disabled] .datepicker table tr td.range.today:hover:active,
fieldset[disabled] .datepicker table tr td.range.today.disabled:active,
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover:active,
.datepicker table tr td.range.today.disabled.active,
.datepicker table tr td.range.today:hover.disabled.active,
.datepicker table tr td.range.today.disabled.disabled.active,
.datepicker table tr td.range.today.disabled:hover.disabled.active,
.datepicker table tr td.range.today[disabled].active,
.datepicker table tr td.range.today:hover[disabled].active,
.datepicker table tr td.range.today.disabled[disabled].active,
.datepicker table tr td.range.today.disabled:hover[disabled].active,
fieldset[disabled] .datepicker table tr td.range.today.active,
fieldset[disabled] .datepicker table tr td.range.today:hover.active,
fieldset[disabled] .datepicker table tr td.range.today.disabled.active,
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover.active {
background: rgba(0, 0, 0, 0.2);
border-color: #f1a417;
}
.datepicker table tr td.selected,
.datepicker table tr td.selected:hover,
.datepicker table tr td.selected.disabled,
.datepicker table tr td.selected.disabled:hover {
color: #ffffff;
background: rgba(0, 0, 0, 0.2);
border-color: #555555;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.datepicker table tr td.selected:hover,
.datepicker table tr td.selected:hover:hover,
.datepicker table tr td.selected.disabled:hover,
.datepicker table tr td.selected.disabled:hover:hover,
.datepicker table tr td.selected:focus,
.datepicker table tr td.selected:hover:focus,
.datepicker table tr td.selected.disabled:focus,
.datepicker table tr td.selected.disabled:hover:focus,
.datepicker table tr td.selected:active,
.datepicker table tr td.selected:hover:active,
.datepicker table tr td.selected.disabled:active,
.datepicker table tr td.selected.disabled:hover:active,
.datepicker table tr td.selected.active,
.datepicker table tr td.selected:hover.active,
.datepicker table tr td.selected.disabled.active,
.datepicker table tr td.selected.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.selected,
.open .dropdown-toggle.datepicker table tr td.selected:hover,
.open .dropdown-toggle.datepicker table tr td.selected.disabled,
.open .dropdown-toggle.datepicker table tr td.selected.disabled:hover {
color: #ffffff;
background: rgba(0, 0, 0, 0.2);
border-color: #373737;
}
.datepicker table tr td.selected:active,
.datepicker table tr td.selected:hover:active,
.datepicker table tr td.selected.disabled:active,
.datepicker table tr td.selected.disabled:hover:active,
.datepicker table tr td.selected.active,
.datepicker table tr td.selected:hover.active,
.datepicker table tr td.selected.disabled.active,
.datepicker table tr td.selected.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.selected,
.open .dropdown-toggle.datepicker table tr td.selected:hover,
.open .dropdown-toggle.datepicker table tr td.selected.disabled,
.open .dropdown-toggle.datepicker table tr td.selected.disabled:hover {
background-image: none;
}
.datepicker table tr td.selected.disabled,
.datepicker table tr td.selected:hover.disabled,
.datepicker table tr td.selected.disabled.disabled,
.datepicker table tr td.selected.disabled:hover.disabled,
.datepicker table tr td.selected[disabled],
.datepicker table tr td.selected:hover[disabled],
.datepicker table tr td.selected.disabled[disabled],
.datepicker table tr td.selected.disabled:hover[disabled],
fieldset[disabled] .datepicker table tr td.selected,
fieldset[disabled] .datepicker table tr td.selected:hover,
fieldset[disabled] .datepicker table tr td.selected.disabled,
fieldset[disabled] .datepicker table tr td.selected.disabled:hover,
.datepicker table tr td.selected.disabled:hover,
.datepicker table tr td.selected:hover.disabled:hover,
.datepicker table tr td.selected.disabled.disabled:hover,
.datepicker table tr td.selected.disabled:hover.disabled:hover,
.datepicker table tr td.selected[disabled]:hover,
.datepicker table tr td.selected:hover[disabled]:hover,
.datepicker table tr td.selected.disabled[disabled]:hover,
.datepicker table tr td.selected.disabled:hover[disabled]:hover,
fieldset[disabled] .datepicker table tr td.selected:hover,
fieldset[disabled] .datepicker table tr td.selected:hover:hover,
fieldset[disabled] .datepicker table tr td.selected.disabled:hover,
fieldset[disabled] .datepicker table tr td.selected.disabled:hover:hover,
.datepicker table tr td.selected.disabled:focus,
.datepicker table tr td.selected:hover.disabled:focus,
.datepicker table tr td.selected.disabled.disabled:focus,
.datepicker table tr td.selected.disabled:hover.disabled:focus,
.datepicker table tr td.selected[disabled]:focus,
.datepicker table tr td.selected:hover[disabled]:focus,
.datepicker table tr td.selected.disabled[disabled]:focus,
.datepicker table tr td.selected.disabled:hover[disabled]:focus,
fieldset[disabled] .datepicker table tr td.selected:focus,
fieldset[disabled] .datepicker table tr td.selected:hover:focus,
fieldset[disabled] .datepicker table tr td.selected.disabled:focus,
fieldset[disabled] .datepicker table tr td.selected.disabled:hover:focus,
.datepicker table tr td.selected.disabled:active,
.datepicker table tr td.selected:hover.disabled:active,
.datepicker table tr td.selected.disabled.disabled:active,
.datepicker table tr td.selected.disabled:hover.disabled:active,
.datepicker table tr td.selected[disabled]:active,
.datepicker table tr td.selected:hover[disabled]:active,
.datepicker table tr td.selected.disabled[disabled]:active,
.datepicker table tr td.selected.disabled:hover[disabled]:active,
fieldset[disabled] .datepicker table tr td.selected:active,
fieldset[disabled] .datepicker table tr td.selected:hover:active,
fieldset[disabled] .datepicker table tr td.selected.disabled:active,
fieldset[disabled] .datepicker table tr td.selected.disabled:hover:active,
.datepicker table tr td.selected.disabled.active,
.datepicker table tr td.selected:hover.disabled.active,
.datepicker table tr td.selected.disabled.disabled.active,
.datepicker table tr td.selected.disabled:hover.disabled.active,
.datepicker table tr td.selected[disabled].active,
.datepicker table tr td.selected:hover[disabled].active,
.datepicker table tr td.selected.disabled[disabled].active,
.datepicker table tr td.selected.disabled:hover[disabled].active,
fieldset[disabled] .datepicker table tr td.selected.active,
fieldset[disabled] .datepicker table tr td.selected:hover.active,
fieldset[disabled] .datepicker table tr td.selected.disabled.active,
fieldset[disabled] .datepicker table tr td.selected.disabled:hover.active {
background: rgba(0, 0, 0, 0.2);
border-color: #555555;
}
.datepicker table tr td.active,
.datepicker table tr td.active:hover,
.datepicker table tr td.active.disabled,
.datepicker table tr td.active.disabled:hover {
color: #ffffff;
background: rgba(0, 0, 0, 0.2);
border-color: #357ebd;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.datepicker table tr td.active:hover,
.datepicker table tr td.active:hover:hover,
.datepicker table tr td.active.disabled:hover,
.datepicker table tr td.active.disabled:hover:hover,
.datepicker table tr td.active:focus,
.datepicker table tr td.active:hover:focus,
.datepicker table tr td.active.disabled:focus,
.datepicker table tr td.active.disabled:hover:focus,
.datepicker table tr td.active:active,
.datepicker table tr td.active:hover:active,
.datepicker table tr td.active.disabled:active,
.datepicker table tr td.active.disabled:hover:active,
.datepicker table tr td.active.active,
.datepicker table tr td.active:hover.active,
.datepicker table tr td.active.disabled.active,
.datepicker table tr td.active.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.active,
.open .dropdown-toggle.datepicker table tr td.active:hover,
.open .dropdown-toggle.datepicker table tr td.active.disabled,
.open .dropdown-toggle.datepicker table tr td.active.disabled:hover {
color: #ffffff;
background: rgba(0, 0, 0, 0.5);
border-color: #285e8e;
}
.datepicker table tr td.active:active,
.datepicker table tr td.active:hover:active,
.datepicker table tr td.active.disabled:active,
.datepicker table tr td.active.disabled:hover:active,
.datepicker table tr td.active.active,
.datepicker table tr td.active:hover.active,
.datepicker table tr td.active.disabled.active,
.datepicker table tr td.active.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.active,
.open .dropdown-toggle.datepicker table tr td.active:hover,
.open .dropdown-toggle.datepicker table tr td.active.disabled,
.open .dropdown-toggle.datepicker table tr td.active.disabled:hover {
background-image: none;
}
.datepicker table tr td.active.disabled,
.datepicker table tr td.active:hover.disabled,
.datepicker table tr td.active.disabled.disabled,
.datepicker table tr td.active.disabled:hover.disabled,
.datepicker table tr td.active[disabled],
.datepicker table tr td.active:hover[disabled],
.datepicker table tr td.active.disabled[disabled],
.datepicker table tr td.active.disabled:hover[disabled],
fieldset[disabled] .datepicker table tr td.active,
fieldset[disabled] .datepicker table tr td.active:hover,
fieldset[disabled] .datepicker table tr td.active.disabled,
fieldset[disabled] .datepicker table tr td.active.disabled:hover,
.datepicker table tr td.active.disabled:hover,
.datepicker table tr td.active:hover.disabled:hover,
.datepicker table tr td.active.disabled.disabled:hover,
.datepicker table tr td.active.disabled:hover.disabled:hover,
.datepicker table tr td.active[disabled]:hover,
.datepicker table tr td.active:hover[disabled]:hover,
.datepicker table tr td.active.disabled[disabled]:hover,
.datepicker table tr td.active.disabled:hover[disabled]:hover,
fieldset[disabled] .datepicker table tr td.active:hover,
fieldset[disabled] .datepicker table tr td.active:hover:hover,
fieldset[disabled] .datepicker table tr td.active.disabled:hover,
fieldset[disabled] .datepicker table tr td.active.disabled:hover:hover,
.datepicker table tr td.active.disabled:focus,
.datepicker table tr td.active:hover.disabled:focus,
.datepicker table tr td.active.disabled.disabled:focus,
.datepicker table tr td.active.disabled:hover.disabled:focus,
.datepicker table tr td.active[disabled]:focus,
.datepicker table tr td.active:hover[disabled]:focus,
.datepicker table tr td.active.disabled[disabled]:focus,
.datepicker table tr td.active.disabled:hover[disabled]:focus,
fieldset[disabled] .datepicker table tr td.active:focus,
fieldset[disabled] .datepicker table tr td.active:hover:focus,
fieldset[disabled] .datepicker table tr td.active.disabled:focus,
fieldset[disabled] .datepicker table tr td.active.disabled:hover:focus,
.datepicker table tr td.active.disabled:active,
.datepicker table tr td.active:hover.disabled:active,
.datepicker table tr td.active.disabled.disabled:active,
.datepicker table tr td.active.disabled:hover.disabled:active,
.datepicker table tr td.active[disabled]:active,
.datepicker table tr td.active:hover[disabled]:active,
.datepicker table tr td.active.disabled[disabled]:active,
.datepicker table tr td.active.disabled:hover[disabled]:active,
fieldset[disabled] .datepicker table tr td.active:active,
fieldset[disabled] .datepicker table tr td.active:hover:active,
fieldset[disabled] .datepicker table tr td.active.disabled:active,
fieldset[disabled] .datepicker table tr td.active.disabled:hover:active,
.datepicker table tr td.active.disabled.active,
.datepicker table tr td.active:hover.disabled.active,
.datepicker table tr td.active.disabled.disabled.active,
.datepicker table tr td.active.disabled:hover.disabled.active,
.datepicker table tr td.active[disabled].active,
.datepicker table tr td.active:hover[disabled].active,
.datepicker table tr td.active.disabled[disabled].active,
.datepicker table tr td.active.disabled:hover[disabled].active,
fieldset[disabled] .datepicker table tr td.active.active,
fieldset[disabled] .datepicker table tr td.active:hover.active,
fieldset[disabled] .datepicker table tr td.active.disabled.active,
fieldset[disabled] .datepicker table tr td.active.disabled:hover.active {
background-color: #428bca;
border-color: #357ebd;
}
.datepicker table tr td span {
display: block;
width: 23%;
height: 54px;
line-height: 54px;
float: left;
margin: 1%;
cursor: pointer;
border-radius: 4px;
}
.datepicker table tr td span:hover {
background: rgba(0, 0, 0, 0.2);
}
.datepicker table tr td span.disabled,
.datepicker table tr td span.disabled:hover {
background: none;
color: #444;
cursor: default;
}
.datepicker table tr td span.active,
.datepicker table tr td span.active:hover,
.datepicker table tr td span.active.disabled,
.datepicker table tr td span.active.disabled:hover {
color: #ffffff;
background-color: #428bca;
border-color: #357ebd;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.datepicker table tr td span.active:hover,
.datepicker table tr td span.active:hover:hover,
.datepicker table tr td span.active.disabled:hover,
.datepicker table tr td span.active.disabled:hover:hover,
.datepicker table tr td span.active:focus,
.datepicker table tr td span.active:hover:focus,
.datepicker table tr td span.active.disabled:focus,
.datepicker table tr td span.active.disabled:hover:focus,
.datepicker table tr td span.active:active,
.datepicker table tr td span.active:hover:active,
.datepicker table tr td span.active.disabled:active,
.datepicker table tr td span.active.disabled:hover:active,
.datepicker table tr td span.active.active,
.datepicker table tr td span.active:hover.active,
.datepicker table tr td span.active.disabled.active,
.datepicker table tr td span.active.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td span.active,
.open .dropdown-toggle.datepicker table tr td span.active:hover,
.open .dropdown-toggle.datepicker table tr td span.active.disabled,
.open .dropdown-toggle.datepicker table tr td span.active.disabled:hover {
color: #ffffff;
background-color: #3276b1;
border-color: #285e8e;
}
.datepicker table tr td span.active:active,
.datepicker table tr td span.active:hover:active,
.datepicker table tr td span.active.disabled:active,
.datepicker table tr td span.active.disabled:hover:active,
.datepicker table tr td span.active.active,
.datepicker table tr td span.active:hover.active,
.datepicker table tr td span.active.disabled.active,
.datepicker table tr td span.active.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td span.active,
.open .dropdown-toggle.datepicker table tr td span.active:hover,
.open .dropdown-toggle.datepicker table tr td span.active.disabled,
.open .dropdown-toggle.datepicker table tr td span.active.disabled:hover {
background-image: none;
}
.datepicker table tr td span.active.disabled,
.datepicker table tr td span.active:hover.disabled,
.datepicker table tr td span.active.disabled.disabled,
.datepicker table tr td span.active.disabled:hover.disabled,
.datepicker table tr td span.active[disabled],
.datepicker table tr td span.active:hover[disabled],
.datepicker table tr td span.active.disabled[disabled],
.datepicker table tr td span.active.disabled:hover[disabled],
fieldset[disabled] .datepicker table tr td span.active,
fieldset[disabled] .datepicker table tr td span.active:hover,
fieldset[disabled] .datepicker table tr td span.active.disabled,
fieldset[disabled] .datepicker table tr td span.active.disabled:hover,
.datepicker table tr td span.active.disabled:hover,
.datepicker table tr td span.active:hover.disabled:hover,
.datepicker table tr td span.active.disabled.disabled:hover,
.datepicker table tr td span.active.disabled:hover.disabled:hover,
.datepicker table tr td span.active[disabled]:hover,
.datepicker table tr td span.active:hover[disabled]:hover,
.datepicker table tr td span.active.disabled[disabled]:hover,
.datepicker table tr td span.active.disabled:hover[disabled]:hover,
fieldset[disabled] .datepicker table tr td span.active:hover,
fieldset[disabled] .datepicker table tr td span.active:hover:hover,
fieldset[disabled] .datepicker table tr td span.active.disabled:hover,
fieldset[disabled] .datepicker table tr td span.active.disabled:hover:hover,
.datepicker table tr td span.active.disabled:focus,
.datepicker table tr td span.active:hover.disabled:focus,
.datepicker table tr td span.active.disabled.disabled:focus,
.datepicker table tr td span.active.disabled:hover.disabled:focus,
.datepicker table tr td span.active[disabled]:focus,
.datepicker table tr td span.active:hover[disabled]:focus,
.datepicker table tr td span.active.disabled[disabled]:focus,
.datepicker table tr td span.active.disabled:hover[disabled]:focus,
fieldset[disabled] .datepicker table tr td span.active:focus,
fieldset[disabled] .datepicker table tr td span.active:hover:focus,
fieldset[disabled] .datepicker table tr td span.active.disabled:focus,
fieldset[disabled] .datepicker table tr td span.active.disabled:hover:focus,
.datepicker table tr td span.active.disabled:active,
.datepicker table tr td span.active:hover.disabled:active,
.datepicker table tr td span.active.disabled.disabled:active,
.datepicker table tr td span.active.disabled:hover.disabled:active,
.datepicker table tr td span.active[disabled]:active,
.datepicker table tr td span.active:hover[disabled]:active,
.datepicker table tr td span.active.disabled[disabled]:active,
.datepicker table tr td span.active.disabled:hover[disabled]:active,
fieldset[disabled] .datepicker table tr td span.active:active,
fieldset[disabled] .datepicker table tr td span.active:hover:active,
fieldset[disabled] .datepicker table tr td span.active.disabled:active,
fieldset[disabled] .datepicker table tr td span.active.disabled:hover:active,
.datepicker table tr td span.active.disabled.active,
.datepicker table tr td span.active:hover.disabled.active,
.datepicker table tr td span.active.disabled.disabled.active,
.datepicker table tr td span.active.disabled:hover.disabled.active,
.datepicker table tr td span.active[disabled].active,
.datepicker table tr td span.active:hover[disabled].active,
.datepicker table tr td span.active.disabled[disabled].active,
.datepicker table tr td span.active.disabled:hover[disabled].active,
fieldset[disabled] .datepicker table tr td span.active.active,
fieldset[disabled] .datepicker table tr td span.active:hover.active,
fieldset[disabled] .datepicker table tr td span.active.disabled.active,
fieldset[disabled] .datepicker table tr td span.active.disabled:hover.active {
background-color: #428bca;
border-color: #357ebd;
}
.datepicker table tr td span.old,
.datepicker table tr td span.new {
color: #444;
}
.datepicker th.datepicker-switch {
width: 145px;
}
.datepicker thead tr:first-child th,
.datepicker tfoot tr th {
cursor: pointer;
}
.datepicker thead tr:first-child th:hover,
.datepicker tfoot tr th:hover {
background: rgba(0, 0, 0, 0.2);
}
.datepicker .cw {
font-size: 10px;
width: 12px;
padding: 0 2px 0 5px;
vertical-align: middle;
}
.datepicker thead tr:first-child th.cw {
cursor: default;
background-color: transparent;
}
.input-group.date .input-group-addon i {
cursor: pointer;
width: 16px;
height: 16px;
}
.input-daterange input {
text-align: center;
}
.input-daterange input:first-child {
border-radius: 3px 0 0 3px;
}
.input-daterange input:last-child {
border-radius: 0 3px 3px 0;
}
.input-daterange .input-group-addon {
width: auto;
min-width: 16px;
padding: 4px 5px;
font-weight: normal;
line-height: 1.428571429;
text-align: center;
text-shadow: 0 1px 0 #fff;
vertical-align: middle;
background-color: #eeeeee;
border: solid #cccccc;
border-width: 1px 0;
margin-left: -5px;
margin-right: -5px;
}
.datepicker.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
float: left;
display: none;
min-width: 160px;
list-style: none;
background-color: #ffffff;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 5px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
*border-right-width: 2px;
*border-bottom-width: 2px;
color: #333333;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px;
line-height: 1.428571429;
}
.datepicker.dropdown-menu th,
.datepicker.dropdown-menu td {
padding: 4px 5px;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,419 @@
/*!
* Datetimepicker for Bootstrap
*
* Copyright 2012 Stefan Petre
* Improvements by Andrew Rowls
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
*/
.datetimepicker {
padding: 4px;
margin-top: 1px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
direction: ltr
}
.datetimepicker-inline {
width: 220px
}
.datetimepicker.datetimepicker-rtl {
direction: rtl
}
.datetimepicker.datetimepicker-rtl table tr td span {
float: right
}
.datetimepicker-dropdown,
.datetimepicker-dropdown-left {
top: 0;
left: 0
}
[class*=" datetimepicker-dropdown"]:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 7px solid #ccc;
border-bottom-color: rgba(0, 0, 0, 0.2);
position: absolute
}
[class*=" datetimepicker-dropdown"]:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #fff;
position: absolute
}
[class*=" datetimepicker-dropdown-top"]:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-top: 7px solid #ccc;
border-top-color: rgba(0, 0, 0, 0.2);
border-bottom: 0
}
[class*=" datetimepicker-dropdown-top"]:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid #fff;
border-bottom: 0
}
.datetimepicker-dropdown-bottom-left:before {
top: -7px;
right: 6px
}
.datetimepicker-dropdown-bottom-left:after {
top: -6px;
right: 7px
}
.datetimepicker-dropdown-bottom-right:before {
top: -7px;
left: 6px
}
.datetimepicker-dropdown-bottom-right:after {
top: -6px;
left: 7px
}
.datetimepicker-dropdown-top-left:before {
bottom: -7px;
right: 6px
}
.datetimepicker-dropdown-top-left:after {
bottom: -6px;
right: 7px
}
.datetimepicker-dropdown-top-right:before {
bottom: -7px;
left: 6px
}
.datetimepicker-dropdown-top-right:after {
bottom: -6px;
left: 7px
}
.datetimepicker>div {
display: none
}
.datetimepicker.minutes div.datetimepicker-minutes {
display: block
}
.datetimepicker.hours div.datetimepicker-hours {
display: block
}
.datetimepicker.days div.datetimepicker-days {
display: block
}
.datetimepicker.months div.datetimepicker-months {
display: block
}
.datetimepicker.years div.datetimepicker-years {
display: block
}
.datetimepicker table {
margin: 0
}
.datetimepicker td,
.datetimepicker th {
text-align: center;
width: 20px;
height: 20px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
border: 0
}
.table-striped .datetimepicker table tr td,
.table-striped .datetimepicker table tr th {
background-color: transparent
}
.datetimepicker table tr td.minute:hover {
background: #eee;
cursor: pointer
}
.datetimepicker table tr td.hour:hover {
background: #eee;
cursor: pointer
}
.datetimepicker table tr td.day:hover {
background: #eee;
cursor: pointer
}
.datetimepicker table tr td.old,
.datetimepicker table tr td.new {
color: #999
}
.datetimepicker table tr td.disabled,
.datetimepicker table tr td.disabled:hover {
background: 0;
color: #999;
cursor: default
}
.datetimepicker table tr td.today,
.datetimepicker table tr td.today:hover,
.datetimepicker table tr td.today.disabled,
.datetimepicker table tr td.today.disabled:hover {
background-color: #fde19a;
background-image: -moz-linear-gradient(top, #fdd49a, #fdf59a);
background-image: -ms-linear-gradient(top, #fdd49a, #fdf59a);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fdd49a), to(#fdf59a));
background-image: -webkit-linear-gradient(top, #fdd49a, #fdf59a);
background-image: -o-linear-gradient(top, #fdd49a, #fdf59a);
background-image: linear-gradient(top, #fdd49a, #fdf59a);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a', endColorstr='#fdf59a', GradientType=0);
border-color: #fdf59a #fdf59a #fbed50;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false)
}
.datetimepicker table tr td.today:hover,
.datetimepicker table tr td.today:hover:hover,
.datetimepicker table tr td.today.disabled:hover,
.datetimepicker table tr td.today.disabled:hover:hover,
.datetimepicker table tr td.today:active,
.datetimepicker table tr td.today:hover:active,
.datetimepicker table tr td.today.disabled:active,
.datetimepicker table tr td.today.disabled:hover:active,
.datetimepicker table tr td.today.active,
.datetimepicker table tr td.today:hover.active,
.datetimepicker table tr td.today.disabled.active,
.datetimepicker table tr td.today.disabled:hover.active,
.datetimepicker table tr td.today.disabled,
.datetimepicker table tr td.today:hover.disabled,
.datetimepicker table tr td.today.disabled.disabled,
.datetimepicker table tr td.today.disabled:hover.disabled,
.datetimepicker table tr td.today[disabled],
.datetimepicker table tr td.today:hover[disabled],
.datetimepicker table tr td.today.disabled[disabled],
.datetimepicker table tr td.today.disabled:hover[disabled] {
background-color: #fdf59a
}
.datetimepicker table tr td.today:active,
.datetimepicker table tr td.today:hover:active,
.datetimepicker table tr td.today.disabled:active,
.datetimepicker table tr td.today.disabled:hover:active,
.datetimepicker table tr td.today.active,
.datetimepicker table tr td.today:hover.active,
.datetimepicker table tr td.today.disabled.active,
.datetimepicker table tr td.today.disabled:hover.active {
background-color: #fbf069
}
.datetimepicker table tr td.active,
.datetimepicker table tr td.active:hover,
.datetimepicker table tr td.active.disabled,
.datetimepicker table tr td.active.disabled:hover {
background-color: #006dcc;
background-image: -moz-linear-gradient(top, #08c, #04c);
background-image: -ms-linear-gradient(top, #08c, #04c);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#04c));
background-image: -webkit-linear-gradient(top, #08c, #04c);
background-image: -o-linear-gradient(top, #08c, #04c);
background-image: linear-gradient(top, #08c, #04c);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
border-color: #04c #04c #002a80;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
color: #fff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25)
}
.datetimepicker table tr td.active:hover,
.datetimepicker table tr td.active:hover:hover,
.datetimepicker table tr td.active.disabled:hover,
.datetimepicker table tr td.active.disabled:hover:hover,
.datetimepicker table tr td.active:active,
.datetimepicker table tr td.active:hover:active,
.datetimepicker table tr td.active.disabled:active,
.datetimepicker table tr td.active.disabled:hover:active,
.datetimepicker table tr td.active.active,
.datetimepicker table tr td.active:hover.active,
.datetimepicker table tr td.active.disabled.active,
.datetimepicker table tr td.active.disabled:hover.active,
.datetimepicker table tr td.active.disabled,
.datetimepicker table tr td.active:hover.disabled,
.datetimepicker table tr td.active.disabled.disabled,
.datetimepicker table tr td.active.disabled:hover.disabled,
.datetimepicker table tr td.active[disabled],
.datetimepicker table tr td.active:hover[disabled],
.datetimepicker table tr td.active.disabled[disabled],
.datetimepicker table tr td.active.disabled:hover[disabled] {
background-color: #04c
}
.datetimepicker table tr td.active:active,
.datetimepicker table tr td.active:hover:active,
.datetimepicker table tr td.active.disabled:active,
.datetimepicker table tr td.active.disabled:hover:active,
.datetimepicker table tr td.active.active,
.datetimepicker table tr td.active:hover.active,
.datetimepicker table tr td.active.disabled.active,
.datetimepicker table tr td.active.disabled:hover.active {
background-color: #039
}
.datetimepicker table tr td span {
display: block;
width: 23%;
height: 54px;
line-height: 54px;
float: left;
margin: 1%;
cursor: pointer;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px
}
.datetimepicker .datetimepicker-hours span {
height: 26px;
line-height: 26px
}
.datetimepicker .datetimepicker-hours table tr td span.hour_am,
.datetimepicker .datetimepicker-hours table tr td span.hour_pm {
width: 14.6%
}
.datetimepicker .datetimepicker-hours fieldset legend,
.datetimepicker .datetimepicker-minutes fieldset legend {
margin-bottom: inherit;
line-height: 30px
}
.datetimepicker .datetimepicker-minutes span {
height: 26px;
line-height: 26px
}
.datetimepicker table tr td span:hover {
background: #eee
}
.datetimepicker table tr td span.disabled,
.datetimepicker table tr td span.disabled:hover {
background: 0;
color: #999;
cursor: default
}
.datetimepicker table tr td span.active,
.datetimepicker table tr td span.active:hover,
.datetimepicker table tr td span.active.disabled,
.datetimepicker table tr td span.active.disabled:hover {
background-color: #006dcc;
background-image: -moz-linear-gradient(top, #08c, #04c);
background-image: -ms-linear-gradient(top, #08c, #04c);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#04c));
background-image: -webkit-linear-gradient(top, #08c, #04c);
background-image: -o-linear-gradient(top, #08c, #04c);
background-image: linear-gradient(top, #08c, #04c);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
border-color: #04c #04c #002a80;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
color: #fff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25)
}
.datetimepicker table tr td span.active:hover,
.datetimepicker table tr td span.active:hover:hover,
.datetimepicker table tr td span.active.disabled:hover,
.datetimepicker table tr td span.active.disabled:hover:hover,
.datetimepicker table tr td span.active:active,
.datetimepicker table tr td span.active:hover:active,
.datetimepicker table tr td span.active.disabled:active,
.datetimepicker table tr td span.active.disabled:hover:active,
.datetimepicker table tr td span.active.active,
.datetimepicker table tr td span.active:hover.active,
.datetimepicker table tr td span.active.disabled.active,
.datetimepicker table tr td span.active.disabled:hover.active,
.datetimepicker table tr td span.active.disabled,
.datetimepicker table tr td span.active:hover.disabled,
.datetimepicker table tr td span.active.disabled.disabled,
.datetimepicker table tr td span.active.disabled:hover.disabled,
.datetimepicker table tr td span.active[disabled],
.datetimepicker table tr td span.active:hover[disabled],
.datetimepicker table tr td span.active.disabled[disabled],
.datetimepicker table tr td span.active.disabled:hover[disabled] {
background-color: #04c
}
.datetimepicker table tr td span.active:active,
.datetimepicker table tr td span.active:hover:active,
.datetimepicker table tr td span.active.disabled:active,
.datetimepicker table tr td span.active.disabled:hover:active,
.datetimepicker table tr td span.active.active,
.datetimepicker table tr td span.active:hover.active,
.datetimepicker table tr td span.active.disabled.active,
.datetimepicker table tr td span.active.disabled:hover.active {
background-color: #039
}
.datetimepicker table tr td span.old {
color: #999
}
.datetimepicker th.switch {
width: 145px
}
.datetimepicker th span.glyphicon {
pointer-events: none
}
.datetimepicker thead tr:first-child th,
.datetimepicker tfoot th {
cursor: pointer
}
.datetimepicker thead tr:first-child th:hover,
.datetimepicker tfoot th:hover {
background: #eee
}
.input-append.date .add-on i,
.input-prepend.date .add-on i,
.input-group.date .input-group-addon span {
cursor: pointer;
width: 14px;
height: 14px
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,14 @@
/**
* Simplified Chinese translation for bootstrap-datetimepicker
* Yuan Cheung <advanimal@gmail.com>
*/
(function ($) {
$.fn.datetimepicker.dates['zh-CN'] = {
days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
today: "今日"
};
}(jQuery));

View File

@@ -0,0 +1,190 @@
/**
* Bootstrap Multiselect (http://davidstutz.de/bootstrap-multiselect/)
*
* Apache License, Version 2.0:
* Copyright (c) 2012 - 2021 David Stutz
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a
* copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* BSD 3-Clause License:
* Copyright (c) 2012 - 2021 David Stutz
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Neither the name of David Stutz nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
span.multiselect-native-select {
position: relative;
}
span.multiselect-native-select select {
border: 0 !important;
clip: rect(0 0 0 0) !important;
height: 1px !important;
margin: -1px -1px -1px -3px !important;
overflow: hidden !important;
padding: 0 !important;
position: absolute !important;
width: 1px !important;
left: 50%;
top: 30px;
}
.multiselect.dropdown-toggle:after {
display: none;
}
.multiselect {
overflow: hidden;
text-overflow: ellipsis;
}
.multiselect-container {
position: absolute;
list-style-type: none;
margin: 0;
padding: 0;
}
.multiselect-container .multiselect-reset .input-group {
width: 93%;
}
.multiselect-container .multiselect-filter>.fa-search {
z-index: 1;
padding-left: 0.75rem;
}
.multiselect-container .multiselect-filter>input.multiselect-search {
border: none;
border-bottom: 1px solid lightgrey;
padding-left: 2rem;
margin-left: -1.625rem;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.multiselect-container .multiselect-filter>input.multiselect-search:focus {
border-bottom-right-radius: 0.25rem;
border-bottom-left-radius: 0.25rem;
}
.multiselect-container .multiselect-filter>.multiselect-moz-clear-filter {
margin-left: -1.5rem;
display: none;
}
.multiselect-container .multiselect-option.multiselect-group-option-indented {
padding-left: 1.75rem;
}
.multiselect-container .multiselect-option,
.multiselect-container .multiselect-group,
.multiselect-container .multiselect-all {
padding: 0.25rem 0.25rem 0.25rem 0.75rem;
}
.multiselect-container .multiselect-option.dropdown-item,
.multiselect-container .multiselect-group.dropdown-item,
.multiselect-container .multiselect-all.dropdown-item,
.multiselect-container .multiselect-option.dropdown-toggle,
.multiselect-container .multiselect-group.dropdown-toggle,
.multiselect-container .multiselect-all.dropdown-toggle {
cursor: pointer;
}
.multiselect-container .multiselect-option .form-check-label,
.multiselect-container .multiselect-group .form-check-label,
.multiselect-container .multiselect-all .form-check-label {
cursor: pointer;
}
.multiselect-container .multiselect-option.active:not(.multiselect-active-item-fallback),
.multiselect-container .multiselect-group.active:not(.multiselect-active-item-fallback),
.multiselect-container .multiselect-all.active:not(.multiselect-active-item-fallback),
.multiselect-container .multiselect-option:not(.multiselect-active-item-fallback):active,
.multiselect-container .multiselect-group:not(.multiselect-active-item-fallback):active,
.multiselect-container .multiselect-all:not(.multiselect-active-item-fallback):active {
background-color: lightgrey;
color: black;
}
.multiselect-container .multiselect-option:hover,
.multiselect-container .multiselect-group:hover,
.multiselect-container .multiselect-all:hover,
.multiselect-container .multiselect-option:focus,
.multiselect-container .multiselect-group:focus,
.multiselect-container .multiselect-all:focus {
background-color: darkgray !important;
}
.multiselect-container .multiselect-option .form-check,
.multiselect-container .multiselect-group .form-check,
.multiselect-container .multiselect-all .form-check {
padding: 0 5px 0 20px;
}
.multiselect-container .multiselect-option:focus,
.multiselect-container .multiselect-group:focus,
.multiselect-container .multiselect-all:focus {
outline: none;
}
.form-inline .multiselect-container span.form-check {
padding: 3px 20px 3px 40px;
}
.input-group.input-group-sm>.multiselect-native-select .multiselect {
padding: .25rem .5rem;
font-size: .875rem;
line-height: 1.5;
padding-right: 1.75rem;
height: calc(4em);
}
.input-group>.multiselect-native-select {
flex: 1 1 auto;
width: 1%;
}
.input-group>.multiselect-native-select>div.btn-group {
width: 100%;
}
.input-group>.multiselect-native-select:not(:first-child) .multiselect {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.input-group>.multiselect-native-select:not(:last-child) .multiselect {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,337 @@
/*!
* Bootstrap-select v1.10.0 (http://silviomoreto.github.io/bootstrap-select)
*
* Copyright 2013-2016 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/
select.bs-select-hidden,
select.selectpicker {
display: none !important;
}
.bootstrap-select {
width: 220px \0;
/*IE9 and below*/
}
.bootstrap-select>.dropdown-toggle {
width: 100%;
padding-right: 25px;
z-index: 1;
}
.bootstrap-select>select {
position: absolute !important;
bottom: 0;
left: 50%;
display: block !important;
width: 0.5px !important;
height: 100% !important;
padding: 0 !important;
opacity: 0 !important;
border: none;
}
.bootstrap-select>select.mobile-device {
top: 0;
left: 0;
display: block !important;
width: 100% !important;
z-index: 2;
}
.has-error .bootstrap-select .dropdown-toggle,
.error .bootstrap-select .dropdown-toggle {
border-color: #b94a48;
}
.bootstrap-select.fit-width {
width: auto !important;
}
.bootstrap-select:not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) {
width: 220px;
}
.bootstrap-select .dropdown-toggle:focus {
outline: thin dotted #333333 !important;
outline: 5px auto -webkit-focus-ring-color !important;
outline-offset: -2px;
}
.bootstrap-select.form-control {
margin-bottom: 0;
padding: 0;
border: none;
}
.bootstrap-select.form-control:not([class*="col-"]) {
width: 100%;
}
.bootstrap-select.form-control.input-group-btn {
z-index: auto;
}
.bootstrap-select.btn-group:not(.input-group-btn),
.bootstrap-select.btn-group[class*="col-"] {
float: none;
display: inline-block;
margin-left: 0;
}
.bootstrap-select.btn-group.dropdown-menu-right,
.bootstrap-select.btn-group[class*="col-"].dropdown-menu-right,
.row .bootstrap-select.btn-group[class*="col-"].dropdown-menu-right {
float: right;
}
.form-inline .bootstrap-select.btn-group,
.form-horizontal .bootstrap-select.btn-group,
.form-group .bootstrap-select.btn-group {
margin-bottom: 0;
}
.form-group-lg .bootstrap-select.btn-group.form-control,
.form-group-sm .bootstrap-select.btn-group.form-control {
padding: 0;
}
.form-inline .bootstrap-select.btn-group .form-control {
width: 100%;
}
.bootstrap-select.btn-group.disabled,
.bootstrap-select.btn-group>.disabled {
cursor: not-allowed;
}
.bootstrap-select.btn-group.disabled:focus,
.bootstrap-select.btn-group>.disabled:focus {
outline: none !important;
}
.bootstrap-select.btn-group.bs-container {
position: absolute;
}
.bootstrap-select.btn-group.bs-container .dropdown-menu {
z-index: 1060;
}
.bootstrap-select.btn-group .dropdown-toggle .filter-option {
display: inline-block;
overflow: hidden;
width: 100%;
text-align: left;
}
.bootstrap-select.btn-group .dropdown-toggle .caret {
position: absolute;
top: 50%;
right: 12px;
margin-top: -2px;
vertical-align: middle;
}
.bootstrap-select.btn-group[class*="col-"] .dropdown-toggle {
width: 100%;
}
.bootstrap-select.btn-group .dropdown-menu {
min-width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.bootstrap-select.btn-group .dropdown-menu.inner {
position: static;
float: none;
border: 0;
padding: 0;
margin: 0;
border-radius: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
.bootstrap-select.btn-group .dropdown-menu li {
position: relative;
}
.bootstrap-select.btn-group .dropdown-menu li.active small {
color: #fff;
}
.bootstrap-select.btn-group .dropdown-menu li.disabled a {
cursor: not-allowed;
}
.bootstrap-select.btn-group .dropdown-menu li a {
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.bootstrap-select.btn-group .dropdown-menu li a.opt {
position: relative;
padding-left: 2.25em;
}
.bootstrap-select.btn-group .dropdown-menu li a span.check-mark {
display: none;
}
.bootstrap-select.btn-group .dropdown-menu li a span.text {
display: inline-block;
}
.bootstrap-select.btn-group .dropdown-menu li small {
padding-left: 0.5em;
}
.bootstrap-select.btn-group .dropdown-menu .notify {
position: absolute;
bottom: 5px;
width: 96%;
margin: 0 2%;
min-height: 26px;
padding: 3px 5px;
background: #f5f5f5;
border: 1px solid #e3e3e3;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
pointer-events: none;
opacity: 0.9;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.bootstrap-select.btn-group .no-results {
padding: 3px;
background: #f5f5f5;
margin: 0 5px;
white-space: nowrap;
}
.bootstrap-select.btn-group.fit-width .dropdown-toggle .filter-option {
position: static;
}
.bootstrap-select.btn-group.fit-width .dropdown-toggle .caret {
position: static;
top: auto;
margin-top: -1px;
}
.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a span.check-mark {
position: absolute;
display: inline-block;
right: 15px;
margin-top: 5px;
}
.bootstrap-select.btn-group.show-tick .dropdown-menu li a span.text {
margin-right: 34px;
}
.bootstrap-select.show-menu-arrow.open>.dropdown-toggle {
z-index: 1061;
}
.bootstrap-select.show-menu-arrow .dropdown-toggle:before {
content: '';
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 7px solid rgba(204, 204, 204, 0.2);
position: absolute;
bottom: -4px;
left: 9px;
display: none;
}
.bootstrap-select.show-menu-arrow .dropdown-toggle:after {
content: '';
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid white;
position: absolute;
bottom: -4px;
left: 10px;
display: none;
}
.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:before {
bottom: auto;
top: -3px;
border-top: 7px solid rgba(204, 204, 204, 0.2);
border-bottom: 0;
}
.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:after {
bottom: auto;
top: -3px;
border-top: 6px solid white;
border-bottom: 0;
}
.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:before {
right: 12px;
left: auto;
}
.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:after {
right: 13px;
left: auto;
}
.bootstrap-select.show-menu-arrow.open>.dropdown-toggle:before,
.bootstrap-select.show-menu-arrow.open>.dropdown-toggle:after {
display: block;
}
.bs-searchbox,
.bs-actionsbox,
.bs-donebutton {
padding: 4px 8px;
}
.bs-actionsbox {
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.bs-actionsbox .btn-group button {
width: 50%;
}
.bs-donebutton {
float: left;
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.bs-donebutton .btn-group button {
width: 100%;
}
.bs-searchbox+.bs-actionsbox {
padding: 0 8px 4px;
}
.bs-searchbox .form-control {
margin-bottom: 0;
width: 100%;
float: none;
}
/*# sourceMappingURL=bootstrap-select.css.map */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,303 @@
/**
* @author zhixin wen <wenzhixin2010@gmail.com>
* version: 1.10.1
* https://github.com/wenzhixin/bootstrap-table/
*/
.bootstrap-table .table {
margin-bottom: 0 !important;
border-bottom: 1px solid #dddddd;
border-collapse: collapse !important;
border-radius: 1px;
}
.bootstrap-table .table:not(.table-condensed),
.bootstrap-table .table:not(.table-condensed)>tbody>tr>th,
.bootstrap-table .table:not(.table-condensed)>tfoot>tr>th,
.bootstrap-table .table:not(.table-condensed)>thead>tr>td,
.bootstrap-table .table:not(.table-condensed)>tbody>tr>td,
.bootstrap-table .table:not(.table-condensed)>tfoot>tr>td {
padding: 8px;
}
.bootstrap-table .table.table-no-bordered>thead>tr>th,
.bootstrap-table .table.table-no-bordered>tbody>tr>td {
border-right: 2px solid transparent;
}
.fixed-table-container {
position: relative;
clear: both;
border: 1px solid #dddddd;
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
}
.fixed-table-container.table-no-bordered {
border: 1px solid transparent;
}
.fixed-table-footer,
.fixed-table-header {
overflow: hidden;
}
.fixed-table-footer {
border-top: 1px solid #dddddd;
}
.fixed-table-body {
overflow-x: auto;
overflow-y: auto;
height: 100%;
}
.fixed-table-container table {
width: 100%;
}
.fixed-table-container thead th {
height: 0;
padding: 0;
margin: 0;
border-left: 1px solid #dddddd;
}
.fixed-table-container thead th:focus {
outline: 0 solid transparent;
}
.fixed-table-container thead th:first-child {
border-left: none;
border-top-left-radius: 4px;
-webkit-border-top-left-radius: 4px;
-moz-border-radius-topleft: 4px;
}
.fixed-table-container thead th .th-inner,
.fixed-table-container tbody td .th-inner {
padding: 8px;
line-height: 24px;
vertical-align: top;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.fixed-table-container thead th .sortable {
cursor: pointer;
background-position: right;
background-repeat: no-repeat;
padding-right: 30px;
}
.fixed-table-container thead th .both {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7X QMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC');
}
.fixed-table-container thead th .asc {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==');
}
.fixed-table-container thead th .desc {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII= ');
}
.fixed-table-container th.detail {
width: 30px;
}
.fixed-table-container tbody td {
border-left: 1px solid #dddddd;
}
.fixed-table-container tbody tr:first-child td {
border-top: none;
}
.fixed-table-container tbody td:first-child {
border-left: none;
}
/* the same color with .active */
.fixed-table-container tbody .selected td {
background-color: #f5f5f5;
}
.fixed-table-container .bs-checkbox {
text-align: center;
}
.fixed-table-container .bs-checkbox .th-inner {
padding: 8px 0;
}
.fixed-table-container input[type="radio"],
.fixed-table-container input[type="checkbox"] {
margin: 0 auto !important;
}
.fixed-table-container .no-records-found {
text-align: center;
}
.fixed-table-pagination div.pagination,
.fixed-table-pagination .pagination-detail {
margin-top: 10px;
margin-bottom: 10px;
}
.fixed-table-pagination div.pagination .pagination {
margin: 0;
}
.fixed-table-pagination .pagination a {
padding: 6px 12px;
line-height: 1.428571429;
}
.fixed-table-pagination .pagination-info {
line-height: 34px;
margin-right: 5px;
}
.fixed-table-pagination .btn-group {
position: relative;
display: inline-block;
vertical-align: middle;
}
.fixed-table-pagination .dropup .dropdown-menu {
margin-bottom: 0;
}
.fixed-table-pagination .page-list {
display: inline-block;
}
.fixed-table-toolbar .columns-left {
margin-right: 5px;
}
.fixed-table-toolbar .columns-right {
margin-left: 5px;
}
.fixed-table-toolbar .columns label {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.428571429;
}
.fixed-table-toolbar .bars,
.fixed-table-toolbar .search,
.fixed-table-toolbar .columns {
position: relative;
margin-top: 10px;
margin-bottom: 10px;
line-height: 34px;
}
.fixed-table-pagination li.disabled a {
pointer-events: none;
cursor: default;
}
.fixed-table-loading {
display: none;
position: absolute;
top: 42px;
right: 0;
bottom: 0;
left: 0;
z-index: 99;
background-color: #fff;
text-align: center;
}
.fixed-table-body .card-view .title {
font-weight: bold;
display: inline-block;
min-width: 30%;
text-align: left !important;
}
/* support bootstrap 2 */
.fixed-table-body thead th .th-inner {
box-sizing: border-box;
}
.table th,
.table td {
vertical-align: middle;
box-sizing: border-box;
}
.fixed-table-toolbar .dropdown-menu {
text-align: left;
max-height: 300px;
overflow: auto;
}
.fixed-table-toolbar .btn-group>.btn-group {
display: inline-block;
margin-left: -1px !important;
}
.fixed-table-toolbar .btn-group>.btn-group>.btn {
border-radius: 0;
}
.fixed-table-toolbar .btn-group>.btn-group:first-child>.btn {
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
.fixed-table-toolbar .btn-group>.btn-group:last-child>.btn {
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
.bootstrap-table .table>thead>tr>th {
vertical-align: bottom;
border-bottom: 1px solid #ddd;
}
/* support bootstrap 3 */
.bootstrap-table .table thead>tr>th {
padding: 0;
margin: 0;
}
.bootstrap-table .fixed-table-footer tbody>tr>td {
padding: 0 !important;
}
.bootstrap-table .fixed-table-footer .table {
border-bottom: none;
border-radius: 0;
padding: 0 !important;
}
.pull-right .dropdown-menu {
right: 0;
left: auto;
}
/* calculate scrollbar width */
p.fixed-table-scroll-inner {
width: 100%;
height: 200px;
}
div.fixed-table-scroll-outer {
top: 0;
left: 0;
visibility: hidden;
width: 200px;
height: 150px;
overflow: hidden;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,146 @@
/**
* @author zhixin wen <wenzhixin2010@gmail.com>
* extensions: https://github.com/vitalets/x-editable
*/
(function (root, factory) {
var define;
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module unless amdModuleId is set
define(["jquery"], function (a0) {
return (factory(a0));
});
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require("jquery"));
} else {
factory(jQuery);
}
}(this, function (jQuery) {
!function ($) {
'use strict';
$.extend($.fn.bootstrapTable.defaults, {
editable: true,
onEditableInit: function () {
return false;
},
onEditableSave: function (field, row, oldValue, $el) {
return false;
},
onEditableShown: function (field, row, $el, editable) {
return false;
},
onEditableHidden: function (field, row, $el, reason) {
return false;
}
});
$.extend($.fn.bootstrapTable.Constructor.EVENTS, {
'editable-init.bs.table': 'onEditableInit',
'editable-save.bs.table': 'onEditableSave',
'editable-shown.bs.table': 'onEditableShown',
'editable-hidden.bs.table': 'onEditableHidden'
});
var BootstrapTable = $.fn.bootstrapTable.Constructor,
_initTable = BootstrapTable.prototype.initTable,
_initBody = BootstrapTable.prototype.initBody;
BootstrapTable.prototype.initTable = function () {
var that = this;
_initTable.apply(this, Array.prototype.slice.apply(arguments));
if (!this.options.editable) {
return;
}
$.each(this.columns, function (i, column) {
if (!column.editable) {
return;
}
var editableOptions = {}, editableDataMarkup = [], editableDataPrefix = 'editable-';
var processDataOptions = function (key, value) {
// Replace camel case with dashes.
var dashKey = key.replace(/([A-Z])/g, function ($1) { return "-" + $1.toLowerCase(); });
if (dashKey.slice(0, editableDataPrefix.length) == editableDataPrefix) {
var dataKey = dashKey.replace(editableDataPrefix, 'data-');
editableOptions[dataKey] = value;
}
};
$.each(that.options, processDataOptions);
var _formatter = column.formatter;
column.formatter = function (value, row, index) {
var result = _formatter ? _formatter(value, row, index) : value;
$.each(column, processDataOptions);
$.each(editableOptions, function (key, value) {
editableDataMarkup.push(' ' + key + '="' + value + '"');
});
return ['<a href="javascript:void(0)"',
' data-name="' + column.field + '"',
' data-pk="' + row[that.options.idField] + '"',
' data-value="' + result + '"',
editableDataMarkup.join(''),
'>' + '</a>'
].join('');
};
});
};
BootstrapTable.prototype.initBody = function () {
var that = this;
_initBody.apply(this, Array.prototype.slice.apply(arguments));
if (!this.options.editable) {
return;
}
$.each(this.columns, function (i, column) {
if (!column.editable) {
return;
}
that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
.off('save').on('save', function (e, params) {
var data = that.getData(),
index = $(this).parents('tr[data-index]').data('index'),
row = data[index],
oldValue = row[column.field];
$(this).data('value', params.submitValue);
row[column.field] = params.submitValue;
that.trigger('editable-save', column.field, row, oldValue, $(this));
});
that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
.off('shown').on('shown', function (e, editable) {
var data = that.getData(),
index = $(this).parents('tr[data-index]').data('index'),
row = data[index];
that.trigger('editable-shown', column.field, row, $(this), editable);
});
that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
.off('hidden').on('hidden', function (e, reason) {
var data = that.getData(),
index = $(this).parents('tr[data-index]').data('index'),
row = data[index];
that.trigger('editable-hidden', column.field, row, $(this), reason);
});
});
this.trigger('editable-init');
};
}(jQuery);
}));

View File

@@ -0,0 +1,60 @@
/**
* Bootstrap Table Chinese translation
* Author: Zhixin Wen<wenzhixin2010@gmail.com>
*/
(function (root, factory) {
var define;
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module unless amdModuleId is set
define(["jquery"], function (a0) {
return (factory(a0));
});
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require("jquery"));
} else {
factory(jQuery);
}
}(this, function (jQuery) {
(function ($) {
'use strict';
$.fn.bootstrapTable.locales['zh-CN'] = {
formatLoadingMessage: function () {
return '正在努力地加载数据中,请稍候……';
},
formatRecordsPerPage: function (pageNumber) {
return '每页显示 ' + pageNumber + ' 条记录';
},
formatShowingRows: function (pageFrom, pageTo, totalRows) {
return '显示第 ' + pageFrom + ' 到第 ' + pageTo + ' 条记录,总共 ' + totalRows + ' 条记录';
},
formatSearch: function () {
return '搜索';
},
formatNoMatches: function () {
return '没有找到匹配的记录';
},
formatPaginationSwitch: function () {
return '隐藏/显示分页';
},
formatRefresh: function () {
return '刷新';
},
formatToggle: function () {
return '切换';
},
formatColumns: function () {
return '列';
}
};
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['zh-CN']);
})(jQuery);
}));

View File

@@ -0,0 +1,18 @@
.treeview .list-group-item {
cursor: pointer
}
.treeview span.indent {
margin-left: 10px;
margin-right: 10px
}
.treeview span.icon {
width: 12px;
margin-right: 5px
}
.treeview .node-disabled {
color: silver;
cursor: not-allowed
}

View File

@@ -0,0 +1,593 @@
!function(a, b, c, d) {
"use strict";
var e = "treeview"
, f = {};
f.settings = {
injectStyle: !0,
levels: 2,
expandIcon: "glyphicon glyphicon-plus",
collapseIcon: "glyphicon glyphicon-minus",
emptyIcon: "glyphicon",
nodeIcon: "",
selectedIcon: "",
checkedIcon: "glyphicon glyphicon-check",
uncheckedIcon: "glyphicon glyphicon-unchecked",
color: d,
backColor: d,
borderColor: d,
onhoverColor: "#F5F5F5",
selectedColor: "#FFFFFF",
selectedBackColor: "#428bca",
searchResultColor: "#D9534F",
searchResultBackColor: d,
enableLinks: !1,
highlightSelected: !0,
highlightSearchResults: !0,
showBorder: !0,
showIcon: !0,
showCheckbox: !1,
showTags: !1,
multiSelect: !1,
onNodeChecked: d,
onNodeCollapsed: d,
onNodeDisabled: d,
onNodeEnabled: d,
onNodeExpanded: d,
onNodeSelected: d,
onNodeUnchecked: d,
onNodeUnselected: d,
onSearchComplete: d,
onSearchCleared: d
},
f.options = {
silent: !1,
ignoreChildren: !1
},
f.searchOptions = {
ignoreCase: !0,
exactMatch: !1,
revealResults: !0
};
var g = function(b, c) {
return this.$element = a(b),
this.elementId = b.id,
this.styleId = this.elementId + "-style",
this.init(c),
{
options: this.options,
init: a.proxy(this.init, this),
remove: a.proxy(this.remove, this),
getNode: a.proxy(this.getNode, this),
getParent: a.proxy(this.getParent, this),
getSiblings: a.proxy(this.getSiblings, this),
getSelected: a.proxy(this.getSelected, this),
getUnselected: a.proxy(this.getUnselected, this),
getExpanded: a.proxy(this.getExpanded, this),
getCollapsed: a.proxy(this.getCollapsed, this),
getChecked: a.proxy(this.getChecked, this),
getUnchecked: a.proxy(this.getUnchecked, this),
getDisabled: a.proxy(this.getDisabled, this),
getEnabled: a.proxy(this.getEnabled, this),
selectNode: a.proxy(this.selectNode, this),
unselectNode: a.proxy(this.unselectNode, this),
toggleNodeSelected: a.proxy(this.toggleNodeSelected, this),
collapseAll: a.proxy(this.collapseAll, this),
collapseNode: a.proxy(this.collapseNode, this),
expandAll: a.proxy(this.expandAll, this),
expandNode: a.proxy(this.expandNode, this),
toggleNodeExpanded: a.proxy(this.toggleNodeExpanded, this),
revealNode: a.proxy(this.revealNode, this),
checkAll: a.proxy(this.checkAll, this),
checkNode: a.proxy(this.checkNode, this),
uncheckAll: a.proxy(this.uncheckAll, this),
uncheckNode: a.proxy(this.uncheckNode, this),
toggleNodeChecked: a.proxy(this.toggleNodeChecked, this),
disableAll: a.proxy(this.disableAll, this),
disableNode: a.proxy(this.disableNode, this),
enableAll: a.proxy(this.enableAll, this),
enableNode: a.proxy(this.enableNode, this),
toggleNodeDisabled: a.proxy(this.toggleNodeDisabled, this),
search: a.proxy(this.search, this),
clearSearch: a.proxy(this.clearSearch, this)
}
};
g.prototype.init = function(b) {
this.tree = [],
this.nodes = [],
b.data && ("string" == typeof b.data && (b.data = a.parseJSON(b.data)),
this.tree = a.extend(!0, [], b.data),
delete b.data),
this.options = a.extend({}, f.settings, b),
this.destroy(),
this.subscribeEvents(),
this.setInitialStates({
nodes: this.tree
}, 0),
this.render()
}
,
g.prototype.remove = function() {
this.destroy(),
a.removeData(this, e),
a("#" + this.styleId).remove()
}
,
g.prototype.destroy = function() {
this.initialized && (this.$wrapper.remove(),
this.$wrapper = null,
this.unsubscribeEvents(),
this.initialized = !1)
}
,
g.prototype.unsubscribeEvents = function() {
this.$element.off("click"),
this.$element.off("nodeChecked"),
this.$element.off("nodeCollapsed"),
this.$element.off("nodeDisabled"),
this.$element.off("nodeEnabled"),
this.$element.off("nodeExpanded"),
this.$element.off("nodeSelected"),
this.$element.off("nodeUnchecked"),
this.$element.off("nodeUnselected"),
this.$element.off("searchComplete"),
this.$element.off("searchCleared")
}
,
g.prototype.subscribeEvents = function() {
this.unsubscribeEvents(),
this.$element.on("click", a.proxy(this.clickHandler, this)),
"function" == typeof this.options.onNodeChecked && this.$element.on("nodeChecked", this.options.onNodeChecked),
"function" == typeof this.options.onNodeCollapsed && this.$element.on("nodeCollapsed", this.options.onNodeCollapsed),
"function" == typeof this.options.onNodeDisabled && this.$element.on("nodeDisabled", this.options.onNodeDisabled),
"function" == typeof this.options.onNodeEnabled && this.$element.on("nodeEnabled", this.options.onNodeEnabled),
"function" == typeof this.options.onNodeExpanded && this.$element.on("nodeExpanded", this.options.onNodeExpanded),
"function" == typeof this.options.onNodeSelected && this.$element.on("nodeSelected", this.options.onNodeSelected),
"function" == typeof this.options.onNodeUnchecked && this.$element.on("nodeUnchecked", this.options.onNodeUnchecked),
"function" == typeof this.options.onNodeUnselected && this.$element.on("nodeUnselected", this.options.onNodeUnselected),
"function" == typeof this.options.onSearchComplete && this.$element.on("searchComplete", this.options.onSearchComplete),
"function" == typeof this.options.onSearchCleared && this.$element.on("searchCleared", this.options.onSearchCleared)
}
,
g.prototype.setInitialStates = function(b, c) {
if (b.nodes) {
c += 1;
var d = b
, e = this;
a.each(b.nodes, function(a, b) {
b.nodeId = e.nodes.length,
b.parentId = d.nodeId,
Object.prototype.hasOwnProperty.call(b, "selectable") || (b.selectable = !0),
b.state = b.state || {},
Object.prototype.hasOwnProperty.call(b.state, "checked") || (b.state.checked = !1),
Object.prototype.hasOwnProperty.call(b.state, "disabled") || (b.state.disabled = !1),
Object.prototype.hasOwnProperty.call(b.state, "expanded") || (!b.state.disabled && c < e.options.levels && b.nodes && b.nodes.length > 0 ? b.state.expanded = !0 : b.state.expanded = !1),
Object.prototype.hasOwnProperty.call(b.state, "selected") || (b.state.selected = !1),
e.nodes.push(b),
b.nodes && e.setInitialStates(b, c)
})
}
}
,
g.prototype.clickHandler = function(b) {
this.options.enableLinks || b.preventDefault();
var c = a(b.target)
, d = this.findNode(c);
if (d && !d.state.disabled) {
var e = c.attr("class") ? c.attr("class").split(" ") : [];
-1 !== e.indexOf("expand-icon") ? (this.toggleExpandedState(d, f.options),
this.render()) : -1 !== e.indexOf("check-icon") ? (this.toggleCheckedState(d, f.options),
this.render()) : (d.selectable ? this.toggleSelectedState(d, f.options) : this.toggleExpandedState(d, f.options),
this.render())
}
}
,
g.prototype.findNode = function(a) {
var b = a.closest("li.list-group-item").attr("data-nodeid")
, c = this.nodes[b];
return c || console.log("Error: node does not exist"),
c
}
,
g.prototype.toggleExpandedState = function(a, b) {
a && this.setExpandedState(a, !a.state.expanded, b)
}
,
g.prototype.setExpandedState = function(b, c, d) {
c !== b.state.expanded && (c && b.nodes ? (b.state.expanded = !0,
d.silent || this.$element.trigger("nodeExpanded", a.extend(!0, {}, b))) : c || (b.state.expanded = !1,
d.silent || this.$element.trigger("nodeCollapsed", a.extend(!0, {}, b)),
b.nodes && !d.ignoreChildren && a.each(b.nodes, a.proxy(function(a, b) {
this.setExpandedState(b, !1, d)
}, this))))
}
,
g.prototype.toggleSelectedState = function(a, b) {
a && this.setSelectedState(a, !a.state.selected, b)
}
,
g.prototype.setSelectedState = function(b, c, d) {
c !== b.state.selected && (c ? (this.options.multiSelect || a.each(this.findNodes("true", "g", "state.selected"), a.proxy(function(a, b) {
this.setSelectedState(b, !1, d)
}, this)),
b.state.selected = !0,
d.silent || this.$element.trigger("nodeSelected", a.extend(!0, {}, b))) : (b.state.selected = !1,
d.silent || this.$element.trigger("nodeUnselected", a.extend(!0, {}, b))))
}
,
g.prototype.toggleCheckedState = function(a, b) {
a && this.setCheckedState(a, !a.state.checked, b)
}
,
g.prototype.setCheckedState = function(b, c, d) {
c !== b.state.checked && (c ? (b.state.checked = !0,
d.silent || this.$element.trigger("nodeChecked", a.extend(!0, {}, b))) : (b.state.checked = !1,
d.silent || this.$element.trigger("nodeUnchecked", a.extend(!0, {}, b))))
}
,
g.prototype.setDisabledState = function(b, c, d) {
c !== b.state.disabled && (c ? (b.state.disabled = !0,
this.setExpandedState(b, !1, d),
this.setSelectedState(b, !1, d),
this.setCheckedState(b, !1, d),
d.silent || this.$element.trigger("nodeDisabled", a.extend(!0, {}, b))) : (b.state.disabled = !1,
d.silent || this.$element.trigger("nodeEnabled", a.extend(!0, {}, b))))
}
,
g.prototype.render = function() {
this.initialized || (this.$element.addClass(e),
this.$wrapper = a(this.template.list),
this.injectStyle(),
this.initialized = !0),
this.$element.empty().append(this.$wrapper.empty()),
this.buildTree(this.tree, 0)
}
,
g.prototype.buildTree = function(b, c) {
if (b) {
c += 1;
var d = this;
a.each(b, function(b, e) {
for (var f = a(d.template.item).addClass("node-" + d.elementId).addClass(e.state.checked ? "node-checked" : "").addClass(e.state.disabled ? "node-disabled" : "").addClass(e.state.selected ? "node-selected" : "").addClass(e.searchResult ? "search-result" : "").attr("data-nodeid", e.nodeId).attr("style", d.buildStyleOverride(e)), g = 0; c - 1 > g; g++)
f.append(d.template.indent);
var h = [];
if (e.nodes ? (h.push("expand-icon"),
h.push(e.state.expanded ? d.options.collapseIcon : d.options.expandIcon)) : h.push(d.options.emptyIcon),
f.append(a(d.template.icon).addClass(h.join(" "))),
d.options.showIcon) {
h = ["node-icon"];
h.push(e.icon || d.options.nodeIcon),
e.state.selected && (h.pop(),
h.push(e.selectedIcon || d.options.selectedIcon || e.icon || d.options.nodeIcon)),
f.append(a(d.template.icon).addClass(h.join(" ")))
}
if (d.options.showCheckbox) {
h = ["check-icon"];
h.push(e.state.checked ? d.options.checkedIcon : d.options.uncheckedIcon),
f.append(a(d.template.icon).addClass(h.join(" ")))
}
return f.append(d.options.enableLinks ? a(d.template.link).attr("href", e.href).append(e.text) : e.text),
d.options.showTags && e.tags && a.each(e.tags, function(b, c) {
f.append(a(d.template.badge).append(c))
}),
d.$wrapper.append(f),
e.nodes && e.state.expanded && !e.state.disabled ? d.buildTree(e.nodes, c) : void 0
})
}
}
,
g.prototype.buildStyleOverride = function(a) {
if (a.state.disabled)
return "";
var b = a.color
, c = a.backColor;
return this.options.highlightSelected && a.state.selected && (this.options.selectedColor && (b = this.options.selectedColor),
this.options.selectedBackColor && (c = this.options.selectedBackColor)),
this.options.highlightSearchResults && a.searchResult && !a.state.disabled && (this.options.searchResultColor && (b = this.options.searchResultColor),
this.options.searchResultBackColor && (c = this.options.searchResultBackColor)),
"color:" + b + ";background-color:" + c + ";"
}
,
g.prototype.injectStyle = function() {
this.options.injectStyle && !c.getElementById(this.styleId) && a('<style type="text/css" id="' + this.styleId + '"> ' + this.buildStyle() + " </style>").appendTo("head")
}
,
g.prototype.buildStyle = function() {
var a = ".node-" + this.elementId + "{";
return this.options.color && (a += "color:" + this.options.color + ";"),
this.options.backColor && (a += "background-color:" + this.options.backColor + ";"),
this.options.showBorder ? this.options.borderColor && (a += "border:1px solid " + this.options.borderColor + ";") : a += "border:none;",
a += "}",
this.options.onhoverColor && (a += ".node-" + this.elementId + ":not(.node-disabled):hover{background-color:" + this.options.onhoverColor + ";}"),
this.css + a
}
,
g.prototype.template = {
list: '<ul class="list-group"></ul>',
item: '<li class="list-group-item"></li>',
indent: '<span class="indent"></span>',
icon: '<span class="icon"></span>',
link: '<a href="#" style="color:inherit;"></a>',
badge: '<span class="badge"></span>'
},
g.prototype.css = ".treeview .list-group-item{cursor:pointer}.treeview span.indent{margin-left:10px;margin-right:10px}.treeview span.icon{width:12px;margin-right:5px}.treeview .node-disabled{color:silver;cursor:not-allowed}",
g.prototype.getNode = function(a) {
return this.nodes[a]
}
,
g.prototype.getParent = function(a) {
var b = this.identifyNode(a);
return this.nodes[b.parentId]
}
,
g.prototype.getSiblings = function(a) {
var b = this.identifyNode(a)
, c = this.getParent(b)
, d = c ? c.nodes : this.tree;
return d.filter(function(a) {
return a.nodeId !== b.nodeId
})
}
,
g.prototype.getSelected = function() {
return this.findNodes("true", "g", "state.selected")
}
,
g.prototype.getUnselected = function() {
return this.findNodes("false", "g", "state.selected")
}
,
g.prototype.getExpanded = function() {
return this.findNodes("true", "g", "state.expanded")
}
,
g.prototype.getCollapsed = function() {
return this.findNodes("false", "g", "state.expanded")
}
,
g.prototype.getChecked = function() {
return this.findNodes("true", "g", "state.checked")
}
,
g.prototype.getUnchecked = function() {
return this.findNodes("false", "g", "state.checked")
}
,
g.prototype.getDisabled = function() {
return this.findNodes("true", "g", "state.disabled")
}
,
g.prototype.getEnabled = function() {
return this.findNodes("false", "g", "state.disabled")
}
,
g.prototype.selectNode = function(b, c) {
this.forEachIdentifier(b, c, a.proxy(function(a, b) {
this.setSelectedState(a, !0, b)
}, this)),
this.render()
}
,
g.prototype.unselectNode = function(b, c) {
this.forEachIdentifier(b, c, a.proxy(function(a, b) {
this.setSelectedState(a, !1, b)
}, this)),
this.render()
}
,
g.prototype.toggleNodeSelected = function(b, c) {
this.forEachIdentifier(b, c, a.proxy(function(a, b) {
this.toggleSelectedState(a, b)
}, this)),
this.render()
}
,
g.prototype.collapseAll = function(b) {
var c = this.findNodes("true", "g", "state.expanded");
this.forEachIdentifier(c, b, a.proxy(function(a, b) {
this.setExpandedState(a, !1, b)
}, this)),
this.render()
}
,
g.prototype.collapseNode = function(b, c) {
this.forEachIdentifier(b, c, a.proxy(function(a, b) {
this.setExpandedState(a, !1, b)
}, this)),
this.render()
}
,
g.prototype.expandAll = function(b) {
if (b = a.extend({}, f.options, b),
b && b.levels)
this.expandLevels(this.tree, b.levels, b);
else {
var c = this.findNodes("false", "g", "state.expanded");
this.forEachIdentifier(c, b, a.proxy(function(a, b) {
this.setExpandedState(a, !0, b)
}, this))
}
this.render()
}
,
g.prototype.expandNode = function(b, c) {
this.forEachIdentifier(b, c, a.proxy(function(a, b) {
this.setExpandedState(a, !0, b),
a.nodes && b && b.levels && this.expandLevels(a.nodes, b.levels - 1, b)
}, this)),
this.render()
}
,
g.prototype.expandLevels = function(b, c, d) {
d = a.extend({}, f.options, d),
a.each(b, a.proxy(function(a, b) {
this.setExpandedState(b, c > 0 ? !0 : !1, d),
b.nodes && this.expandLevels(b.nodes, c - 1, d)
}, this))
}
,
g.prototype.revealNode = function(b, c) {
this.forEachIdentifier(b, c, a.proxy(function(a, b) {
for (var c = this.getParent(a); c; )
this.setExpandedState(c, !0, b),
c = this.getParent(c)
}, this)),
this.render()
}
,
g.prototype.toggleNodeExpanded = function(b, c) {
this.forEachIdentifier(b, c, a.proxy(function(a, b) {
this.toggleExpandedState(a, b)
}, this)),
this.render()
}
,
g.prototype.checkAll = function(b) {
var c = this.findNodes("false", "g", "state.checked");
this.forEachIdentifier(c, b, a.proxy(function(a, b) {
this.setCheckedState(a, !0, b)
}, this)),
this.render()
}
,
g.prototype.checkNode = function(b, c) {
this.forEachIdentifier(b, c, a.proxy(function(a, b) {
this.setCheckedState(a, !0, b)
}, this)),
this.render()
}
,
g.prototype.uncheckAll = function(b) {
var c = this.findNodes("true", "g", "state.checked");
this.forEachIdentifier(c, b, a.proxy(function(a, b) {
this.setCheckedState(a, !1, b)
}, this)),
this.render()
}
,
g.prototype.uncheckNode = function(b, c) {
this.forEachIdentifier(b, c, a.proxy(function(a, b) {
this.setCheckedState(a, !1, b)
}, this)),
this.render()
}
,
g.prototype.toggleNodeChecked = function(b, c) {
this.forEachIdentifier(b, c, a.proxy(function(a, b) {
this.toggleCheckedState(a, b)
}, this)),
this.render()
}
,
g.prototype.disableAll = function(b) {
var c = this.findNodes("false", "g", "state.disabled");
this.forEachIdentifier(c, b, a.proxy(function(a, b) {
this.setDisabledState(a, !0, b)
}, this)),
this.render()
}
,
g.prototype.disableNode = function(b, c) {
this.forEachIdentifier(b, c, a.proxy(function(a, b) {
this.setDisabledState(a, !0, b)
}, this)),
this.render()
}
,
g.prototype.enableAll = function(b) {
var c = this.findNodes("true", "g", "state.disabled");
this.forEachIdentifier(c, b, a.proxy(function(a, b) {
this.setDisabledState(a, !1, b)
}, this)),
this.render()
}
,
g.prototype.enableNode = function(b, c) {
this.forEachIdentifier(b, c, a.proxy(function(a, b) {
this.setDisabledState(a, !1, b)
}, this)),
this.render()
}
,
g.prototype.toggleNodeDisabled = function(b, c) {
this.forEachIdentifier(b, c, a.proxy(function(a, b) {
this.setDisabledState(a, !a.state.disabled, b)
}, this)),
this.render()
}
,
g.prototype.forEachIdentifier = function(b, c, d) {
c = a.extend({}, f.options, c),
b instanceof Array || (b = [b]),
a.each(b, a.proxy(function(a, b) {
d(this.identifyNode(b), c)
}, this))
}
,
g.prototype.identifyNode = function(a) {
return "number" == typeof a ? this.nodes[a] : a
}
,
g.prototype.search = function(b, c) {
c = a.extend({}, f.searchOptions, c),
this.clearSearch({
render: !1
});
var d = [];
if (b && b.length > 0) {
c.exactMatch && (b = "^" + b + "$");
var e = "g";
c.ignoreCase && (e += "i"),
d = this.findNodes(b, e),
a.each(d, function(a, b) {
b.searchResult = !0
})
}
return c.revealResults ? this.revealNode(d) : this.render(),
this.$element.trigger("searchComplete", a.extend(!0, {}, d)),
d
}
,
g.prototype.clearSearch = function(b) {
b = a.extend({}, {
render: !0
}, b);
var c = a.each(this.findNodes("true", "g", "searchResult"), function(a, b) {
b.searchResult = !1
});
b.render && this.render(),
this.$element.trigger("searchCleared", a.extend(!0, {}, c))
}
,
g.prototype.findNodes = function(b, c, d) {
c = c || "g",
d = d || "text";
var e = this;
return a.grep(this.nodes, function(a) {
var f = e.getNodeValue(a, d);
return "string" == typeof f ? f.match(new RegExp(b,c)) : void 0
})
}
,
g.prototype.getNodeValue = function(a, b) {
var c = b.indexOf(".");
if (c > 0) {
var e = a[b.substring(0, c)]
, f = b.substring(c + 1, b.length);
return this.getNodeValue(e, f)
}
return Object.prototype.hasOwnProperty.call(a, b) ? a[b].toString() : d
}
;
var h = function(a) {
b.console && b.console.error(a)
};
a.fn[e] = function(b, c) {
var d;
return this.each(function() {
var f = a.data(this, e);
"string" == typeof b ? f ? a.isFunction(f[b]) && "_" !== b.charAt(0) ? (c instanceof Array || (c = [c]),
d = f[b].apply(f, c)) : h("No such method : " + b) : h("Not initialized, can not call method : " + b) : "boolean" == typeof b ? d = f : a.data(this, e, new g(this,a.extend(!0, {}, b)))
}),
d || this
}
}(jQuery, window, document);

View File

@@ -0,0 +1,562 @@
/*!
* clipboard.js v1.7.1
* https://zenorocha.github.io/clipboard.js
*
* Licensed MIT © Zeno Rocha
*/
!function(t) {
var define;
if ("object" == typeof exports && "undefined" != typeof module)
module.exports = t();
else if ("function" == typeof define && define.amd)
define([], t);
else {
var e;
e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this,
e.Clipboard = t()
}
}(function() {
var t, e, n;
return function t(e, n, o) {
function i(a, c) {
if (!n[a]) {
if (!e[a]) {
var l = "function" == typeof require && require;
if (!c && l)
return l(a, !0);
if (r)
return r(a, !0);
var s = new Error("Cannot find module '" + a + "'");
throw s.code = "MODULE_NOT_FOUND",
s
}
var u = n[a] = {
exports: {}
};
e[a][0].call(u.exports, function(t) {
var n = e[a][1][t];
return i(n || t)
}, u, u.exports, t, e, n, o)
}
return n[a].exports
}
for (var r = "function" == typeof require && require, a = 0; a < o.length; a++)
i(o[a]);
return i
}({
1: [function(t, e, n) {
function o(t, e) {
for (; t && t.nodeType !== i; ) {
if ("function" == typeof t.matches && t.matches(e))
return t;
t = t.parentNode
}
}
var i = 9;
if ("undefined" != typeof Element && !Element.prototype.matches) {
var r = Element.prototype;
r.matches = r.matchesSelector || r.mozMatchesSelector || r.msMatchesSelector || r.oMatchesSelector || r.webkitMatchesSelector
}
e.exports = o
}
, {}],
2: [function(t, e, n) {
function o(t, e, n, o, r) {
var a = i.apply(this, arguments);
return t.addEventListener(n, a, r),
{
destroy: function() {
t.removeEventListener(n, a, r)
}
}
}
function i(t, e, n, o) {
return function(n) {
n.delegateTarget = r(n.target, e),
n.delegateTarget && o.call(t, n)
}
}
var r = t("./closest");
e.exports = o
}
, {
"./closest": 1
}],
3: [function(t, e, n) {
n.node = function(t) {
return void 0 !== t && t instanceof HTMLElement && 1 === t.nodeType
}
,
n.nodeList = function(t) {
var e = Object.prototype.toString.call(t);
return void 0 !== t && ("[object NodeList]" === e || "[object HTMLCollection]" === e) && "length"in t && (0 === t.length || n.node(t[0]))
}
,
n.string = function(t) {
return "string" == typeof t || t instanceof String
}
,
n.fn = function(t) {
return "[object Function]" === Object.prototype.toString.call(t)
}
}
, {}],
4: [function(t, e, n) {
function o(t, e, n) {
if (!t && !e && !n)
throw new Error("Missing required arguments");
if (!c.string(e))
throw new TypeError("Second argument must be a String");
if (!c.fn(n))
throw new TypeError("Third argument must be a Function");
if (c.node(t))
return i(t, e, n);
if (c.nodeList(t))
return r(t, e, n);
if (c.string(t))
return a(t, e, n);
throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")
}
function i(t, e, n) {
return t.addEventListener(e, n),
{
destroy: function() {
t.removeEventListener(e, n)
}
}
}
function r(t, e, n) {
return Array.prototype.forEach.call(t, function(t) {
t.addEventListener(e, n)
}),
{
destroy: function() {
Array.prototype.forEach.call(t, function(t) {
t.removeEventListener(e, n)
})
}
}
}
function a(t, e, n) {
return l(document.body, t, e, n)
}
var c = t("./is")
, l = t("delegate");
e.exports = o
}
, {
"./is": 3,
delegate: 2
}],
5: [function(t, e, n) {
function o(t) {
var e;
if ("SELECT" === t.nodeName)
t.focus(),
e = t.value;
else if ("INPUT" === t.nodeName || "TEXTAREA" === t.nodeName) {
var n = t.hasAttribute("readonly");
n || t.setAttribute("readonly", ""),
t.select(),
t.setSelectionRange(0, t.value.length),
n || t.removeAttribute("readonly"),
e = t.value
} else {
t.hasAttribute("contenteditable") && t.focus();
var o = window.getSelection()
, i = document.createRange();
i.selectNodeContents(t),
o.removeAllRanges(),
o.addRange(i),
e = o.toString()
}
return e
}
e.exports = o
}
, {}],
6: [function(t, e, n) {
function o() {}
o.prototype = {
on: function(t, e, n) {
var o = this.e || (this.e = {});
return (o[t] || (o[t] = [])).push({
fn: e,
ctx: n
}),
this
},
once: function(t, e, n) {
function o() {
i.off(t, o),
e.apply(n, arguments)
}
var i = this;
return o._ = e,
this.on(t, o, n)
},
emit: function(t) {
var e = [].slice.call(arguments, 1)
, n = ((this.e || (this.e = {}))[t] || []).slice()
, o = 0
, i = n.length;
for (o; o < i; o++)
n[o].fn.apply(n[o].ctx, e);
return this
},
off: function(t, e) {
var n = this.e || (this.e = {})
, o = n[t]
, i = [];
if (o && e)
for (var r = 0, a = o.length; r < a; r++)
o[r].fn !== e && o[r].fn._ !== e && i.push(o[r]);
return i.length ? n[t] = i : delete n[t],
this
}
},
e.exports = o
}
, {}],
7: [function(e, n, o) {
!function(i, r) {
if ("function" == typeof t && t.amd)
t(["module", "select"], r);
else if (void 0 !== o)
r(n, e("select"));
else {
var a = {
exports: {}
};
r(a, i.select),
i.clipboardAction = a.exports
}
}(this, function(t, e) {
"use strict";
function n(t) {
return t && t.__esModule ? t : {
default: t
}
}
function o(t, e) {
if (!(t instanceof e))
throw new TypeError("Cannot call a class as a function")
}
var i = n(e)
, r = "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
}
, a = function() {
function t(t, e) {
for (var n = 0; n < e.length; n++) {
var o = e[n];
o.enumerable = o.enumerable || !1,
o.configurable = !0,
"value"in o && (o.writable = !0),
Object.defineProperty(t, o.key, o)
}
}
return function(e, n, o) {
return n && t(e.prototype, n),
o && t(e, o),
e
}
}()
, c = function() {
function t(e) {
o(this, t),
this.resolveOptions(e),
this.initSelection()
}
return a(t, [{
key: "resolveOptions",
value: function t() {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
this.action = e.action,
this.container = e.container,
this.emitter = e.emitter,
this.target = e.target,
this.text = e.text,
this.trigger = e.trigger,
this.selectedText = ""
}
}, {
key: "initSelection",
value: function t() {
this.text ? this.selectFake() : this.target && this.selectTarget()
}
}, {
key: "selectFake",
value: function t() {
var e = this
, n = "rtl" == document.documentElement.getAttribute("dir");
this.removeFake(),
this.fakeHandlerCallback = function() {
return e.removeFake()
}
,
this.fakeHandler = this.container.addEventListener("click", this.fakeHandlerCallback) || !0,
this.fakeElem = document.createElement("textarea"),
this.fakeElem.style.fontSize = "12pt",
this.fakeElem.style.border = "0",
this.fakeElem.style.padding = "0",
this.fakeElem.style.margin = "0",
this.fakeElem.style.position = "absolute",
this.fakeElem.style[n ? "right" : "left"] = "-9999px";
var o = window.pageYOffset || document.documentElement.scrollTop;
this.fakeElem.style.top = o + "px",
this.fakeElem.setAttribute("readonly", ""),
this.fakeElem.value = this.text,
this.container.appendChild(this.fakeElem),
this.selectedText = (0,
i.default)(this.fakeElem),
this.copyText()
}
}, {
key: "removeFake",
value: function t() {
this.fakeHandler && (this.container.removeEventListener("click", this.fakeHandlerCallback),
this.fakeHandler = null,
this.fakeHandlerCallback = null),
this.fakeElem && (this.container.removeChild(this.fakeElem),
this.fakeElem = null)
}
}, {
key: "selectTarget",
value: function t() {
this.selectedText = (0,
i.default)(this.target),
this.copyText()
}
}, {
key: "copyText",
value: function t() {
var e = void 0;
try {
e = document.execCommand(this.action)
} catch (t) {
e = !1
}
this.handleResult(e)
}
}, {
key: "handleResult",
value: function t(e) {
this.emitter.emit(e ? "success" : "error", {
action: this.action,
text: this.selectedText,
trigger: this.trigger,
clearSelection: this.clearSelection.bind(this)
})
}
}, {
key: "clearSelection",
value: function t() {
this.trigger && this.trigger.focus(),
window.getSelection().removeAllRanges()
}
}, {
key: "destroy",
value: function t() {
this.removeFake()
}
}, {
key: "action",
set: function t() {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "copy";
if (this._action = e,
"copy" !== this._action && "cut" !== this._action)
throw new Error('Invalid "action" value, use either "copy" or "cut"')
},
get: function t() {
return this._action
}
}, {
key: "target",
set: function t(e) {
if (void 0 !== e) {
if (!e || "object" !== (void 0 === e ? "undefined" : r(e)) || 1 !== e.nodeType)
throw new Error('Invalid "target" value, use a valid Element');
if ("copy" === this.action && e.hasAttribute("disabled"))
throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
if ("cut" === this.action && (e.hasAttribute("readonly") || e.hasAttribute("disabled")))
throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
this._target = e
}
},
get: function t() {
return this._target
}
}]),
t
}();
t.exports = c
})
}
, {
select: 5
}],
8: [function(e, n, o) {
!function(i, r) {
if ("function" == typeof t && t.amd)
t(["module", "./clipboard-action", "tiny-emitter", "good-listener"], r);
else if (void 0 !== o)
r(n, e("./clipboard-action"), e("tiny-emitter"), e("good-listener"));
else {
var a = {
exports: {}
};
r(a, i.clipboardAction, i.tinyEmitter, i.goodListener),
i.clipboard = a.exports
}
}(this, function(t, e, n, o) {
"use strict";
function i(t) {
return t && t.__esModule ? t : {
default: t
}
}
function r(t, e) {
if (!(t instanceof e))
throw new TypeError("Cannot call a class as a function")
}
function a(t, e) {
if (!t)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !e || "object" != typeof e && "function" != typeof e ? t : e
}
function c(t, e) {
if ("function" != typeof e && null !== e)
throw new TypeError("Super expression must either be null or a function, not " + typeof e);
t.prototype = Object.create(e && e.prototype, {
constructor: {
value: t,
enumerable: !1,
writable: !0,
configurable: !0
}
}),
e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e)
}
function l(t, e) {
var n = "data-clipboard-" + t;
if (e.hasAttribute(n))
return e.getAttribute(n)
}
var s = i(e)
, u = i(n)
, f = i(o)
, d = "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
}
, h = function() {
function t(t, e) {
for (var n = 0; n < e.length; n++) {
var o = e[n];
o.enumerable = o.enumerable || !1,
o.configurable = !0,
"value"in o && (o.writable = !0),
Object.defineProperty(t, o.key, o)
}
}
return function(e, n, o) {
return n && t(e.prototype, n),
o && t(e, o),
e
}
}()
, p = function(t) {
function e(t, n) {
r(this, e);
var o = a(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this));
return o.resolveOptions(n),
o.listenClick(t),
o
}
return c(e, t),
h(e, [{
key: "resolveOptions",
value: function t() {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
this.action = "function" == typeof e.action ? e.action : this.defaultAction,
this.target = "function" == typeof e.target ? e.target : this.defaultTarget,
this.text = "function" == typeof e.text ? e.text : this.defaultText,
this.container = "object" === d(e.container) ? e.container : document.body
}
}, {
key: "listenClick",
value: function t(e) {
var n = this;
this.listener = (0,
f.default)(e, "click", function(t) {
return n.onClick(t)
})
}
}, {
key: "onClick",
value: function t(e) {
var n = e.delegateTarget || e.currentTarget;
this.clipboardAction && (this.clipboardAction = null),
this.clipboardAction = new s.default({
action: this.action(n),
target: this.target(n),
text: this.text(n),
container: this.container,
trigger: n,
emitter: this
})
}
}, {
key: "defaultAction",
value: function t(e) {
return l("action", e)
}
}, {
key: "defaultTarget",
value: function t(e) {
var n = l("target", e);
if (n)
return document.querySelector(n)
}
}, {
key: "defaultText",
value: function t(e) {
return l("text", e)
}
}, {
key: "destroy",
value: function t() {
this.listener.destroy(),
this.clipboardAction && (this.clipboardAction.destroy(),
this.clipboardAction = null)
}
}], [{
key: "isSupported",
value: function t() {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ["copy", "cut"]
, n = "string" == typeof e ? [e] : e
, o = !!document.queryCommandSupported;
return n.forEach(function(t) {
o = o && !!document.queryCommandSupported(t)
}),
o
}
}]),
e
}(u.default);
t.exports = p
})
}
, {
"./clipboard-action": 7,
"good-listener": 4,
"tiny-emitter": 6
}]
}, {}, [8])(8)
});

View File

@@ -0,0 +1,196 @@
/* Z-INDEX */
.formError {
z-index: 990;
}
.formError .formErrorContent {
z-index: 991;
}
.formError .formErrorArrow {
z-index: 996;
}
.ui-dialog .formError {
z-index: 5000;
}
.ui-dialog .formError .formErrorContent {
z-index: 5001;
}
.ui-dialog .formError .formErrorArrow {
z-index: 5006;
}
.inputContainer {
position: relative;
float: left;
}
.formError {
position: absolute;
top: 300px;
left: 300px;
display: block;
cursor: pointer;
text-align: left;
}
.formError.inline {
position: relative;
top: 0;
left: 0;
display: inline-block;
}
.ajaxSubmit {
padding: 20px;
background: #55ea55;
border: 1px solid #999;
display: none;
}
.formError .formErrorContent {
width: 100%;
background: #ee0101;
position: relative;
color: #fff;
min-width: 120px;
font-size: 11px;
border: 2px solid #ddd;
box-shadow: 0 0 6px #000;
-moz-box-shadow: 0 0 6px #000;
-webkit-box-shadow: 0 0 6px #000;
-o-box-shadow: 0 0 6px #000;
padding: 4px 10px 4px 10px;
border-radius: 6px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
-o-border-radius: 6px;
}
.formError.inline .formErrorContent {
box-shadow: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
-o-box-shadow: none;
border: none;
border-radius: 0;
-moz-border-radius: 0;
-webkit-border-radius: 0;
-o-border-radius: 0;
}
.greenPopup .formErrorContent {
background: #33be40;
}
.blackPopup .formErrorContent {
background: #393939;
color: #FFF;
}
.formError .formErrorArrow {
width: 15px;
margin: -2px 0 0 13px;
position: relative;
}
body[dir='rtl'] .formError .formErrorArrow,
body.rtl .formError .formErrorArrow {
margin: -2px 13px 0 0;
}
.formError .formErrorArrowBottom {
box-shadow: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
-o-box-shadow: none;
margin: 0px 0 0 12px;
top: 2px;
}
.formError .formErrorArrow div {
border-left: 2px solid #ddd;
border-right: 2px solid #ddd;
box-shadow: 0 2px 3px #444;
-moz-box-shadow: 0 2px 3px #444;
-webkit-box-shadow: 0 2px 3px #444;
-o-box-shadow: 0 2px 3px #444;
font-size: 0px;
height: 1px;
background: #ee0101;
margin: 0 auto;
line-height: 0;
font-size: 0;
display: block;
}
.formError .formErrorArrowBottom div {
box-shadow: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
-o-box-shadow: none;
}
.greenPopup .formErrorArrow div {
background: #33be40;
}
.blackPopup .formErrorArrow div {
background: #393939;
color: #FFF;
}
.formError .formErrorArrow .line10 {
width: 13px;
border: none;
}
.formError .formErrorArrow .line9 {
width: 11px;
border: none;
}
.formError .formErrorArrow .line8 {
width: 11px;
}
.formError .formErrorArrow .line7 {
width: 9px;
}
.formError .formErrorArrow .line6 {
width: 7px;
}
.formError .formErrorArrow .line5 {
width: 5px;
}
.formError .formErrorArrow .line4 {
width: 3px;
}
.formError .formErrorArrow .line3 {
width: 1px;
border-left: 2px solid #ddd;
border-right: 2px solid #ddd;
border-bottom: 0 solid #ddd;
}
.formError .formErrorArrow .line2 {
width: 3px;
border: none;
background: #ddd;
}
.formError .formErrorArrow .line1 {
width: 1px;
border: none;
background: #ddd;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,181 @@
(function ($) {
$.fn.validationEngineLanguage = function () {
};
$.validationEngineLanguage = {
newLang: function () {
$.validationEngineLanguage.allRules = {
"required": { // Add your regex rules here, you can take telephone as an example
"regex": "none",
"alertText": "* 此处不可空白",
"alertTextCheckboxMultiple": "* 请选择一个项目",
"alertTextCheckboxe": "* 您必须钩选此栏",
"alertTextDateRange": "* 日期范围不可空白"
},
"requiredInFunction": {
"func": function (field, rules, i, options) {
return (field.val() == "test") ? true : false;
},
"alertText": "* Field must equal test"
},
"dateRange": {
"regex": "none",
"alertText": "* 无效的 ",
"alertText2": " 日期范围"
},
"dateTimeRange": {
"regex": "none",
"alertText": "* 无效的 ",
"alertText2": " 时间范围"
},
"minSize": {
"regex": "none",
"alertText": "* 最少 ",
"alertText2": " 个字符"
},
"maxSize": {
"regex": "none",
"alertText": "* 最多 ",
"alertText2": " 个字符"
},
"groupRequired": {
"regex": "none",
"alertText": "* 你必需选填其中一个栏位"
},
"min": {
"regex": "none",
"alertText": "* 最小值為 "
},
"max": {
"regex": "none",
"alertText": "* 最大值为 "
},
"past": {
"regex": "none",
"alertText": "* 日期必需早于 "
},
"future": {
"regex": "none",
"alertText": "* 日期必需晚于 "
},
"maxCheckbox": {
"regex": "none",
"alertText": "* 最多选取 ",
"alertText2": " 个项目"
},
"minCheckbox": {
"regex": "none",
"alertText": "* 请选择 ",
"alertText2": " 个项目"
},
"equals": {
"regex": "none",
"alertText": "* 请输入与上面相同的密码"
},
"creditCard": {
"regex": "none",
"alertText": "* 无效的信用卡号码"
},
"phone": {
// credit: jquery.h5validate.js / orefalo
"regex": /^([\+][0-9]{1,3}([ \.\-])?)?([\(][0-9]{1,6}[\)])?([0-9 \.\-]{1,32})(([A-Za-z \:]{1,11})?[0-9]{1,4}?)$/,
"alertText": "* 无效的电话号码"
},
"email": {
// Shamelessly lifted from Scott Gonzalez via the Bassistance Validation plugin http://projects.scottsplayground.com/email_address_validation/
"regex": /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,
"alertText": "* 邮件地址无效"
},
"integer": {
"regex": /^[\-\+]?\d+$/,
"alertText": "* 不是有效的整数"
},
"number": {
// Number, including positive, negative, and floating decimal. credit: orefalo
"regex": /^[\-\+]?((([0-9]{1,3})([,][0-9]{3})*)|([0-9]+))?([\.]([0-9]+))?$/,
"alertText": "* 无效的数字"
},
"date": {
"regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/,
"alertText": "* 无效的日期,格式必需为 YYYY-MM-DD"
},
"ipv4": {
"regex": /^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))[.]){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/,
"alertText": "* 无效的 IP 地址"
},
"url": {
"regex": /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,
"alertText": "* Invalid URL"
},
"onlyNumberSp": {
"regex": /^[0-9\ ]+$/,
"alertText": "* 只能填数字"
},
"onlyLetterSp": {
"regex": /^[a-zA-Z\ \']+$/,
"alertText": "* 只接受英文字母大小写"
},
"onlyLetterAccentSp": {
"regex": /^[a-z\u00C0-\u017F\ ]+$/i,
"alertText": "* 只接受英文字母大小写"
},
"onlyLetterNumber": {
"regex": /^[0-9a-zA-Z]+$/,
"alertText": "* 不接受特殊字符"
},
// --- CUSTOM RULES -- Those are specific to the demos, they can be removed or changed to your likings
"ajaxUserCall": {
"url": "ajaxValidateFieldUser",
// you may want to pass extra data on the ajax call
"extraData": "name=eric",
"alertText": "* 此名称已被其他人使用",
"alertTextLoad": "* 正在确认名称是否有其他人使用,请稍等。"
},
"ajaxUserCallPhp": {
"url": "phpajax/ajaxValidateFieldUser.php",
// you may want to pass extra data on the ajax call
"extraData": "name=eric",
// if you provide an "alertTextOk", it will show as a green prompt when the field validates
"alertTextOk": "* 此帐号名称可以使用",
"alertText": "* 此名称已被其他人使用",
"alertTextLoad": "* 正在确认帐号名称是否有其他人使用,请稍等。"
},
"ajaxNameCall": {
// remote json service location
"url": "ajaxValidateFieldName",
// error
"alertText": "* 此名称可以使用",
// if you provide an "alertTextOk", it will show as a green prompt when the field validates
"alertTextOk": "* 此名称已被其他人使用",
// speaks by itself
"alertTextLoad": "* 正在确认名称是否有其他人使用,请稍等。"
},
"ajaxNameCallPhp": {
// remote json service location
"url": "phpajax/ajaxValidateFieldName.php",
// error
"alertText": "* 此名称已被其他人使用",
// speaks by itself
"alertTextLoad": "* 正在确认名称是否有其他人使用,请稍等。"
},
"validate2fields": {
"alertText": "* 请输入 HELLO"
},
//tls warning:homegrown not fielded
"dateFormat": {
"regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(?:(?:0?[1-9]|1[0-2])(\/|-)(?:0?[1-9]|1\d|2[0-8]))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(0?2(\/|-)29)(\/|-)(?:(?:0[48]00|[13579][26]00|[2468][048]00)|(?:\d\d)?(?:0[48]|[2468][048]|[13579][26]))$/,
"alertText": "* 无效的日期格式"
},
//tls warning:homegrown not fielded
"dateTimeFormat": {
"regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1}$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^((1[012]|0?[1-9]){1}\/(0?[1-9]|[12][0-9]|3[01]){1}\/\d{2,4}\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1})$/,
"alertText": "* 无效的日期或时间格式",
"alertText2": "可接受的格式: ",
"alertText3": "mm/dd/yyyy hh:mm:ss AM|PM 或 ",
"alertText4": "yyyy-mm-dd hh:mm:ss AM|PM"
}
};
}
};
$.validationEngineLanguage.newLang();
})(jQuery);

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,20 @@
<template>
<footer class="main-footer">
<div class="pull-right hidden-xs">
<b>Version</b> 2.0.0
</div>
<strong>Copyright &copy; 2023 <a href="">触海网络</a>.</strong> All rights
reserved.
</footer>
</template>
<script>
export default {
name: 'FooterView',
components: {
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,95 @@
<template>
<!-- Main Header -->
<header class="main-header">
<!-- Logo -->
<a class="logo">
<!-- mini logo for sidebar mini 50x50 pixels -->
<span class="logo-mini"><b>Y</b>M</span>
<!-- logo for regular state and mobile devices -->
<span class="logo-lg"><b>音萌</b>管理系统</span>
</a>
<!-- Header Navbar: style can be found in header.less -->
<nav class="navbar navbar-static-top" role="navigation">
<!-- Sidebar toggle button-->
<a class="sidebar-toggle" data-toggle="offcanvas" role="button">
<span class="sr-only">Toggle navigation</span>
</a>
<!-- Navbar Right Menu -->
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<!-- User Account: style can be found in dropdown.less -->
<li class="dropdown user user-menu">
<a class="dropdown-toggle" data-toggle="dropdown" style="height:50px;">
<img :src="avatar" class="user-image" :alt="username">
<span class="hidden-xs"><span :text="username">{{ username }}</span></span>
</a>
<ul class="dropdown-menu">
<!-- User image -->
<li class="user-header">
<img :src="avatar" class="img-circle" :alt="username" />
<p>
<span :text="username">{{ username }}</span>
<small>上次登录<span :text="lastTime">{{ lastTime }}</span></small>
</p>
</li>
<!-- Menu Footer-->
<li class="user-footer">
<div class="pull-right">
<a @click="logout" class="btn btn-default btn-flat" id="signOut">退出</a>
</div>
</li>
</ul>
</li>
</ul>
</div>
</nav>
</header>
<!-- Left side column. contains the logo and sidebar -->
<aside class="main-sidebar">
<!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar">
<!-- Sidebar user panel -->
<div class="user-panel">
<div class="pull-left image">
<img :src="avatar" class="img-circle" :alt="username">
</div>
<div class="pull-left info">
<p><span :text="username">{{ username }}</span></p>
<a><i class="fa fa-circle text-success"></i> Online</a>
</div>
</div>
<ul class="sidebar-menu" id="mainMenu">
<li class="header">MAIN NAVIGATION</li>
</ul>
</section>
<!-- /.sidebar -->
</aside>
</template>
<script>
import store from '@/store';
export default {
name: 'HeaderView',
data() {
return {
username: "",
avatar: "",
lastTime: ""
};
},
created() {
this.username = store.getters.username;
this.avatar = store.getters.avatar;
this.lastTime = store.getters.lastTime;
},
methods: {
logout() {
store.dispatch('logout');
}
}
}
</script>
<style scoped></style>

View File

@@ -0,0 +1,209 @@
<template>
<!-- Left side column. contains the logo and sidebar -->
<aside class="main-sidebar" style="height: 100%; overflow: hidden; overflow: scroll;">
<!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar">
<!-- Sidebar user panel (optional) -->
<div class="user-panel">
<div class="pull-left image">
<img :src="avatar" class="img-circle" :alt="username">
</div>
<div class="pull-left info">
<p>{{ username }}</p>
<!-- Status -->
<a href="#"><i class="fa fa-circle text-success"></i> Online</a>
</div>
</div>
<!-- search form (Optional) -->
<form method="get" class="sidebar-form" onsubmit="return false;">
<div class="input-group">
<input type="text" name="q" class="form-control" placeholder="Search..." @input="search">
<span class="input-group-btn">
<button name="search" id="search-btn" class="btn btn-flat" @click="search">
<i class="fa fa-search"></i>
</button>
</span>
</div>
</form>
<!-- /.search form -->
<!-- Sidebar Menu -->
<ul class="sidebar-menu">
<li class="header">主导航</li>
<!-- Optionally, you can add icons to the links -->
<li v-for="(parent, parentIndex) in parentMenus" :key="parent" :data-index="parentIndex" class="treeview">
<a>
<i :class="[parent.icon ? parent.icon : 'fa fa-link']"></i>
<span>{{ parent.name }}</span>
<span class="label pull-right bg-yellow" :id="['ic' + parent.id]">
{{ getChildLength(parent.id) }}
</span>
</a>
<ul class="treeview-menu" :id="['menu' + parent.id]">
<li v-for="(child, childIndex) in getChilds(parent.id)" :key="child" :data-index="childIndex">
<a :data-url="child.path" @click="handleClick(child)">
<i
:class="[child.icon && child.icon != '' ? child.icon : 'fa fa-circle-o text-yellow']"></i>
<span>{{ child.name }}</span>
</a>
</li>
</ul>
</li>
</ul>
<!-- /.sidebar-menu -->
</section>
<!-- /.sidebar -->
</aside>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper" style="height: 100%;">
<!-- Content Header (Page header) -->
<section class="content-header"
:style="[childMenu.name && childMenu.name != '' ? 'display:block;' : 'display:none;']">
<h1>
{{ childMenu.name }}
<small>{{ childMenu.description }}</small>
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> {{ childMenu.parentName }}</a></li>
<li class="active">{{ childMenu.name }}</li>
</ol>
</section>
<!-- Main content -->
<section class="content" style="height: 100%; overflow: hidden; overflow: scroll;">
<!-- Your Page Content Here -->
<component :is="componentName"></component>
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">提示信息</h4>
</div>
<div class="modal-body" id="tipMsg"></div>
</div>
</div>
</div>
<div class="modal fade" id="confirmModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel"
data-backdrop="static">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">确认信息</h4>
</div>
<div class="modal-body" id="confirmMsg"></div>
</div>
</div>
</div>
<div class="modal fade loading" style="background: #00000040;" tabindex="-1" role="dialog"
aria-labelledby="loadingModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
<div class="loadingGif" style="position: fixed;"><img :src="loading"></div>
</div>
</template>
<script>
import store from '@/store';
import { getStore } from '@/utils/store';
import loading from '@/assets/images/loading.gif';
export default {
name: 'MaintainerView',
data() {
return {
componentName: "",
username: "",
avatar: "",
parentMenus: [],
childMenus: [],
childMenu: {
name: "",
parentName: "",
description: "",
}
};
},
created() {
this.getMenu();
this.username = store.getters.username;
this.avatar = store.getters.avatar;
},
methods: {
getMenu() {
let parentMenus = getStore({ name: 'parent_menus' });
let childMenus = getStore({ name: 'child_menus' });
if (parentMenus && childMenus && parentMenus.length > 0 && childMenus.length > 0) {
this.parentMenus = parentMenus;
this.childMenus = childMenus;
} else {
store.dispatch('getMenu').then(res => {
this.parentMenus = res.parents;
this.childMenus = res.childs;
});
}
},
getChilds(parentId) {
return this.childMenus.filter(v => v.parentid == parentId);
},
getChildLength(parentId) {
return this.childMenus.filter(v => v.parentid == parentId).length;
},
handleClick(menu) {
this.childMenu.name = menu.name;
this.childMenu.parentName = menu.parentstr;
this.childMenu.description = menu.description;
store.dispatch('getViewComponent', menu.path).then(componentName => {
console.log(componentName);
this.componentName = componentName;
});
},
search() {
let text = $("input[type='text']").val();
this.childMenus = store.getters.childMenus.filter(v => v.name.indexOf(text) >= 0);
if (!this.childMenus.length || this.childMenus.length == 0) {
this.parentMenus = store.getters.parentMenus.filter(v => v.name.indexOf(text) >= 0);
} else {
let parentIds = this.childMenus.map(v => v.parentid);
let parentMenus = store.getters.parentMenus.filter(v => v.name.indexOf(text) >= 0);
if (parentMenus && parentMenus.length > 0) {
parentMenus.forEach(v => {
parentIds.push(v.id);
});
}
console.log(parentIds);
this.parentMenus = store.getters.parentMenus.filter(v1 => parentIds.filter(v2 => v1.id == v2).length > 0);
this.childMenus = store.getters.childMenus.filter(v1 => parentIds.filter(v2 => v1.parentid == v2).length > 0);
}
}
},
}
/**
* 扩展date函数
* author:c3gen
*/
Date.prototype.format = function (format) {
var o = {
"M+": this.getMonth() + 1,
"d+": this.getDate(),
"h+": this.getHours(),
"m+": this.getMinutes(),
"s+": this.getSeconds(),
"q+": Math.floor((this.getMonth() + 3) / 3),
"S": this.getMilliseconds()
}
if (/(y+)/.test(format)) {
format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
}
for (var k in o) {
if (new RegExp("(" + k + ")").test(format)) {
format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
}
}
return format;
}
</script>
<style scoped>
@import '@/css/main.css';
</style>

8
src/constants/global.js Normal file
View File

@@ -0,0 +1,8 @@
export default {
KEY: "ym",
EXCLUDES: [
"/login/login.action",
"/login/sendSmsCode.action",
],
NEED_LOGOUT: "needLogout",
};

216
src/css/login.css Normal file
View File

@@ -0,0 +1,216 @@
@charset "utf-8";
/* CSS Document */
.main_box {
position: absolute;
top: 50%;
left: 50%;
margin-top: -160px;
margin-left: -250px;
padding: 30px;
width: 500px;
height: 320px;
background: url(../assets/images/login_bg.png);
border-radius: 10px;
}
.main_box .setting {
position: absolute;
top: 5px;
right: 10px;
width: 10px;
height: 10px;
}
.main_box .setting a {
color: #FF6600;
}
.main_box .setting a:hover {
color: #555;
}
.login_logo {
height: 45px;
line-height: 45px;
position: relative;
text-align: center;
}
.login_logo img {
height: 45px;
}
.login_msg {
text-align: center;
font-size: 16px;
}
.login_form {
padding-top: 20px;
font-size: 16px;
}
.login_box .form-control {
display: inline-block;
zoom: 1;
width: auto;
font-size: 18px;
}
.login_box .form-control.x319 {
width: 319px;
background: rgba(255, 255, 255, 0.6);
outline: none;
border-color: transparent;
}
.login_box .form-control.x164 {
width: 164px;
}
.login_box .form-group {
margin-bottom: 20px;
text-align: center;
}
.login_box .form-group label.t {
/*width: 120px;*/
text-align: right;
cursor: pointer;
}
.login_box .form-group.space {
padding-top: 15px;
border-top: 1px #FFF dotted;
}
.login_box .form-group img {
margin-top: 1px;
height: 32px;
vertical-align: top;
}
.login_box .m {
cursor: pointer;
}
.bottom {
text-align: center;
font-size: 12px;
}
/* 动态背景设置 */
#bubble-wrapper {
margin: 0;
padding: 0;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
overflow: hidden;
background: linear-gradient(to bottom right, #FFD700,#DAA520);
}
#bubble-wrapper li {
position: absolute;
bottom: -160px;
width: 40px;
height: 40px;
background-color: rgba(255, 255, 255, 0.15);
list-style: none;
animation: square 15s infinite;
transition-timing-function: linear;
}
#bubble-wrapper li:nth-child(1) {
left: 10%;
}
#bubble-wrapper li:nth-child(2) {
left: 20%;
width: 90px;
height: 90px;
animation-delay: 2s;
animation-duration: 7s;
}
#bubble-wrapper li:nth-child(3) {
left: 25%;
animation-delay: 4s;
}
#bubble-wrapper li:nth-child(4) {
left: 40%;
width: 60px;
height: 60px;
animation-duration: 8s;
background-color: rgba(255, 255, 255, 0.3);
}
#bubble-wrapper li:nth-child(5) {
left: 70%;
}
#bubble-wrapper li:nth-child(6) {
left: 80%;
width: 120px;
height: 120px;
animation-delay: 3s;
background-color: rgba(255, 255, 255, 0.2);
}
#bubble-wrapper li:nth-child(7) {
left: 32%;
width: 120px;
height: 120px;
animation-delay: 2s;
}
#bubble-wrapper li:nth-child(8) {
left: 55%;
width: 20px;
height: 20px;
animation-delay: 4s;
animation-duration: 15s;
}
#bubble-wrapper li:nth-child(9) {
left: 25%;
width: 30px;
height: 30px;
animation-delay: 2s;
animation-duration: 12s;
background-color: rgba(255, 255, 255, 0.3);
}
#bubble-wrapper li:nth-child(10) {
left: 85%;
width: 160px;
height: 160px;
animation-delay: 5s;
}
@keyframes square {
0% {
opacity: 0.5;
transform: translateY(0px) rotate(45deg);
}
25% {
opacity: 0.75;
transform: translateY(-400px) rotate(90deg)
}
50% {
opacity: 1;
transform: translateY(-600px) rotate(135deg);
}
100% {
opacity: 0;
transform: translateY(-1000px) rotate(180deg);
}
}

9
src/css/main.css Normal file
View File

@@ -0,0 +1,9 @@
@charset "utf-8";
.tbar {
margin-top: 8px;
}
.tbar span {
cursor: pointer;
}

99
src/css/supersized.css Normal file
View File

@@ -0,0 +1,99 @@
/*
Supersized - Fullscreen Slideshow jQuery Plugin
Version : 3.2.7
Site : www.buildinternet.com/project/supersized
Author : Sam Dunn
Company : One Mighty Roar (www.onemightyroar.com)
License : MIT License / GPL License
*/
* {
margin: 0;
padding: 0;
}
body {
background: #111;
height: 100%;
}
img {
border: none;
}
#supersized {
display: block;
position: fixed;
left: 0;
top: 0;
overflow: hidden;
z-index: -999;
height: 100%;
width: 100%;
}
#supersized img {
width: auto;
height: auto;
position: relative;
display: none;
outline: none;
border: none;
}
#supersized.speed img {
-ms-interpolation-mode: nearest-neighbor;
image-rendering: -moz-crisp-edges;
}
/*Speed*/
#supersized.quality img {
-ms-interpolation-mode: bicubic;
image-rendering: optimizeQuality;
}
/*Quality*/
#supersized li {
display: block;
list-style: none;
z-index: -30;
position: fixed;
overflow: hidden;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #111;
}
#supersized a {
width: 100%;
height: 100%;
display: block;
}
#supersized li.prevslide {
z-index: -20;
}
#supersized li.activeslide {
z-index: -10;
}
#supersized li.image-loading img {
visibility: hidden;
}
#supersized li.prevslide img,
#supersized li.activeslide img {
display: inline;
}
#supersized img {
max-width: none !important
}

52
src/main.js Normal file
View File

@@ -0,0 +1,52 @@
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import 'jquery'
import 'jquery.md5'
import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap/dist/js/bootstrap.min.js'
import 'font-awesome/css/font-awesome.min.css'
import 'ionicons/css/ionicons.min.css'
import 'admin-lte/dist/css/AdminLTE.min.css'
import 'admin-lte/dist/css/skins/skin-yellow-light.min.css'
import 'admin-lte/dist/js/app.min.js'
import '@/assets/plugins/bootstrap-table/css/bootstrap-table.css'
import '@/assets/plugins/bootstrap-table/js/bootstrap-table.js'
import '@/assets/plugins/bootstrap-table/js/locale/bootstrap-table-zh-CN.js'
import '@/assets/plugins/bootstrap-table/js/extensions/editable/bootstrap-table-editable.js'
import '@/assets/plugins/jquery/jquery.form.js'
import '@/assets/plugins/bootstrap-datepicker/css/datepicker3.css'
import '@/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js'
import '@/assets/plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'
import '@/assets/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'
import '@/assets/plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js'
import '@/assets/plugins/bootstrap-combobox/css/bootstrap-combobox.css'
import '@/assets/plugins/bootstrap-combobox/js/bootstrap-combobox.js'
import '@/assets/plugins/bootstrap-combobox/js/bootstrap-combobox-helper.js'
import '@/assets/plugins/bootstrap-select/css/bootstrap-select.css'
import '@/assets/plugins/bootstrap-select/js/bootstrap-select.js'
import '@/assets/plugins/bootstrap-multiselect/css/bootstrap-multiselect.css'
import '@/assets/plugins/bootstrap-multiselect/js/bootstrap-multiselect.js'
import '@/assets/plugins/jQuery-Validation-Engine/css/validationEngine.jquery.css'
import '@/assets/plugins/jQuery-Validation-Engine/js/jquery.validationEngine.js'
import '@/assets/plugins/jQuery-Validation-Engine/js/languages/jquery.validationEngine-zh_CN.js'
import '@/assets/plugins/bootstrap-treeview/css/bootstrap-treeview.min.css'
import '@/assets/plugins/bootstrap-treeview/js/bootstrap-treeview.min.js'
import components from '@/utils/components.js'
createApp(App).use(store).use(router).use(components).mount('#app')

29
src/router/index.js Normal file
View File

@@ -0,0 +1,29 @@
import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '../views/home/index.vue'
import LoginView from '../views/login/index.vue'
import BlankView from '../views/BlankView.vue'
const routes = [
{
path: '/',
name: 'login',
component: LoginView
},
{
path: '/home',
name: 'home',
component: HomeView
},
{
path: '/blank',
name: 'blank',
component: BlankView
}
]
const router = createRouter({
history: createWebHashHistory(),
routes
})
export default router

25
src/store/index.js Normal file
View File

@@ -0,0 +1,25 @@
import { createStore } from 'vuex'
import user from './modules/user'
import menu from './modules/menu'
export default createStore({
state: {
},
getters: {
adminUser: state => state.user,
adminId: state => state.user.adminId,
username: state => state.user.username,
avatar: state => state.user.avatar,
lastTime: state => state.user.lastTime,
parentMenus: state => state.menu.parentMenus,
childMenus: state => state.menu.childMenus,
},
mutations: {
},
actions: {
},
modules: {
user,
menu,
}
})

62
src/store/modules/menu.js Normal file
View File

@@ -0,0 +1,62 @@
import { getMenuAll } from '@/api/common/menu';
import { setStore, getStore } from '@/utils/store';
import { toCamelCase, upperFirst } from '@/utils/string';
export default {
state: {
parentMenus: getStore({ name: 'parent_menus' }) || [],
childMenus: getStore({ name: 'child_menus' }) || [],
},
mutations: {
setParentMenus(state, parentMenus) {
state.parentMenus = parentMenus;
setStore({
name: "parent_menus",
content: state.parentMenus,
type: "session"
});
},
setChildMenus(state, childMenus) {
state.childMenus = childMenus;
setStore({
name: "child_menus",
content: state.childMenus,
type: "session"
});
}
},
actions: {
async getMenu({ commit }) {
const res = await getMenuAll();
if (res) {
const sortBy = (a, b) => {
if (a.showorder > b.showorder) {
return -1;
} else if (a.showorder < b.showorder) {
return 1;
} else {
return a.name.localeCompare(b.name);
}
};
if (res.parents && res.parents.length > 0) {
const parents = res.parents.sort(sortBy);
commit('setParentMenus', parents);
}
if (res.childs && res.childs.length > 0) {
const childs = res.childs.sort(sortBy);
commit('setChildMenus', childs);
}
}
return res;
},
getViewComponent(context, path) {
let component = path;
if (path && path.endsWith('.html')) {
const pathArray = path.split('/');
const routeName = toCamelCase(pathArray[pathArray.length - 1].replace('.html', ''));
component = upperFirst(routeName) + 'View';
}
return component;
}
},
};

85
src/store/modules/user.js Normal file
View File

@@ -0,0 +1,85 @@
import router from '@/router';
import { setStore, getStore } from '@/utils/store';
import { getUser, logout } from '@/api/common/user';
import { dateFormat } from '@/utils/date';
import avatar from '@/assets/images/woman.jpg';
export default {
state: {
adminId: getStore({ name: 'admin_id' }) || 0,
username: getStore({ name: 'username' }) || "",
avatar: getStore({ name: 'avatar' }) || "",
lastTime: getStore({ name: 'last_time' }) || "",
},
mutations: {
updateUser(state, user) {
if (user.adminId) {
console.log(user.adminId);
state.adminId = user.adminId;
setStore({
name: "admin_id",
content: state.adminId,
type: "session"
});
}
if (user.username) {
console.log(user.username);
state.username = user.username;
setStore({
name: "username",
content: state.username,
type: "session"
});
}
let userAvatar = user.avatar;
if (userAvatar) {
if (userAvatar != "") {
userAvatar = (userAvatar.startsWith('https') || userAvatar.startsWith('http')) ? userAvatar : avatar;
}
state.avatar = userAvatar;
setStore({
name: "avatar",
content: state.avatar,
type: "session"
});
}
if (user.lastTime) {
state.lastTime = user.lastTime;
setStore({
name: "last_time",
content: state.lastTime,
type: "session"
});
}
}
},
actions: {
async getUser({ commit }, adminId) {
const res = await getUser(adminId);
var data = res.entity || {};
commit("updateUser", {
avatar: data.headimg,
lastTime: dateFormat(new Date(data.lastlogin))
});
return data;
},
logout({ commit }) {
return new Promise((resolve, reject) => {
logout()
.then(res => {
commit("updateUser", {
adminId: 0,
username: "",
avatar: "",
lastTime: ""
});
resolve(res);
router.push("/");
}).catch(() => {
reject();
});
});
}
},
};

206
src/utils/ajaxfileupload.js Normal file
View File

@@ -0,0 +1,206 @@
jQuery.extend({
handleError: function (s, xhr, status, e) {
// If a local callback was specified, fire it
if (s.error) {
s.error.call(s.context || s, xhr, status, e);
}
// Fire the global callback
if (s.global) {
(s.context ? jQuery(s.context) : jQuery.event).trigger("ajaxError", [xhr, s, e]);
}
},
createUploadIframe: function (id, uri) {
//create frame
var frameId = 'jUploadFrame' + id;
if (window.ActiveXObject) {
var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
if (typeof uri == 'boolean') {
io.src = 'javascript:false';
}
else if (typeof uri == 'string') {
io.src = uri;
}
}
else {
io = document.createElement('iframe');
io.id = frameId;
io.name = frameId;
}
io.style.position = 'absolute';
io.style.top = '-1000px';
io.style.left = '-1000px';
document.body.appendChild(io);
return io
},
createUploadForm: function (id, fileElementId) {
//create form
var formId = 'jUploadForm' + id;
var fileId = 'jUploadFile' + id;
var form = $('<form action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
var oldElement = $('#' + fileElementId);
var newElement = $(oldElement).clone();
$(oldElement).attr('id', fileId);
$(oldElement).before(newElement);
$(oldElement).appendTo(form);
//set attributes
$(form).css('position', 'absolute');
$(form).css('top', '-1200px');
$(form).css('left', '-1200px');
$(form).appendTo('body');
return form;
},
ajaxFileUpload: function (s) {
// TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
s = jQuery.extend({}, jQuery.ajaxSettings, s);
var id = s.fileElementId;
var form = jQuery.createUploadForm(id, s.fileElementId);
var io = jQuery.createUploadIframe(id, s.secureuri);
var frameId = 'jUploadFrame' + id;
var formId = 'jUploadForm' + id;
// Watch for a new set of requests
if (s.global && !jQuery.active++) {
jQuery.event.trigger("ajaxStart");
}
var requestDone = false;
// Create the request object
var xml = {}
if (s.global)
jQuery.event.trigger("ajaxSend", [xml, s]);
// Wait for a response to come back
var uploadCallback = function (isTimeout) {
io = document.getElementById(frameId);
try {
if (io.contentWindow) {
xml.responseText = io.contentWindow.document.body ? io.contentWindow.document.body.innerHTML : null;
xml.responseXML = io.contentWindow.document.XMLDocument ? io.contentWindow.document.XMLDocument : io.contentWindow.document;
} else if (io.contentDocument) {
xml.responseText = io.contentDocument.document.body ? io.contentDocument.document.body.innerHTML : null;
xml.responseXML = io.contentDocument.document.XMLDocument ? io.contentDocument.document.XMLDocument : io.contentDocument.document;
}
} catch (e) {
jQuery.handleError(s, xml, null, e);
}
if (xml || isTimeout == "timeout") {
requestDone = true;
var status;
try {
status = isTimeout != "timeout" ? "success" : "error";
// Make sure that the request was successful or notmodified
if (status != "error") {
// process the data (runs the xml through httpData regardless of callback)
var data = jQuery.uploadHttpData(xml, s.dataType);
// If a local callback was specified, fire it and pass it the data
if (s.success)
s.success(data, status);
// Fire the global callback
if (s.global)
jQuery.event.trigger("ajaxSuccess", [xml, s]);
} else
jQuery.handleError(s, xml, status);
} catch (e) {
status = "error";
jQuery.handleError(s, xml, status, e);
}
// The request was completed
if (s.global)
jQuery.event.trigger("ajaxComplete", [xml, s]);
// Handle the global AJAX counter
if (s.global && ! --jQuery.active)
jQuery.event.trigger("ajaxStop");
// Process result
if (s.complete)
s.complete(xml, status);
jQuery(io).unbind()
setTimeout(function () {
try {
$(io).remove();
$(form).remove();
} catch (e) {
jQuery.handleError(s, xml, null, e);
}
}, 100)
xml = null
}
}
// Timeout checker
if (s.timeout > 0) {
setTimeout(function () {
// Check to see if the request is still happening
if (!requestDone) uploadCallback("timeout");
}, s.timeout);
}
try {
// var io = $('#' + frameId);
form = $('#' + formId);
$(form).attr('action', s.url);
$(form).attr('method', 'POST');
$(form).attr('target', frameId);
if (form.encoding) {
form.encoding = 'multipart/form-data';
}
else {
form.enctype = 'multipart/form-data';
}
$(form).submit();
} catch (e) {
jQuery.handleError(s, xml, null, e);
}
if (window.attachEvent) {
document.getElementById(frameId).attachEvent('onload', uploadCallback);
}
else {
document.getElementById(frameId).addEventListener('load', uploadCallback, false);
}
return { abort: function () { } };
},
uploadHttpData: function (r, type) {
var data = !type;
data = type == "xml" || data ? r.responseXML : r.responseText;
console.log(data);
// If the type is "script", eval it in global context
if (type == "script")
jQuery.globalEval(data);
// Get the JavaScript object, if JSON is used.
if (type == "json")
data = r.responseText;
var temp;
var start = data.indexOf(">");
if (start != -1) {
let end = data.indexOf("<", start + 1);
if (end != -1) {
temp = data.substring(start + 1, end);
}
}
if (!temp) {
start = data.indexOf("{");
temp = data.substring(start, data.lastIndexOf("}") + 1);
}
data = temp;
eval("data = " + data);
// evaluate scripts within html
if (type == "html")
jQuery("<div>").html(data).evalScripts();
//alert($('param', data).each(function(){alert($(this).attr('value'));}));
return data;
}
})

42
src/utils/bootstrap-table-helper.js vendored Normal file
View File

@@ -0,0 +1,42 @@
export default {
idstr: null,
// 是否有且只选择了一项
isSelectOne: function (idstr) {
if ($(idstr).bootstrapTable('getSelections').length == 1) {
return true;
}
return false;
},
//是否选择了至少一项
hasSelectAny: function (idstr) {
if ($(idstr).bootstrapTable('getSelections').length > 0) {
return true;
}
return false;
},
// 获取选择的一项
getOneSelectItem: function (idstr) {
return $(idstr).bootstrapTable('getSelections')[0];
},
// 已经选择的记录
getAllSelectItems: function (idstr) {
return $(idstr).bootstrapTable('getSelections');
},
getRowByUniqueId: function (idstr, id) {
return $(idstr).bootstrapTable('getRowByUniqueId', id);
},
// 已选择的项数量
selectLength: function (idstr) {
return $(idstr).bootstrapTable('getSelections').length;
},
// 刷新
doRefresh: function (idstr) {
$(idstr).bootstrapTable('refresh');
},
unCheckAll: function (idstr) {
$(idstr).bootstrapTable('uncheckAll');
},
doRefreshAndToPage1: function (idstr) {
$(idstr).bootstrapTable('selectPage', 1);
},
}

14
src/utils/components.js Normal file
View File

@@ -0,0 +1,14 @@
export default {
install: function (Vue) {
const files = require.context('@/views', true, /\.vue$/)
let components = {};
files.keys().forEach(key => {
components[key.replace(/(\.\/|\.vue)/g, '')] = files(key).default;
});
Object.keys(components).forEach(item => {
if (components[item].name) {
Vue.component(components[item].name, components[item]);
}
});
},
}

49
src/utils/date.js Normal file
View File

@@ -0,0 +1,49 @@
export const calcDate = (date1, date2) => {
var date3 = date2 - date1;
var days = Math.floor(date3 / (24 * 3600 * 1000));
// 计算天数后剩余的毫秒数
var leave1 = date3 % (24 * 3600 * 1000);
var hours = Math.floor(leave1 / (3600 * 1000));
// 计算小时数后剩余的毫秒数
var leave2 = leave1 % (3600 * 1000);
var minutes = Math.floor(leave2 / (60 * 1000));
// 计算分钟数后剩余的毫秒数
var leave3 = leave2 % (60 * 1000);
var seconds = Math.round(date3 / 1000);
return {
leave1,
leave2,
leave3,
days: days,
hours: hours,
minutes: minutes,
seconds: seconds
};
}
/**
* 日期格式化
*/
export function dateFormat(date) {
let format = 'yyyy-MM-dd hh:mm:ss';
if (date != 'Invalid Date') {
var o = {
"M+": date.getMonth() + 1, //month
"d+": date.getDate(), //day
"h+": date.getHours(), //hour
"m+": date.getMinutes(), //minute
"s+": date.getSeconds(), //second
"q+": Math.floor((date.getMonth() + 3) / 3), //quarter
"S": date.getMilliseconds() //millisecond
}
if (/(y+)/.test(format)) format = format.replace(RegExp.$1,
(date.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(format))
format = format.replace(RegExp.$1,
RegExp.$1.length == 1 ? o[k] :
("00" + o[k]).substr(("" + o[k]).length));
return format;
}
return '';
}

59
src/utils/maintainer.js Normal file
View File

@@ -0,0 +1,59 @@
export function showLoading() {
$(".loadingGif").css('top', window.innerHeight / 2);
$(".loadingGif").css('left', window.innerWidth / 2);
$(".loading").css('z-index', 3000);
$(".loading").modal('show');
}
export function hideLoading() {
$(".loading").modal('hide');
}
export function formatTime(val) {
var date;
if (val) {
// 兼容Safari
var userAgent = navigator.userAgent;
if (userAgent.indexOf('Version') > -1) {
date = new Date(val.split('+')[0]);
} else {
date = new Date(val);
}
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '';
}
}
export function cleanArray(actual) {
const newArray = []
for (let i = 0; i < actual.length; i++) {
if (actual[i]) {
newArray.push(actual[i])
}
}
return newArray
}
export function serverError(req) {
$("#tipMsg").text(req.responseJSON.message);
$("#tipModal").modal('show');
}
export function apiResult(json) {
if (json.code == 200 && json.message == 'success') {
return true;
}
$("#tipMsg").text("请求失败,错误信息:" + json.message);
$("#tipModal").modal('show');
return false;
}
export function param(json) {
if (!json) return ''
return cleanArray(Object.keys(json).map(key => {
if (json[key] === undefined) return ''
return encodeURIComponent(key) + '=' +
encodeURIComponent(json[key])
})).join('&')
}

59
src/utils/notify.js Normal file
View File

@@ -0,0 +1,59 @@
export const notifyNotice = () => {
var notifyInterval;
console.log(window.Notification.permission);
if (window.Notification) {
$.ajax({
url: "/admin/dynamic/verify/notifySwitch.action",
success: function (json) {
if (json == 'true') {
notifyInterval = setInterval(notify, 50000);
console.log('notifyInterval : ' + notifyInterval);
}
}
});
} else {
alert('浏览器不支持Notification');
}
function notify() {
$.ajax({
url: "/admin/dynamic/verify/notify.action",
success: function (json) {
if (json != null && json != "" && json != undefined && json != 'undefined') {
var dynamicCount = json.dynamic;
var voiceCount = json.voice;
if ((dynamicCount != null && dynamicCount > 0) || (voiceCount != null && voiceCount > 0)) {
if (Notification.permission == "granted") {
popNotice(dynamicCount, voiceCount);
} else if (Notification.permission != "denied") {
Notification.requestPermission(function (permission) {
console.log(permission);
popNotice(dynamicCount, voiceCount);
});
}
}
}
}
});
}
function popNotice(dynamic, voice) {
if (Notification.permission == "granted") {
var bodyStr = '您有';
if (dynamic) {
bodyStr += '【' + dynamic + '】条待审核动态';
}
if (voice) {
bodyStr += '【' + voice + '】条待审核声音瓶子';
}
var notification = new Notification("【66后台】系统推送", {
body: bodyStr,
type: 'info',
offset: 100,
});
notification.onclick = function () {
notification.close();
};
}
}
}

51
src/utils/request.js Normal file
View File

@@ -0,0 +1,51 @@
import axios from "axios";
import store from "@/store";
import global from "@/constants/global";
const service = axios.create();
service.interceptors.request.use(config => {
return config;
}, error => {
Promise.reject(error);
});
service.interceptors.response.use(res => {
userLogout(res.headers[global.NEED_LOGOUT.toLowerCase()]);
return res.data;
}, error => {
return Promise.reject(error);
});
$.ajaxSetup({
headers: {
'Access-Control-Allow-Origin': '*',
},
beforeSend: function(xhr) {
console.log(xhr);
},
complete: function(xhr) {
if (xhr && typeof(xhr.getResponseHeader) == 'function') {
userLogout(xhr.getResponseHeader(global.NEED_LOGOUT));
}
}
});
/**
* 强制退出
*/
function userLogout(needLogout) {
try {
if (global.NEED_LOGOUT == needLogout) {
var win = window;
while (win != win.top) {
win = win.top;
}
store.dispatch("logout");
}
} catch (error) {
console.error(error);
}
}
export default service;

118
src/utils/store.js Normal file
View File

@@ -0,0 +1,118 @@
import { validateNull } from '@/utils/validate';
import global from '@/constants/global';
const keyName = global.KEY + '_';
/**
* 存储localStorage
*/
export const setStore = (params = {}) => {
let {
name,
content,
type,
} = params;
name = keyName + name;
let obj = {
dataType: typeof (content),
content: content,
type: type,
datetime: new Date().getTime()
};
if (type) window.sessionStorage.setItem(name, JSON.stringify(obj));
else window.localStorage.setItem(name, JSON.stringify(obj));
}
/**
* 获取localStorage
*/
export const getStore = (params = {}) => {
let {
name,
debug
} = params;
name = keyName + name;
let obj = {},
content;
obj = window.sessionStorage.getItem(name);
if (validateNull(obj)) obj = window.localStorage.getItem(name);
if (validateNull(obj)) return;
try {
obj = JSON.parse(obj);
} catch {
return obj;
}
if (debug) {
return obj;
}
if (obj.dataType == 'string') {
content = obj.content;
} else if (obj.dataType == 'number') {
content = Number(obj.content);
} else if (obj.dataType == 'boolean') {
content = eval(obj.content);
} else if (obj.dataType == 'object') {
content = obj.content;
}
return content;
}
/**
* 删除localStorage
*/
export const removeStore = (params = {}) => {
let {
name,
type
} = params;
name = keyName + name;
if (type) {
window.sessionStorage.removeItem(name);
} else {
window.localStorage.removeItem(name);
}
}
/**
* 获取全部localStorage
*/
export const getAllStore = (params = {}) => {
let list = [];
let {
type
} = params;
if (type) {
for (let i = 0; i <= window.sessionStorage.length; i++) {
list.push({
name: window.sessionStorage.key(i),
content: getStore({
name: window.sessionStorage.key(i),
type: 'session'
})
})
}
} else {
for (let i = 0; i <= window.localStorage.length; i++) {
list.push({
name: window.localStorage.key(i),
content: getStore({
name: window.localStorage.key(i),
})
})
}
}
return list;
}
/**
* 清空全部localStorage
*/
export const clearStore = (params = {}) => {
let { type } = params;
if (type) {
window.sessionStorage.clear();
} else {
window.localStorage.clear();
}
}

29
src/utils/string.js Normal file
View File

@@ -0,0 +1,29 @@
/**
* 下划线转驼峰
*/
export function toCamelCase(str) {
return str.replace(/_[a-z]/g, function (s) {
return s.substring(1).toUpperCase();
});
}
/**
* 首字母大写
*/
export function upperFirst(str) {
return str.charAt(0).toUpperCase() + str.slice(1);
}
/**
* 首字母小写
*/
export function lowerFirst(str) {
return str.charAt(0).toLowerCase() + str.slice(1);
}
/**
* 是否为数字
*/
export function isNumber(str) {
return /^[0-9]+.?[0-9]*/.test(str);
}

View File

@@ -0,0 +1,6 @@
//获取url中的参数
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
var r = window.location.search.substr(1).match(reg); //匹配目标参数
if (r != null) return unescape(r[2]); return null; //返回参数值
}

20
src/utils/validate.js Normal file
View File

@@ -0,0 +1,20 @@
/**
* 判断是否为空
*/
export function validateNull(val) {
if (typeof val === 'boolean') {
return false;
}
if (typeof val === 'number') {
return false;
}
if (val instanceof Array) {
if (val.length == 0) return true;
} else if (val instanceof Object) {
if (JSON.stringify(val) === '{}') return true;
} else {
if (val == 'null' || val == null || val == 'undefined' || val == undefined || val == '') return true;
return false;
}
return false;
}

24
src/views/BlankView.vue Normal file
View File

@@ -0,0 +1,24 @@
<template>
<div></div>
</template>
<script>
import router from '@/router';
export default {
name: 'BlankView',
created() {
console.log('blank...');
console.log(window.performance.navigation.type);
//处理css样式污染问题
if (window.performance.navigation.type == window.performance.navigation.TYPE_RELOAD) {
router.push('/home');
} else {
console.log('router go ...');
router.go(0);
}
}
}
</script>
<style scoped></style>

View File

@@ -0,0 +1,386 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<div id="toolbar">
<div class="col-sm-12">
<label for="erbanNo" class="col-sm-1 control-label">音萌号:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="erbanNo" id="erbanNo" /></div>
<label for="templateId" class="col-sm-1 control-label">模板ID:</label>
<div class="col-sm-2">
<select name="templateId" id="templateId" data-btn-class="btn-warning" class="form-control">
</select>
</div>
<label for="sendStatus" class="col-sm-1 control-label">短信发送状态:</label>
<div class="col-sm-2">
<select name="sendStatus" id="sendStatus" data-btn-class="btn-warning" class="form-control">
<option value="0">全部</option>
<option value="1">未发送</option>
<option value="2">发送成功</option>
<option value="3">发送失败</option>
</select>
</div>
</div>
<div class="col-sm-12">
<label for="createTime" class="col-sm-1 control-label">创建时间:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="createTime" id="createTime" />
</div>
<label for="sendTime" class="col-sm-1 control-label">短信发送时间:</label>
<div class="col-sm-2"><input type="text" class="form-control" name="sendTime" id="sendTime" /></div>
</div>
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button id="btnSend" class="btn btn-default opt-apply">
<i class="glyphicon glyphicon-adjust"></i>批量发送(单页)
</button>
<button id="btnBatchSend" class="btn btn-default opt-apply">
<i class="glyphicon glyphicon-adjust"></i>批量发送(按查询条件)
</button>
<button id="btnImport" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>导入
</button>
</div>
</div>
</div>
<div id="table"></div>
</div>
</section>
<div class=" modal fade" id="fileUpload" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel1">上传文件</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="uploadForm">
<div class="form-group">
<label for="sendTemplateId" class="col-sm-3 control-label">模板ID:</label>
<div class="col-sm-9">
<select name="templateId" id="sendTemplateId" class="form-control">
</select>
</div>
</div>
<div class="form-group">
<label for="uploadFile" class="col-sm-3 control-label">上传文件:</label>
<div class="col-sm-9">
<input type="file" class="form-control validate[required]" name="uploadFile"
id="uploadFile" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">注意:</label>
<div class="col-sm-9">
<span>
<font color="#dd4b39">1.上传文件仅支持.xlsx格式的文件<br>
2.文件内容第一行为标题(:音萌号,手机号)<br>
3.第一列为用户音萌号,第二列为用户绑定的手机号码(手机号码为非必填项)
填写了手机号码时,以填写的手机号码为准</font>
</span>
</div>
</div>
</form>
</div>
<div class="modal-footer" style="height: 20%">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="upload">确定</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { showLoading, hideLoading } from '@/utils/maintainer';
export default {
name: "OperationSmsAdminView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
//获取模板列表
getTemplateList();
//初始化表格
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#table').bootstrapTable({
columns: [
{ field: 'temp', title: 'id', align: 'center', checkbox: true, width: '5%' },
{ field: 'erbanNo', title: '音萌号', align: 'center', width: '5%' },
{ field: 'phone', title: '手机号码', align: 'center', width: '5%' },
{ field: 'templateName', title: '短信模板', align: 'center', width: '5%' },
{
field: 'createTime',
title: '创建时间',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:00");
} else {
return '-';
}
}
},
{
field: 'sendTime',
title: '发送时间',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:00");
} else {
return '-';
}
}
},
{ field: 'operatorName', title: '操作者', align: 'center', width: '5%' },
{
field: 'sendStatus',
title: '发送状态',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
if (val == 1) {
return "未发送";
} else if (val == 2) {
return "发送成功";
} else if (val == 3) {
return "发送失败";
} else {
return "未知状态";
}
}
},
{
field: 'recordId',
title: '操作',
align: 'center',
width: '15%',
formatter: function (val, row, index) {
return '<button id="send" name="send" class="btn btn-sm btn-success opt-send" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-edit"></i> 发送</button>&nbsp;&nbsp;' +
'<button id="del" name="del" class="btn btn-sm btn-success opt-del" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-warning-sign"></i> 删除</button>&nbsp;&nbsp;';
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
erbanNo: $('#erbanNo').val(),
templateId: $('#templateId').val(),
sendStatus: $('#sendStatus').val(),
createTime: $('#createTime').val(),
sendTime: $('#sendTime').val()
};
return param;
},
toolbar: '#toolbar',
url: '/admin/sms/list.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
var picker1 = $("#createTime").datetimepicker({
format: 'yyyy-mm-dd',
autoclose: true,
});
var picker2 = $("#sendTime").datetimepicker({
format: 'yyyy-mm-dd',
autoclose: true
});
});
$("#btnSearch").click(function () {
TableHelper.doRefresh('#table');
})
$("#btnImport").click(function () {
$("#uploadFile").val("");
$("#fileUpload").modal('show');
});
$("#upload").click(function () {
var templateId = $("#sendTemplateId").val();
if (templateId == null) {
$("#tipMsg").text("短信模板ID不能为空.");
$("#tipModal").modal('show');
}
var file = $("#uploadFile").val();
if (file == null || file == undefined || file == '') {
$("#tipMsg").text("上传文件不能为空.");
$("#tipModal").modal('show');
}
debugger;
$("#fileUpload").modal('hide');
showLoading();
var option = ({
type: "POST",
url: "/admin/sms/uploadExcel.action",
cache: false,
contentType: false, //不可缺
processData: false, //不可缺
dataType: "json",
success: function (json) {
hideLoading();
console.log(json)
if (json.code == 200) {
$("#tipMsg").text("上传成功");
$("#tipModal").modal('show');
TableHelper.doRefresh('#table');
} else {
$("#tipMsg").text("上传失败.");
$("#tipModal").modal('show');
}
},
error: function () {
hideLoading();
$("#tipMsg").text("上传失败.");
$("#tipModal").modal('show');
}
});
$("#uploadForm").ajaxSubmit(option);
});
function getTemplateList() {
$.get('/admin/sms/getSmsTemp', function (res) {
if (res.code == 200) {
console.log(res.data);
var $first = $('<option value="0">全部</option>');
$('#templateId').append($first);
for (var i = 0; i < res.data.length; i++) {
var str = "<option value='" + res.data[i].templateId + "'>" + res.data[i].templateName + "</option>";
$('#templateId').append(str);
$('#sendTemplateId').append(str);
}
}
})
}
$("#btnBatchSend").click(function () {
var erbanNo = $('#erbanNo').val();
var templateId = $('#templateId').val();
var sendStatus = $('#sendStatus').val();
var createTime = $('#createTime').val();
var sendTime = $('#sendTime').val();
var data = {
erbanNo: erbanNo,
templateId: templateId,
sendStatus: sendStatus,
createTime: createTime,
sendTime: sendTime
};
var url = "/admin/sms/query/send.action";
if (confirm("按查询条件发送最多一次可发送一万条短信!已发送过的用户不会重复发送,你确认批量发送吗?")) {
sendSmsByData(data, url);
}
})
$("#btnSend").click(function () {
var rows = $("#table").bootstrapTable("getSelections");
if (rows.length == 0) {
alert("请先选择要发送的记录");
return;
}
var idArr = [];
for (var i = 0; i < rows.length; i++) {
idArr.push(rows[i]['recordId']);
}
var data = {
ids: JSON.stringify(idArr)
}
var url = "/admin/sms/page/send.action";
if (confirm("你确认批量发送吗?")) {
sendSmsByData(data, url);
}
})
$("#table").on('click', '.opt-send', function () {
var id = $(this).attr("data-id");
var data = { recordId: id };
var url = "/admin/sms/send.action";
if (confirm("已经发送过的短信将会重复发送,确定重复发送短信吗?")) {
sendSmsByData(data, url);
}
})
$("#table").on('click', '.opt-del', function () {
var id = $(this).attr("data-id");
if (confirm("删除的数据将不能找回,确定删除吗?")) {
$.ajax({
type: "post",
url: "/admin/sms/del.action",
data: { recordId: id },
dataType: "json",
success: function (json) {
if (json.code == '200') {
$("#withdrawModal").modal('hide');
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败" + json.msg);
$("#tipModal").modal('show');
}
}
});
}
})
function sendSmsByData(data, url) {
$.ajax({
type: "post",
url: url,
data: data,
dataType: "json",
success: function (json) {
if (json.code == '200') {
$("#withdrawModal").modal('hide');
$("#tipMsg").text("已发送,发送结果请查看发送状态");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("发送失败" + json.msg);
$("#tipModal").modal('show');
}
}
});
}
}
}
};
</script>

View File

@@ -0,0 +1,193 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<div id="table"></div>
<div id="toolbar">
<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="updateImgs" class="btn btn-sm btn-primary">上传文件</button>
<h3 id="urlInfo"></h3>
<br />
</div>
</div>
</div>
</section>
<div class=" modal fade" id="fileUpload" tabindex="-1" role="dialog" aria-labelledby="modalLabel1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel1">上传文件</h4>
</div>
<div class="modal-footer" style="height: 20%">
<span>上传文件</span>
<!--<input type="file" name="file" id="uploadFile">-->
<input type="file" name="logoFile1" id="logoFile1" onchange="setFiles(this);" style="display:inline;"
multiple>
<!--<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>-->
<!--<button type="button" class="btn btn-primary" id="upload">上传七牛</button>-->
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "QiniuUploadAdminView",
setup() {
function setFiles(obj) {
$("#confirmMsg").text("正在上传,请稍后");
$("#confirmModal").modal('show');
var f = $(obj).val();
if (f == null || f == undefined || f == '') {
return false;
}
var filePaths = $(obj)[0].files;
var num = filePaths.length;
var data = new FormData();
for (var i = 0; i <= num - 1; i++) {
var file = $(obj)[0].files[i];
data.append('file_' + i, file);
}
$.ajax({
type: "POST",
url: "/admin/qiniu/uploadPatch.action",
data: data,
cache: false,
contentType: false, //不可缺
processData: false, //不可缺
dataType: "json",
success: function (res) {
$("#logoFile1").val("");
$("#confirmModal").modal('hide');
$("#fileUpload").modal('hide');
console.log(res)
if (res.code == 200) {
$("#tipMsg").text("上传成功");
$("#tipModal").modal('show');
buildResult(res.data);
} else {
$("#tipMsg").text("上传失败.");
$("#tipModal").modal('show');
}
}
});
}
window.setFiles = setFiles;
return {
setFiles,
};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$("#updateImgs").click(function () {
$("#uploadFile").val("");
$("#fileUpload").modal('show');
});
$("#upload").click(function () {
$.ajaxFileUpload({
fileElementId: 'uploadFile', //需要上传的文件域的ID即<input type="file">的ID。
url: "/admin/qiniu/upload", //后台方法的路径
type: 'post', //当要提交自定义参数时这个参数要设置成post
dataType: 'json', //服务器返回的数据类型。可以为xml,script,json,html。如果不填写jQuery会自动判断。
secureuri: false, //是否启用安全提交默认为false。
async: true, //是否是异步
success: function (json) { //提交成功后自动执行的处理函数参数data就是服务器返回的数据。
console.log(json)
if (json.flag) {
$("#urlInfo").html(json.url);
$("#tipMsg").text("上传成功");
$("#tipModal").modal('show');
}
else {
$("#tipMsg").text("上传失败.");
$("#tipModal").modal('show');
}
$("#faceJsonImgsUpload").modal('hide');
},
error: function (data, status, e) { //提交失败自动执行的处理函数。
console.error(e);
$("#tipMsg").text("上传失败");
$("#tipModal").modal('show');
}
});
});
}
}
};
function buildResult(data) {
var $urlInfo = $('#urlInfo');
for (var i = 0; i < data.length; i++) {
var $p = $('<p />');
$p.html(data[i]);
$urlInfo.append($p);
}
}
</script>
<style scoped>
.bar1,
.bar2 {
margin-bottom: 10px;
}
label.col-sm-1 {
padding: 0;
line-height: 30px;
text-align: right;
/*padding-right: 4px;*/
}
label.col-sm-1 {
padding: 0;
line-height: 30px;
text-align: right;
/*padding-right: 4px;*/
}
input,
select {
margin-left: 8px;
margin-right: 8px;
}
.button-wrapper {
margin-top: 10px;
}
.record {
margin-top: 10px;
}
.record .title {
font-size: 16px;
}
.toggle-group {
display: none;
}
.tips {
font-size: 13px;
color: red;
}
.opt-group .col-sm-7 {
text-align: left;
}
</style>

View File

@@ -0,0 +1,194 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<div id="table"></div>
<div id="toolbar">
<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="updateImgs" class="btn btn-sm btn-primary">上传文件</button>
<h3 id="urlInfo"></h3>
<br />
</div>
</div>
</div>
</section>
<div class=" modal fade" id="fileUpload" tabindex="-1" role="dialog" aria-labelledby="modalLabel1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel1">上传文件</h4>
</div>
<div class="modal-footer" style="height: 20%">
<span>上传文件</span>
<!--<input type="file" name="file" id="uploadFile">-->
<input type="file" name="logoFile1" id="logoFile1" onchange="setFiles(this);" style="display:inline;"
multiple>
<!--<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>-->
<!--<button type="button" class="btn btn-primary" id="upload">上传七牛</button>-->
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "TencentUploadAdminView",
setup() {
function setFiles(obj) {
$("#confirmMsg").text("正在上传,请稍后");
$("#confirmModal").modal('show');
var f = $(obj).val();
if (f == null || f == undefined || f == '') {
return false;
}
var filePaths = $(obj)[0].files;
var num = filePaths.length;
var data = new FormData();
for (var i = 0; i <= num - 1; i++) {
var file = $(obj)[0].files[i];
data.append('file_' + i, file);
}
$.ajax({
type: "POST",
url: "/admin/tencent/cos/uploadPatch.action",
data: data,
cache: false,
contentType: false, //不可缺
processData: false, //不可缺
dataType: "json",
success: function (res) {
$("#logoFile1").val("");
$("#confirmModal").modal('hide');
$("#fileUpload").modal('hide');
console.log(res)
if (res.code == 200) {
$("#tipMsg").text("上传成功");
$("#tipModal").modal('show');
buildResult(res.data);
} else {
$("#tipMsg").text("上传失败.");
$("#tipModal").modal('show');
}
}
});
}
window.setFiles = setFiles;
return {
setFiles,
};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$("#updateImgs").click(function () {
$("#uploadFile").val("");
$("#fileUpload").modal('show');
});
$("#upload").click(function () {
$.ajaxFileUpload({
fileElementId: 'uploadFile', //需要上传的文件域的ID即<input type="file">的ID。
url: "/admin/tencent/cos/uploadPatch", //后台方法的路径
type: 'post', //当要提交自定义参数时这个参数要设置成post
dataType: 'json', //服务器返回的数据类型。可以为xml,script,json,html。如果不填写jQuery会自动判断。
secureuri: false, //是否启用安全提交默认为false。
async: true, //是否是异步
success: function (json) { //提交成功后自动执行的处理函数参数data就是服务器返回的数据。
console.log(json)
if (json.flag) {
$("#urlInfo").html(json.url);
$("#tipMsg").text("上传成功");
$("#tipModal").modal('show');
}
else {
$("#tipMsg").text("上传失败.");
$("#tipModal").modal('show');
}
$("#faceJsonImgsUpload").modal('hide');
},
error: function (data, status, e) { //提交失败自动执行的处理函数。
console.error(e);
$("#tipMsg").text("上传失败");
$("#tipModal").modal('show');
}
});
});
}
}
};
function buildResult(data) {
var $urlInfo = $('#urlInfo');
for (var i = 0; i < data.length; i++) {
var $p = $('<p />');
$p.html(data[i]);
$urlInfo.append($p);
}
}
</script>
<style scoped>
.bar1,
.bar2 {
margin-bottom: 10px;
}
label.col-sm-1 {
padding: 0;
line-height: 30px;
text-align: right;
/*padding-right: 4px;*/
}
label.col-sm-1 {
padding: 0;
line-height: 30px;
text-align: right;
/*padding-right: 4px;*/
}
input,
select {
margin-left: 8px;
margin-right: 8px;
}
.button-wrapper {
margin-top: 10px;
}
.record {
margin-top: 10px;
}
.record .title {
font-size: 16px;
}
.toggle-group {
display: none;
}
.tips {
font-size: 13px;
color: red;
}
.opt-group .col-sm-7 {
text-align: left;
}
</style>

View File

@@ -0,0 +1,551 @@
<template>
<section class="content">
<div class="box box-primary">
<section class="content-header">
<h1 id="itemTitle">十二星座配置</h1>
</section>
<section class="content">
<table id="table"></table>
<div id="toolbar">
<button id="addBtn" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</section>
</div>
</section>
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="addModalLabel">添加十二星座配置</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="addForm">
<div class="form-group">
<div class="tips">注意无论选择什么时间都会设置到选择时间的 00:00</div>
<label for="addStartDate" class="col-sm-3 control-label">起始时间:</label>
<div class="col-sm-8">
<input type="text" id="addStartDate" name="startTime"
class="form-control validate[required]">
</div>
</div>
<div class="form-group">
<div class="tips">注意无论选择什么时间都会设置到选择时间的 23:59</div>
<label for="addEndDate" class="col-sm-3 control-label">结束时间:</label>
<div class="col-sm-8">
<input type="text" id="addEndDate" name="startTime" class="form-control validate[required]">
</div>
</div>
<div class="form-group">
<label for="addGiftId" class="col-sm-3 control-label">礼物</label>
<select name="giftId" id="addGiftId" class="giftSelect" multiple="multiple">
</select>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">魅力榜奖励</label>
<select name="packId" id="charmAwardId" class="awardSelect" multiple="multiple">
</select>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">豪气榜奖励</label>
<select name="packId" id="levelAwardId" class="awardSelect" multiple="multiple">
</select>
</div>
<div class="form-group">
<label for="addDesc" class="col-sm-3 control-label">星座名称</label>
<div class="col-sm-8">
<input type="text" name="desc" id="addDesc" class="form-control validate[required]" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">星座标记</label>
<div class="col-sm-8">
<img src="" alt="" id="add_mark_url" style="width: 50px; height: 50px;">
<input type="file" id="uploadTagPic" accept="image/*">
<button class="btn btn-success" type="button" id="uploadTagPicBtn">上传</button>
<div class="tips">
<i class="glyphicon glyphicon-info-sign"></i>
<font color="red">请上传图片文件</font>
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="addSave">保存</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="editModalLabel">修改十二星座配置</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="editForm">
<input type="hidden" id="editId">
<div class="form-group">
<div class="tips">注意无论选择什么时间都会设置到选择时间的 00:00</div>
<label for="updateStartDate" class="col-sm-3 control-label">起始时间:</label>
<div class="col-sm-8">
<input type="text" id="updateStartDate" name="startTime"
class="form-control validate[required]">
</div>
</div>
<div class="form-group">
<div class="tips">注意无论选择什么时间都会设置到选择时间的 23:59</div>
<label for="updateEndDate" class="col-sm-3 control-label">结束时间:</label>
<div class="col-sm-8">
<input type="text" id="updateEndDate" name="startTime"
class="form-control validate[required]">
</div>
</div>
<div class="form-group">
<label for="addGiftId" class="col-sm-3 control-label">礼物</label>
<select name="giftId" id="editGiftId" class="giftSelect" multiple="multiple">
</select>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">魅力榜奖励</label>
<select name="packId" id="editCharmAwardId" class="awardSelect" multiple="multiple">
</select>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">豪气榜奖励</label>
<select name="packId" id="editLevelAwardId" class="awardSelect" multiple="multiple">
</select>
</div>
<div class="form-group">
<label for="editDesc" class="col-sm-3 control-label">星座名称</label>
<div class="col-sm-8">
<input type="text" name="desc" id="editDesc" class="form-control validate[required]" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">星座标记</label>
<div class="col-sm-8">
<img src="" alt="" id="update_mark_url" style="width: 50px; height: 50px;">
<input type="file" id="uploadTagPic2" accept="image/*">
<button class="btn btn-success" type="button" id="uploadTagPicBtn2">上传</button>
<div class="tips">
<i class="glyphicon glyphicon-info-sign"></i>
<font color="red">请上传图片文件</font>
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="editSave">保存</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { formatTime } from '@/utils/maintainer';
export default {
name: "ActTwelveStarConfigAdminView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
var giftObj = {};
var packObj = {};
getGiftMsg();
function tableMake() {
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: 'id', align: 'center', valign: 'middle', width: '10%' },
{
field: 'startDate', title: '开始时间', align: 'center', valign: 'middle', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
{
field: 'endDate', title: '结束时间', align: 'center', valign: 'middle', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
{
field: 'giftIdList', title: '礼物清单', align: 'center', valign: 'middle', formatter: function (val, row, index) {
var giftArr = JSON.parse(val);
var str = '';
for (var i = 0; i < giftArr.length; i++) {
str += giftObj[giftArr[i]] + '';
}
return str.substr(0, str.length - 2);
}
},
{
field: 'charmAward', title: '魅力榜奖励', align: 'center', valign: 'middle', formatter: function (val, row, index) {
var packArr = JSON.parse(val);
var str = '';
for (var i = 0; i < packArr.length; i++) {
str += packObj[packArr[i]] + '';
}
return str.substr(0, str.length - 2);
}
},
{
field: 'levelAward', title: '豪气榜奖励', align: 'center', valign: 'middle', formatter: function (val, row, index) {
var packArr = JSON.parse(val);
var str = '';
for (var i = 0; i < packArr.length; i++) {
str += packObj[packArr[i]] + '';
}
return str.substr(0, str.length - 2);
}
},
{
field: 'createTime', title: '创建时间', align: 'center', valign: 'middle', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
{ field: 'description', title: '星座名称', align: 'center', valign: 'middle' },
{
field: 'markUrl', title: '星座标记', align: 'left', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
if (null != val && val != '') {
return '<img src="' + val + '" alt="" style="width: 30px; height: 30px;">';
}
return '-';
}
},
{
field: 'tmp',
title: '操作',
align: 'center',
width: '30%',
valign: 'middle',
formatter: function (val, row, index) {
var key = row.id;
var date = new Date(row.startDate);
var mondayDate = getFirstDayOfWeek(new Date());
var dis = mondayDate.getTime() - date.getTime();
// if(dis > 0){
// return "<button class='btn btn-sm btn-success opt-edit' disabled data-id="+ key +">不可编辑</button>";
// }else{
// }
return "<button class='btn btn-sm btn-success opt-edit' data-id=" + key + ">编辑</button>";
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
};
// console.log(param);
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/twelveStar/getWeekConfigList.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
}
$('#addBtn').on('click', function () {
clearModal();
getGiftMsg();
getPackMsg();
$('#addModal').modal('show');
})
var picker = $('#addStartDate').datepicker({
format: 'yyyy-mm-dd',
startDate: new Date(),
autoclose: true
});
var picker1 = $('#addEndDate').datepicker({
format: 'yyyy-mm-dd',
startDate: new Date(),
autoclose: true
});
var picker2 = $('#updateStartDate').datepicker({
format: 'yyyy-mm-dd',
startDate: new Date(),
autoclose: true
});
var picker3 = $('#updateEndDate').datepicker({
format: 'yyyy-mm-dd',
startDate: new Date(),
autoclose: true
});
function clearModal() {
$("#addForm").find('input[type=text],select,input[type=hidden]').each(function () {
$(this).val('');
});
$('#editForm').find('input[type=text],select,input[type=hidden]').each(function () {
$(this).val('');
});
$('#add_mark_url').attr('src', '');
$('#update_mark_url').attr('src', '');
}
$('#addSave').on('click', function () {
if ($('#addForm').validationEngine('validate')) {
//客户端标签
var markUrl = $('#add_mark_url').attr('src');
var giftId = JSON.stringify($("#addGiftId").val());
var charmAward = JSON.stringify($("#charmAwardId").val());
var levelAward = JSON.stringify($("#levelAwardId").val());
if (giftId == '' || charmAward == '' || levelAward == '') {
$("#tipMsg").text('请选择礼物/奖励');
$("#tipModal").modal('show');
return;
}
$.get('/admin/twelveStar/insert', {
startTimeStr: $('#addStartDate').val(),
endTimeStr: $('#addEndDate').val(),
desc: $('#addDesc').val(),
giftList: giftId,
markUrl: markUrl,
charmAward: charmAward,
levelAward: levelAward
}, function (res) {
if (res.code == 200) {
$('#addModal').modal('hide');
$("#tipMsg").text("添加成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败," + res.message);
$("#tipModal").modal('show');
}
})
}
})
$('#editSave').on('click', function () {
if ($('#editForm').validationEngine('validate')) {
//客户端标签
var markUrl = $('#update_mark_url').attr('src');
var giftId = JSON.stringify($("#editGiftId").val());
var charmAward = JSON.stringify($("#editCharmAwardId").val());
var levelAward = JSON.stringify($("#editLevelAwardId").val());
if (giftId == '' || charmAward == '' || levelAward == '') {
$("#tipMsg").text('请选择礼物/奖励');
$("#tipModal").modal('show');
return;
}
$.get('/admin/twelveStar/update', {
id: $('#editId').val(),
desc: $('#editDesc').val(),
startTimeStr: $('#updateStartDate').val(),
endTimeStr: $('#updateEndDate').val(),
markUrl: markUrl,
giftList: giftId,
charmAward: charmAward,
levelAward: levelAward
}, function (res) {
if (res.code == 200) {
$('#editModal').modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败," + res.message);
$("#tipModal").modal('show');
}
})
}
});
$('#table').on('click', '.opt-edit', function () {
var id = $(this).data('id');
var data = $('#table').bootstrapTable('getRowByUniqueId', id);
var giftArr = JSON.parse(data.giftIdList);
var charmAward = JSON.parse(data.charmAward);
var levelAward = JSON.parse(data.levelAward);
console.log(data);
$('#editId').val(data.id);
$('#editGiftId').multiselect('select', giftArr);
$('#editCharmAwardId').multiselect('select', charmAward);
$('#editLevelAwardId').multiselect('select', levelAward);
$('#editDesc').val(data.description);
$('#updateStartDate').val(formatTime(data.startDate));
$('#updateEndDate').val(formatTime(data.endDate));
$('#update_mark_url').attr('src', data.markUrl);
$('#editModal').modal('show');
});
function getGiftMsg() {
$.get('/admin/gift/getAllGiftList?consumeType=1', function (res) {
if (res.code == 200) {
var str = '';
for (var i = 0; i < res.data.length; i++) {
// 存入对象
giftObj[res.data[i].giftId] = res.data[i].giftName;
// 渲染select
str += '<option value="' + res.data[i].giftId + '">' + res.data[i].giftName + '</option>';
}
console.log(JSON.stringify(giftObj));
// $('.giftSelect').html(str);
// multiSelect('.giftSelect');
getWeekStarGiftMsg();
getPackMsg();
}
})
}
// 旧逻辑是查询出所有的礼物, 新逻辑: 只查询出周星榜礼物类型作为增加项
// 此处是兼容回显礼物名称, 避免之前的 不是周星榜礼物类型 导致名称回显不存在
function getWeekStarGiftMsg() {
$.get('/admin/gift/getVaildGiftByType?consumeType=1&status=0&giftType=13', function (res) {
if (res.code == 200) {
var str = '';
for (var i = 0; i < res.data.length; i++) {
// 存入对象
giftObj[res.data[i].giftId] = res.data[i].giftName;
// 渲染select
str += '<option value="' + res.data[i].giftId + '">' + res.data[i].giftName + '</option>';
}
console.log(JSON.stringify(giftObj));
$('.giftSelect').html(str);
multiSelect('.giftSelect');
}
})
}
function getPackMsg() {
$.get('/admin/twelveStar/getPackList', function (res) {
if (res.code == 200) {
var str = '';
for (var i = 0; i < res.data.length; i++) {
// 存入对象
packObj[res.data[i].id] = res.data[i].name;
// 渲染select
str += '<option value="' + res.data[i].id + '">' + res.data[i].name + '</option>';
}
$('.awardSelect').html(str);
multiSelect('.awardSelect');
tableMake();
}
})
}
function getFirstDayOfWeek(date) {
var day = date.getDay() || 7;
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1 - day);
}
function multiSelect(obj) { //初始化方法
$(obj).multiselect({
includeSelectAllOption: false,
enableClickableOptGroups: true,
enableCollapsibleOptGroups: true,
noneSelectedText: '==请选择==',
buttonWidth: 195,
maxHeight: 300,
});
}
// 上传标签
$('#uploadTagPicBtn').on('click', function () {
if ($('#uploadTagPic').val() == '') {
$('#tipMsg').text('上传图片为空');
$('#tipModal').modal('show');
return;
}
var options = {
type: 'post',
url: '/admin/upload/img',
dataType: 'json',
success: function (res) {
if (res.path) {
$('#add_mark_url').attr('src', res.path);
} else {
$('#tipMsg').text(res.msg);
$('#tipModal').modal('show');
}
}
}
$('#uploadTagPic').attr('name', 'uploadFile');
$('#uploadPict').attr('name', '');
$('#addForm').ajaxSubmit(options);
});
// 上传标签
$('#uploadTagPicBtn2').on('click', function () {
if ($('#uploadTagPic2').val() == '') {
$('#tipMsg').text('上传图片为空');
$('#tipModal').modal('show');
return;
}
var options = {
type: 'post',
url: '/admin/upload/img',
dataType: 'json',
success: function (res) {
if (res.path) {
$('#update_mark_url').attr('src', res.path);
} else {
$('#tipMsg').text(res.msg);
$('#tipModal').modal('show');
}
}
}
$('#uploadTagPic2').attr('name', 'uploadFile');
$('#uploadPict').attr('name', '');
$('#editForm').ajaxSubmit(options);
});
})
}
}
};
</script>
<style scoped>
/*.giftSelect{*/
/* width: 100%;*/
/*}*/
.col-sm-8 {
padding: 0;
}
.tips {
padding-left: 75px;
color: red;
}
</style>

View File

@@ -0,0 +1,617 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
奖品类别<select name="prizeType" id="prizeType" class="input-m">
<option value="0">--全部--</option>
<option value="1">金币</option>
<option value="2">线上礼物</option>
<option value="3">座驾</option>
<option value="4">头饰</option>
<option value="6">实体奖品</option>
<option value="10">锤子</option>
<option value="11">贵族爵位</option>
<option value="12">萝卜</option>
<option value="13">祝福语</option>
<option value="14">铭牌</option>
</select>
<button id="add" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
</div>
</section>
</div>
</div>
</section>
<div class="modal fade" id="activityAwardModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="modalLabel">活动奖品信息</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="activityAwardForm">
<div class="form-group" id="addModalLabel">
<label for="addType" class="col-sm-3 control-label">奖品类型</label>
<div class="col-sm-8" style="padding-top:7px;">
<select name="addType" id="addType" data-btn-class="btn btn-warning">
<option value="1">金币</option>
<option value="2">线上礼物</option>
<option value="3">座驾</option>
<option value="4">头饰</option>
<option value="6">实体奖品</option>
<option value="10">锤子</option>
<option value="11">贵族爵位</option>
<option value="12">萝卜</option>
<option value="14">铭牌</option>
</select>
</div>
</div>
<!-- 线上礼物 -->
<div class="form-group giftChoose awardList">
<label for="giftChoose" class="col-sm-3 control-label">选择礼物</label>
<div class="col-sm-8">
<select name="giftChoose" id="giftChoose" class="combobox">
</select>
</div>
</div>
<!-- 座驾 -->
<div class="form-group carChoose awardList">
<label for="carChoose" class="col-sm-3 control-label">选择座驾</label>
<div class="col-sm-8">
<select name="carChoose" id="carChoose" class="combobox">
</select>
</div>
</div>
<!-- 头饰 -->
<div class="form-group headwearChoose awardList">
<label for="headwearChoose" class="col-sm-3 control-label">选择头饰</label>
<div class="col-sm-8">
<select name="headwearChoose" id="headwearChoose" class="combobox">
</select>
</div>
</div>
<!-- 贵族 -->
<div class="form-group nobleChoose awardList">
<label for="nobleChoose" class="col-sm-3 control-label">选择爵位</label>
<div class="col-sm-8">
<select name="nobleChoose" id="nobleChoose" class="combobox">
<option value="1">男爵</option>
<option value="2">子爵</option>
<option value="3">伯爵</option>
<option value="4">侯爵</option>
<option value="5">公爵</option>
<option value="6">国王</option>
<option value="7">皇帝</option>
</select>
</div>
</div>
<!-- 头饰 -->
<div class="form-group nameplateChoose awardList">
<label for="nameplateChoose" class="col-sm-3 control-label">选择头饰</label>
<div class="col-sm-8">
<select name="nameplateChoose" id="nameplateChoose" class="combobox">
</select>
</div>
</div>
<div class="form-group">
<label for="prizeName" class="col-sm-3 control-label">奖品名称:</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required]" name="prizeName" id="prizeName">
<input type="hidden" id="prizeId" name="id">
</div>
</div>
<div class="form-group refValue">
<label for="refValue" class="col-sm-3 control-label">使用天数:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="refValue" id="refValue">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">奖品图:</label>
<div class="col-sm-8">
<img src="" id="imgUrl" style="width:90px;height:90px;" alt="">
<input type="file" id="uploadFile" name="uploadFile"
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
<button class="btn btn-success" type="button" id="uploadBtn">上传</button>
<input type="hidden" id="prizeImgUrl" name="prizeImgUrl"
class="form-control validate[required]" />
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="save">保存</button>
</div>
</div>
</div>
</div>
<div id="imgMask"><img src="" alt=""></div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "ActivityAwardAdminView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
var $form = $('#activityAwardForm');
var $awardList = $('.awardList');
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: '奖励id', align: 'center', valign: 'middle', width: '10%' },
{
field: 'prizeType', title: '奖品类别', align: 'center', valign: 'middle', width: '20%', formatter: function (val, row, index) {
switch (val) {
case 1:
return '金币';
case 2:
return '在线礼物';
case 3:
return '座驾';
case 4:
return '头饰';
case 5:
return '背景';
case 6:
return '实物';
case 7:
return '靓号';
case 8:
return '全麦礼物';
case 9:
return '随机靓号';
case 10:
return '锤子';
case 11:
return '贵族爵位';
case 12:
return '萝卜';
case 14:
return '铭牌';
}
}
},
{ field: 'prizeName', title: '奖品名称', align: 'center', valign: 'middle', width: '20%' },
{
field: 'prizeImgUrl', title: '奖品图片', align: 'center', width: '10%', formatter: function (val, row, index) {
return "<img src='" + val + "' width='60' height='60'>";
}
},
{ field: 'referenceValue', title: '使用天数', align: 'center', valign: 'middle', width: '20%' },
{
field: 'createTime',
title: '创建时间',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
{
field: 'updateTime',
title: '更新时间',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
{
field: 'tmp',
title: '操作',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
var key = row.id;
return "<button class='btn btn-sm btn-success opt-edit' data-id=" + key + ">编辑</button>";
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
prizeType: $('#prizeType').val()
};
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/activityAward/list.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
combineDataFromBack();
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
$('#table').on('click', '.opt-edit', function () {
clearAwardList();
$('.refValue').hide();
var id = parseInt($(this).data('id'));
var data = $('#table').bootstrapTable('getRowByUniqueId', id);
var prizeType = data.prizeType;
if (prizeType == 2) {
$awardList.eq(0).show().siblings('.awardList').hide();
$awardList.eq(0).find('select').val(data.referenceId);
let $selected = $awardList.eq(0).find('select option:selected');
let referenceId = $selected.val();
let awardName = $selected.text();
$awardList.eq(0).find('input[type="text"]').val(awardName);
$awardList.eq(0).find('input[type="hidden"]').val(referenceId);
} else if (prizeType == 3) {
$awardList.eq(1).show().siblings('.awardList').hide();
$awardList.eq(1).find('select').val(data.referenceId);
let $selected = $awardList.eq(1).find('select option:selected');
let referenceId = $selected.val();
let awardName = $selected.text();
$awardList.eq(1).find('input[type="text"]').val(awardName);
$awardList.eq(1).find('input[type="hidden"]').val(referenceId);
$('#refValue').val(data.referenceValue);
$('.refValue').show();
} else if (prizeType == 4) {
$awardList.eq(2).show().siblings('.awardList').hide();
$awardList.eq(2).find('select').val(data.referenceId);
let $selected = $awardList.eq(2).find('select option:selected');
let referenceId = $selected.val();
let awardName = $selected.text();
$awardList.eq(2).find('input[type="text"]').val(awardName);
$awardList.eq(2).find('input[type="hidden"]').val(referenceId);
$('#refValue').val(data.referenceValue);
$('.refValue').show();
} else if (prizeType == 11) {
$awardList.eq(3).show().siblings('.awardList').hide();
$awardList.eq(3).find('select').val(data.referenceId);
let $selected = $awardList.eq(3).find('select option:selected');
let referenceId = $selected.val();
let awardName = $selected.text();
$awardList.eq(3).find('input[type="text"]').val(awardName);
$awardList.eq(3).find('input[type="hidden"]').val(referenceId);
$('#refValue').val(data.referenceValue);
$('.refValue').show();
} else if (prizeType == 14) {
$awardList.eq(4).show().siblings('.awardList').hide();
$awardList.eq(4).find('select').val(data.referenceId);
let $selected = $awardList.eq(4).find('select option:selected');
let referenceId = $selected.val();
let awardName = $selected.text();
$awardList.eq(4).find('input[type="text"]').val(awardName);
$awardList.eq(4).find('input[type="hidden"]').val(referenceId);
$('#refValue').val(data.referenceValue);
$('.refValue').show();
} else {
$awardList.hide();
}
$('#addType').val(data.prizeType);
$('#prizeName').val(data.prizeName);
$('#prizeId').val(data.id);
$('#imgUrl').attr('src', data.prizeImgUrl);
$('#prizeImgUrl').val(data.prizeImgUrl);
$('#activityAwardModal').modal("show");
console.log(data);
});
$('#addType').on('change', function () {
clearAwardList();
$awardList.each(function () {
$(this).hide();
});
$('.refValue').hide();
var val = parseInt($(this).val());
if (val == 2) {
$awardList.eq(0).show().siblings('.awardList').hide();
} else if (val == 3) {
$awardList.eq(1).show().siblings('.awardList').hide();
$('.refValue').show();
} else if (val == 4) {
$awardList.eq(2).show().siblings('.awardList').hide();
$('.refValue').show();
} else if (val == 11) {
$awardList.eq(3).show().siblings('.awardList').hide();
$('.refValue').show();
} else if (val == 14) {
$awardList.eq(4).show().siblings('.awardList').hide();
$('.refValue').show();
}
})
$('#save').on('click', function () {
if ($('#activityAwardForm').validationEngine('validate')) {
var prizeType = parseInt($('#addType').val());
var referenceId = getReferenceIdAndStatus(prizeType);
console.log(referenceId);
if (referenceId === false && prizeType != 1 && prizeType != 5) {
$("#tipMsg").text("请输入完整的信息");
$("#tipModal").modal('show');
return;
}
var refValue = $('#refValue').val();
if (prizeType == 3 || prizeType == 4 || prizeType == 11 || prizeType == 14) {
if (!refValue) {
$("#tipMsg").text("使用天数必填");
$("#tipModal").modal('show');
return;
}
} else {
refValue = 0;
}
$.ajax({
type: "post",
url: "/admin/activityAward/save",
data: {
id: $('#prizeId').val(),
prizeType: $('#addType').val(),
prizeName: $('#prizeName').val(),
prizeImgUrl: $("#prizeImgUrl").val(),
referenceId: referenceId,
referenceValue: refValue
},
dataType: 'json',
success: function (json) {
if (json.code == 200) {
$("#activityAwardModal").modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败,错误码:" + json.message);
$("#tipModal").modal('show');
}
}
})
}
});
$('#uploadBtn').on('click', function () {
$.ajaxFileUpload({
fileElementId: 'uploadFile',
url: '/admin/upload/img',
type: 'post',
dataType: 'json',
secureuri: false,
async: true,
success: function (json) {
if (json.path) {
if (json.path != '') {
$('#imgUrl').attr('src', json.path);
$('#prizeImgUrl').val(json.path);
} else {
console.log('图片上传失败');
}
} else {
$('#tipMsg').text(json.msg);
$('#tipModal').modal('show');
}
},
error: function (data, status, e) {
console.log(e);
}
})
});
$('#add').on('click', function () {
let isEdit = false;
clearModal();
$('#activityAwardModal').modal('show');
})
$('#table').on('mouseenter', 'img', function (e) {
console.log($(this), e.clientX);
var src = $(this).attr('src');
$('#imgMask img').attr('src', src);
$('#imgMask').show();
$('#imgMask').css({
top: e.clientY + 20,
left: e.clientX + 20
})
})
$('#table').on('mouseleave', 'img', function (e) {
console.log('移出');
$('#imgMask').hide();
});
function combineDataFromBack() {
$.get('/admin/gift/' +
'getAllGiftList?consumeType=1&consumeType=2', function (res) {
if (res.code == 200) {
var data = res.data;
for (var key in data) {
var str = '<option value="' + data[key].giftId + '">' + data[key].giftName + '</option>';
$('#giftChoose').append(str);
}
$('#giftChoose').combobox();
}
})
$.get('/admin/headwear/total/list', {}, function (res) {
if (res.code == 200) {
for (var i = 0; i < res.data.length; i++) {
// var dress = res.data;
var str = '<option value="' + res.data[i].headwearId + '">' + res.data[i].name + '</option>';
$('#headwearChoose').append(str);
}
}
$('#headwearChoose').combobox();
})
$.get('/admin/car/goods/total/list', {}, function (res) {
if (res.code == 200) {
for (var i = 0; i < res.data.length; i++) {
// car.push(res.data[i]);
var str = '<option value="' + res.data[i].id + '">' + res.data[i].name + '</option>';
$('#carChoose').append(str);
}
}
$('#carChoose').combobox();
})
$.get('/admin/nameplate//total/list', {}, function (res) {
if (res.code == 200) {
for (var i = 0; i < res.data.length; i++) {
// car.push(res.data[i]);
var str = '<option value="' + res.data[i].id + '">' + res.data[i].name + '</option>';
$('#nameplateChoose').append(str);
}
}
$('#nameplateChoose').combobox();
})
}
function getReferenceIdAndStatus(prizeType) {
console.log(prizeType);
var referenceId = 0;
var val;
switch (prizeType) {
case 2:
// 线上礼物
val = $form.find('input[name="giftChoose"]').val();
referenceId = val ? val : false;
break;
case 3:
// 座驾
val = $form.find('input[name="carChoose"]').val();
referenceId = val ? val : false;
break;
case 4:
// 头饰
val = $form.find('input[name="headwearChoose"]').val();
referenceId = val ? val : false;
break;
case 11:
val = $form.find('#nobleChoose').val();
referenceId = val ? val : false;
break;
case 14:
val = $form.find('#nameplateChoose').val();
referenceId = val ? val : false;
break;
}
return referenceId;
}
function clearModal() {
$('#activityAwardForm').find('input[type=text],select,input[type=hidden],input[type=file]').each(function () {
$(this).val('');
});
$('.awardList').hide();
$('#activityAwardForm').find('img').attr('src', '');
$('#activityAwardForm').find('.combobox-container').removeClass('combobox-selected');
// $('#addForm').find('select option').attr('selected',false);
}
function clearAwardList() {
$('.awardList').find('input').val('');
}
})
}
}
};
</script>
<style scoped>
#prizeType {
margin-right: 10px;
}
.btn {
margin: 0 4px;
}
.input-group-addon {
width: 0;
}
#uploadBtn,
#addUploadBtn {
margin-top: 4px;
}
#skipUrlSort,
#bannerStatus,
#addSkipUrlSort,
#addBannerStatus {
height: 34px;
}
.attention {
line-height: 30px;
display: inline-block;
margin-top: 4px;
color: red;
}
.awardList {
display: none;
}
#imgMask {
position: absolute;
top: 0;
left: 0;
width: 90px;
height: 90px;
padding: 4px;
background: #fff;
z-index: 999;
display: none;
}
#imgMask img {
width: 100%;
height: 100%;
vertical-align: top;
}
.refValue {
display: none;
}
</style>

View File

@@ -0,0 +1,757 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
<div class="big-tips">
礼包的数据前端是写死的配置时应跟前端一一对应起来后台只会返回有效的礼包并按序号从小到大排序配置好之后不要随意修改<br />
有新的礼包需要上架时请直接新增礼包而不是对现有礼包进行编辑修改方便查数
</div>
礼包状态:
<select name="status" id="statusSelect" data-btn-class="btn-warning">
<option value="0" selected="selected">全部</option>
<option value="1">有效</option>
<option value="2">无效</option>
</select>
活动类型:
<select name="status" id="packTypeSelect" data-btn-class="btn-warning">
<option value="" selected="selected">全部</option>
<option value="0">普通活动</option>
<option value="1">转盘活动</option>
<option value="2">周星榜活动</option>
<option value="3">深海奇缘活动</option>
<option value="6">守护星球</option>
<option value="9">星座物语</option>
<option value="10">航海冒险</option>
<option value="12">十二星座</option>
</select>
<button class="btn btn-default" id="search">
<i class="glyphicon glyphicon-wrench"></i>查询
</button>
<button class="btn btn-primary" id="add">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</section>
</div>
</div>
</section>
<!-- 弹窗 -->
<div class="modal fade" id="packModal" rabindex='-1' role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">x</span>
</button>
<div class="modal-title" id="editModalLabel">奖品设置</div>
</div>
<div class="modal-body">
<form action="" id="addForm" class="form-horizontal">
<div class="form-group name">
<label for="name" class="col-sm-3 control-label">礼包名称</label>
<div class="col-sm-8">
<input type="text" class="validate[required]" name="name" id="name" placeholder="单行输入">
</div>
</div>
<div class="form-group status">
<label for="status" class="col-sm-3 control-label">礼包状态</label>
<div class="col-sm-8">
<select id="status">
<option value="1">有效</option>
<option value="2">无效</option>
</select>
<div class="tips">
<i class="glyphicon glyphicon-info-sign"></i>无效状态的礼包不会返回前端也不允许购买
</div>
</div>
</div>
<div class="form-group imgUrl">
<label class="col-sm-3 control-label">礼包图片</label>
<div class="col-sm-8">
<img src="" alt="" id="imgUrl" style="width: 50px; height: 50px;">
<input type="file" id="uploadFile" name="uploadFile"
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
<button class="btn btn-success" type="button" id="uploadBtn">上传</button>
<input type="hidden" id="alertWinPic" name="alertWinPic"
class="form-control validate[required]">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">活动类型</label>
<div class="col-sm-9">
<label class="radio-inline"><input type="radio" onclick="changeType(this.value)"
name="packType" value="0" checked>普通活动</label>
<label class="radio-inline"><input type="radio" onclick="changeType(this.value)"
name="packType" value="1">转盘活动</label>
<label class="radio-inline"><input type="radio" onclick="changeType(this.value)"
name="packType" value="2">周星榜活动</label>
<label class="radio-inline"><input type="radio" onclick="changeType(this.value)"
name="packType" value="3">深海奇缘活动</label>
<label class="radio-inline"><input type="radio" onclick="changeType(this.value)"
name="packType" value="6">守护星球活动</label>
<label class="radio-inline"><input type="radio" onclick="changeType(this.value)"
name="packType" value="9">星座物语活动</label>
<label class="radio-inline"><input type="radio" onclick="changeType(this.value)"
name="packType" value="10">航海冒险活动</label>
<label class="radio-inline"><input type="radio" onclick="changeType(this.value)"
name="packType" value="12">十二星座活动</label>
</div>
</div>
<div id="ticketNumDiv" class="form-group ticketNum" style="display: none">
<label for="sellingPrice" class="col-sm-3 control-label">赠送门票数量</label>
<div class="col-sm-8">
<input type="text" class="validate[required]" name="ticketNum" id="ticketNum"
placeholder="单行输入">
</div>
</div>
<div class="form-group sellingPrice">
<label for="sellingPrice" class="col-sm-3 control-label">售价</label>
<div class="col-sm-8">
<input type="text" class="validate[required]" name="sellingPrice" id="sellingPrice"
placeholder="单行输入">
</div>
</div>
<div class="form-group originalPrice">
<label for="originalPrice" class="col-sm-3 control-label">原价</label>
<div class="col-sm-8">
<input type="text" class="validate[required]" name="originalPrice" id="originalPrice"
placeholder="单行输入">
</div>
</div>
<div class="form-group stock">
<label for="stock" class="col-sm-3 control-label">库存</label>
<div class="col-sm-8">
<input type="text" class="validate[required]" name="stock" id="stock" placeholder="单行输入">
<br />
<div class="tips">
<i class="glyphicon glyphicon-info-sign"></i>-1代表不限量
</div>
</div>
</div>
<div class="form-group allowBuyNum">
<label for="allowBuyNum" class="col-sm-3 control-label">允许购买数量</label>
<div class="col-sm-8">
<input type="text" class="validate[required]" name="allowBuyNum" id="allowBuyNum"
placeholder="单行输入">
<br />
<div class="tips">
<i class="glyphicon glyphicon-info-sign"></i>-1代表不限量
</div>
</div>
</div>
<div class="form-group validity">
<label class="col-sm-3 control-label">礼包开放日期</label>
<div class="col-sm-8">
<input type="text" name="startDate" id="timeBegin" class="input-sm" placeholder="起始时间">
- <input type="text" name="endDate" id="timeEnd" class="input-sm" placeholder="结束时间">
</div>
</div>
<div class="form-group seqNo">
<label class="col-sm-3 control-label">序号</label>
<div class="col-sm-8">
<input type="text" class="validate[required]" name="seqNo" id="seqNo" placeholder="单行输入">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" data-primary="addSave" id="save">保存</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="addAwardModal" rabindex='-1' role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">x</span>
</button>
<div class="modal-title" id="addModalLabel">添加奖品</div>
</div>
<div class="modal-body">
<form action="" id="addAwardForm" class="form-horizontal">
<div class="form-group">
<label for="award" class="col-sm-3 control-label">奖品</label>
<select id="award" name="award" class="validate[required]">
<option value="0">---选择奖品---</option>
</select>
</div>
<div class="form-group">
<label for="awardNum" class="col-sm-3 control-label">奖品数量</label>
<input type="text" class="validate[required]" name="awardNum" id="awardNum"
placeholder="单行输入数字">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" data-primary="saveAwardData" id="saveAward">保存</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="packItemListModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document" style="width:55%">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="assignRoomsLabel">奖池列表</h4>
</div>
<div class="modal-body">
<div id="packItemListTable"></div>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "ActivityPackAdminView",
setup() {
function changeType(value) {
// alert(value);
if (value == 0) {
$("#ticketNumDiv").hide();
var num = $("#ticketNum").val();
if (num == null || num == "" || num == undefined) {
$("#ticketNum").val(0);
}
} else {
$("#ticketNumDiv").show();
}
}
window.changeType = changeType;
return {
changeType
};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
var picker1 = $('#timeBegin').datepicker({
format: 'yyyy-mm-dd',
autoclose: true
});
var picker2 = $('#timeEnd').datepicker({
format: 'yyyy-mm-dd',
autoclose: true
});
picker1.on('changeDate', function () {
var date = $('#timeBegin').datepicker('getDate');
picker2.datepicker('setStartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#timeEnd').datepicker('getDate');
picker1.datepicker('setEndDate', date);
});
var main = {
init: function () {
this.eventRegister();
this.initData();
},
eventRegister: function () {
// 编辑按钮点击事件
$('#table').on('click', '.opt-edit', function () {
clearModal();
$('#packModal').modal('show');
var id = parseInt($(this).data('id'));
editId = id;
if (id == 'undefined' || !id) {
return;
}
var data = $('#table').bootstrapTable('getRowByUniqueId', id);
$('#name').val(data.name);
$('#imgUrl').attr('src', data.imgUrl);
$('#sellingPrice').val(data.sellingPrice);
if (data.packType == 1) {
$("input:radio[name='packType']")[1].checked = true;
$("#ticketNumDiv").show();
} else if (data.packType == 3) {
$("input:radio[name='packType']")[3].checked = true;
$("#ticketNumDiv").show();
} else if (data.packType == 4) {
$("input:radio[name='packType']")[4].checked = true;
$("#ticketNumDiv").show();
} else if (data.packType == 9) {
$("input:radio[name='packType']")[9].checked = true;
$("#ticketNumDiv").show();
} else {
$("input:radio[name='packType']")[0].checked = true;
}
$('#ticketNum').val(data.ticketNum);
$('#originalPrice').val(data.originalPrice);
$('#stock').val(data.stock);
$("#allowBuyNum").val(data.allowBuyNum);
$('#status').val(data.status);
$('#timeBegin').val(new Date(data.beginTime).format('yyyy-MM-dd'));
$('#timeEnd').val(new Date(data.endTime).format('yyyy-MM-dd'));
$('#seqNo').val(data.seqNo);
});
$('#table').on('click', '.opt-award', function () {
var id = parseInt($(this).data('id'));
editId = id;
$('#addAwardModal').modal('show');
});
$('#table').on('click', '.opt-awardList', function () {
var id = parseInt($(this).data('id'));
editId = id;
initPackItemsListTable(id);
$('#packItemListModal').modal('show');
});
$('#table').on("click", '.opt-close', function () {
var $btn = $(this);
var packId = $btn.attr("data-id");
$btn.attr('disabled', true);
if (confirm("确定关闭?")) {
$.ajax({
type: 'post',
url: '/admin/activity/pack/close',
data: {
packId: packId
},
dataType: 'json',
success: function (res) {
$btn.attr('disabled', false);
if (res.code == 200) {
$("#tipMsg").text("关闭成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("关闭失败." + res.msg);
$("#tipModal").modal('show');
}
}
});
}
});
$('#packItemListTable').on("click", '.opt-del', function () {
var $btn = $(this);
var itemId = $btn.attr("data-id");
$btn.attr('disabled', true);
if (confirm("确定删除?")) {
$.ajax({
type: 'post',
url: '/admin/activity/pack/delPackItem',
data: {
itemId: itemId
},
dataType: 'json',
success: function (res) {
$btn.attr('disabled', false);
if (res.code == 200) {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#packItemListTable");
} else {
$("#tipMsg").text("删除失败." + res.msg);
$("#tipModal").modal('show');
}
}
});
}
});
// 添加事件
$('#add').on('click', function () {
editId = 0;
clearModal();
$('#packModal').modal('show');
});
// 上传图片
$('#uploadBtn').on('click', function () {
if ($('#uploadFile').val() == '') {
$('#tipMsg').text('上传图片为空');
$('#tipModal').modal('show');
return;
}
var options = {
type: 'post',
url: '/admin/upload/img',
dataType: 'json',
success: function (res) {
if (res.path) {
$('#alertWinPic').val(res.path);
$('#imgUrl').attr('src', res.path);
console.log(res.path);
} else {
$('#tipMsg').text(res.msg);
$('#tipModal').modal('show');
}
}
}
$('#addForm').ajaxSubmit(options);
});
// 保存
$('#save').on('click', function () {
if ($('#addForm').validationEngine('validate')) {
var param = {};
param.id = editId;
param.name = $('#name').val();
param.imgUrl = $('#imgUrl').attr('src');
param.sellingPrice = $('#sellingPrice').val();
param.packType = $('input[name="packType"]:checked').val();
param.ticketNum = $('#ticketNum').val();
param.ticketNum = param.ticketNum == "" ? 0 : param.ticketNum;
param.originalPrice = $('#originalPrice').val();
param.stock = $('#stock').val();
param.allowBuyNum = $('#allowBuyNum').val();
param.status = $('#status').val();
param.beginTime = $('#timeBegin').val() + " 00:00:00";
param.endTime = $('#timeEnd').val() + " 23:59:59";
param.seqNo = $('#seqNo').val();
$.ajax({
type: 'post',
url: '/admin/activity/pack/saveOrUpdate',
data: param,
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$('#packModal').modal('hide');
$('#tipMsg').text('保存成功');
$('#tipModal').modal('show');
TableHelper.doRefresh('#table')
} else {
$('#tipMsg').text('保存失败,错误码:' + res.message);
$('#tipModal').modal('show');
}
}
})
}
});
$('#saveAward').on('click', function () {
if ($('#addAwardForm').validationEngine('validate')) {
// 获取时间参数
var param = {};
param.packId = editId;
param.awardId = $('#award').val();
param.num = $('#awardNum').val();
$('#saveAward').attr('disabled', true);
// 保存请求
$.ajax({
type: "POST",
url: "/admin/activity/pack/savePackItem",
dataType: "json",
data: param,
success: function (data) {
$('#saveAward').attr('disabled', false);
if (data.code == 200) {
$('#addAwardModal').modal('hide');
$('#tipMsg').text('保存成功');
$('#tipModal').modal('show');
$('#addModal').modal('hide');
TableHelper.doRefresh('#table');
} else {
$('#tipMsg').text(data.message);
$('#tipModal').modal('show');
}
}
});
}
});
$("#search").on('click', function () {
TableHelper.doRefresh('#table');
});
},
initData: function () {
$.get('/admin/activityAward/total', {}, function (res) {
if (res.code == 200) {
for (var i = 0; i < res.data.length; i++) {
var str = '<option value="' + res.data[i].id + '">' + res.data[i].prizeName + '</option>';
$('#award').append(str);
}
}
})
}
};
main.init();
var editId = 0;
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: '礼包ID', align: 'center', valign: 'middle', width: '5%' },
{ field: 'name', title: '礼包名称', align: 'center', valign: 'middle', width: '10%' },
{
field: 'imgUrl', title: '礼包图片', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
return '<img src="' + val + '" alt="" style="width: 30px; height: 30px;">';
}
},
{
field: 'packType', title: '活动类型', align: 'center', valign: 'middle', width: '5%', formatter: function (val, row, index) {
switch (val) {
case 0:
return '普通活动';
case 1:
return '转盘活动';
case 2:
return '周星榜活动';
case 3:
return '深海奇缘活动';
case 6:
return '守护星球活动';
case 9:
return '星座物语活动';
case 10:
return '航海冒险活动';
case 12:
return '十二星座活动';
}
}
},
{ field: 'ticketNum', title: '赠送门票数量', align: 'center', valign: 'middle', width: '10%' },
// {field: 'type', title: '礼包类型', align: 'center', valign: 'middle', width: '5%',formatter: function(val,row,index){
// switch (val) {
// case 1:
// return '普通礼包';
// break;
// case 2:
// return '特殊礼包';
// }
// }},
{
field: 'status', title: '礼包状态', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
switch (val) {
case 1:
return '有效';
case 2:
return '无效';
}
}
},
{ field: 'sellingPrice', title: '售价', align: 'center', valign: 'middle', width: '5%' },
{ field: 'originalPrice', title: '原价', align: 'center', valign: 'middle', width: '5%' },
{ field: 'stock', title: '库存量', align: 'center', valign: 'middle', width: '5%' },
{ field: 'allowBuyNum', title: '允许购买数量', align: 'center', valign: 'middle', width: '5%' },
{
field: 'beginTime', title: '开放购买时间', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{
field: 'endTime', title: '截止购买时间', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{
field: 'seqNo', title: '排序序号', align: 'center', valign: 'middle', width: '5%', formatter: function (val, row, index) {
return '<span style="color: red">' + val + '</span>';
}
},
{
field: 'tmp', title: '操作', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
var key = row.id;
var status = row.status;
var str = '<button class="btn btn-primary btn-sm opt-edit" data-id="' + key + '">编辑礼包</button>';
if (status == 1) {
str += '<button class="btn btn-primary btn-sm opt-close" data-id="' + key + '">关闭礼包</button>';
}
str += '<button class="btn btn-primary btn-sm opt-award" data-id="' + key + '">添加奖品</button>' +
'<button class="btn btn-primary btn-sm opt-awardList" data-id="' + key + '">奖品列表</button>';
return str;
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: false,
pageList: [10, 20, 30, 50],
sidePagination: 'server',
queryParamsType: 'undefined',
queryParams: function queryParams() {
var param = {
status: $('#statusSelect').val(),
packType: $('#packTypeSelect').val()
};
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/activity/pack/list',
onLoadSuccess: function () {
console.log('load success');
},
onLoadError: function () {
console.log('load fail');
}
});
function clearModal() {
$('#addForm').find('input[type=text],select,input[type=hidden]').each(function () {
$(this).val('');
});
$('#addForm').find('img').attr('src', '');
$('#addForm').find('.combobox-container').removeClass('combobox-selected');
}
function initPackItemsListTable(packId) {
$('#packItemListTable').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#packItemListTable').bootstrapTable({
columns: [
{ field: 'id', title: 'ID', align: 'center', width: '5%', valign: 'middle', visible: false },
{ field: 'name', title: '奖品名称', align: 'center', width: '5%', valign: 'middle' },
{
field: 'type', title: '奖品类型', align: 'center', width: '5%', valign: 'middle', formatter: function (val, row, index) {
switch (val) {
case 1:
return '金币';
case 2:
return '在线礼物';
case 3:
return '座驾';
case 4:
return '头饰';
case 5:
return '背景';
case 6:
return '实物';
case 7:
return '靓号';
case 8:
return '全麦礼物';
case 9:
return '随机靓号';
case 10:
return '锤子';
case 11:
return '贵族爵位';
case 12:
return '萝卜';
case 14:
return '铭牌';
}
}
},
{
field: 'imgUrl', title: '奖品图片', align: 'center', width: '5%', valign: 'middle', formatter: function (val, row, index) {
return '<img src="' + val + '" alt="" style="width: 30px; height: 30px;">';
}
},
{ field: 'referenceValue', title: '使用天数', align: 'center', width: '5%', valign: 'middle' },
{ field: 'num', title: '数量', align: 'center', width: '5%', valign: 'middle' },
{
field: 'createTime',
title: '创建时间',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:00");
} else {
return '-';
}
}
},
{
field: 'temp',
title: '操作',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
return '<button class="btn btn-sm btn-success opt-del" data-id=' + row.id + '>' +
'<i class="glyphicon glyphicon-move"></i> 删除</button>';
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams() { //设置查询参数
var param = {
packId: packId
};
return param;
},
url: '/admin/activity/pack/listPackItems',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
}
})
}
}
};
</script>
<style scoped>
input {
outline: none;
padding: 3px;
}
.tips {
color: red;
}
.big-tips {
color: red;
font-size: larger;
font-weight: bold;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,568 @@
<template>
<section class="content">
<div class="box box-primary">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
<!-- <form action="" id="searchForm" method="POST">
起始时间<input type="text" name="searchTimeBegin" id="searchTimeBegin" class="input-sm" placeholder="请输入开始时间">
</form>
<button class="btn btn-primary" id="searchBtn">搜索</button> -->
<button class="btn btn-primary" id="addBtn">新增</button>
</div>
</section>
</div>
</section>
<!-- 新增框 -->
<div class="modal fade" id="addModal" rabindex='-1' role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">x</span>
</button>
<div class="modal-title" id="addModalLabel">家族PK活动配置</div>
</div>
<div class="modal-body">
<form action="" id="addForm" class="form-horizontal">
<!-- 起始时间 -->
<div class="form-group">
<div class="col-sm-12" id="attention" style="color:red;">注意无论选择什么时间都会设置到选择时间所在周的周四</div>
<label for="addTimeBegin" class="col-sm-3 control-label">起始时间</label>
<div class="col-sm-8">
<input type="text" id="addTimeBegin" name="addTimeBegin" class="validate[required]"
placeholder="请输入时间">
</div>
</div>
<!-- 房间ID -->
<div class="form-group">
<label for="roomID" class="col-sm-3 control-label">房主66ID</label>
<div class="col-sm-8">
<input type="text" id="roomID" name="roomID" class="validate[required] input-sm"
placeholder="多个房间请用英文,隔开" style="width: 400px; border: 1px solid lightgray">
</div>
</div>
<!-- 荣誉奖励 -->
<div class="form-group">
<label class="col-sm-3 control-label">荣誉奖励</label>
<div class="col-sm-8 selectBox">
<!-- <div class="prize" style="display: flex;justify-content: flex-start;">
<input type="text" id="hornorPrize1" class="input-sm" name="hornorPrize1" placeholder="" style="border: 1px solid lightgray">
<img src="" alt="" id="imgUrl1" style="width: 70px;height: 70px;margin-left:20px;">
<input type="file" id="uploadFile1" name="uploadFile" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
<input type="hidden" id="alertWinPic1" name="alertWinPic1" class="form-control">
</div>
<div class="prize" style="display: flex;justify-content: flex-start;">
<input type="text" id="hornorPrize2" class="input-sm" name="hornorPrize2" placeholder="" style="border: 1px solid lightgray">
<img src="" alt="" id="imgUrl2" style="width: 70px;height: 70px;margin-left:20px;">
<input type="file" id="uploadFile2" name="uploadFile" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
<input type="hidden" id="alertWinPic2" name="alertWinPic2" class="form-control">
</div>
<div class="prize" style="display: flex;justify-content: flex-start;">
<input type="text" id="hornorPrize3" class="input-sm" name="hornorPrize3" placeholder="" style="border: 1px solid lightgray">
<img src="" alt="" id="imgUrl3" style="width: 70px;height: 70px;margin-left:20px;">
<input type="file" id="uploadFile3" name="uploadFile" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
<input type="hidden" id="alertWinPic3" name="alertWinPic3" class="form-control">
</div>
<div class="prize" style="display: flex;justify-content: flex-start;">
<input type="text" id="hornorPrize4" class="input-sm" name="hornorPrize4" placeholder="" style="border: 1px solid lightgray">
<img src="" alt="" id="imgUrl4" style="width: 70px;height: 70px;margin-left:20px;">
<input type="file" id="uploadFile4" name="uploadFile" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
<input type="hidden" id="alertWinPic4" name="alertWinPic4" class="form-control">
</div>
<div class="prize" style="display: flex;justify-content: flex-start;">
<input type="text" id="hornorPrize5" class="input-sm" name="hornorPrize5" placeholder="" style="border: 1px solid lightgray">
<img src="" alt="" id="imgUrl5" style="width: 70px;height: 70px;margin-left:20px;">
<input type="file" id="uploadFile5" name="uploadFile" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
<input type="hidden" id="alertWinPic5" name="alertWinPic5" class="form-control">
</div>
<div class="prize" style="display: flex;justify-content: flex-start;">
<input type="text" id="hornorPrize6" class="input-sm" name="hornorPrize6" placeholder="" style="border: 1px solid lightgray">
<img src="" alt="" id="imgUrl6" style="width: 70px;height: 70px;margin-left:20px;">
<input type="file" id="uploadFile6" name="uploadFile" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
<input type="hidden" id="alertWinPic6" name="alertWinPic6" class="form-control">
</div> -->
<select name="" id="prize_first" class="combobox">
<!-- <option value="0">请选择</option> -->
</select>
<select name="" id="prize_second" class="combobox">
<!-- <option value="0">请选择</option> -->
</select>
<select name="" id="prize_third" class="combobox">
<!-- <option value="0">请选择</option> -->
</select>
<select name="" id="prize_four" class="combobox">
<!-- <option value="0">请选择</option> -->
</select>
<select name="" id="prize_five" class="combobox">
<!-- <option value="0">请选择</option> -->
</select>
<select name="" id="prize_six" class="combobox">
<!-- <option value="0">请选择</option> -->
</select>
</div>
</div>
<!-- 描述 -->
<div class="form-group">
<label for="introduce" class="col-sm-3 control-label">描述</label>
<div class="col-sm-8">
<input type="text" id="introduce" name="introduce" class="validate[required]"
placeholder="">
</div>
</div>
<!-- 上传图片 -->
<!-- <div class="form-group">
<img src="" alt="" id="imgUrl" style="width: 100px;height: 50px;">
<input type="file" id="uploadFile" name="uploadFile" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
<button class="btn btn-success">上传</button>
<input type="hidden" id="alertWinPic" name="alertWinPic" class="form-control validate[required]">
</div> -->
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" data-primary="addSaveData" id="addSave">保存</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">提示信息</h4>
</div>
<div class="modal-body" id="tipMsg"></div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "FamilyPkManageAdminView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
// var picker1 = $('#searchTimeBegin').datetimepicker({
// format: 'yyyy-mm-dd hh:ii:00',
// autoclose: true,
// endDate: new Date()
// });
var $id = '';
var selectArr = [];
var prizeObj = {};
var picker2 = $('#addTimeBegin').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true,
endDate: new Date()
});
var main = {
init: function () {
this.eventRegister();
this.valueChange();
},
eventRegister: function () {
// 新增按钮点击事件
$('#addBtn').on('click', function () {
$('#addModal').modal('show');
clearModal();
});
// 监听荣誉奖励select框变化
$('.selectBox').on('change', 'select', function () {
switch ($(this).attr('id')) {
case 'prize_first':
selectArr.push($(this).val());
break;
case 'prize_second':
selectArr.push($(this).val());
break;
case 'prize_third':
selectArr.push($(this).val());
break;
case 'prize_four':
selectArr.push($(this).val());
break;
case 'prize_five':
selectArr.push($(this).val());
break;
case 'prize_six':
selectArr.push($(this).val());
break;
}
console.log(selectArr);
});
// 添加保存按钮点击事件
$('#addSave').on('click', function () {
// 获取时间参数
var $time = $('#addTimeBegin').val();
if ($time == '' || $time == 'undefined') {
$('#tipMsg').text('时间项不能为空');
$('#tipModal').modal('show');
return;
}
// 获取房间ID参数
var idArr = $('#roomID').val().split(',');
if ($roomId == '' || $roomId == 'undefined') {
$('#tipMsg').text('房间ID不能为空');
$('#tipModal').modal('show');
return;
} else if (idArr.length > 6) {
$('#tipMsg').text('参与PK房间数超过6个');
$('#tipModal').modal('show');
return;
}
var $roomId = $('#roomID').val();
// 获取荣耀奖励参数
// var prizeArr = [];
// for(var i = 0 ; i < selectArr.length ; i++) {
// if(prizeArr.indexOf(selectArr[i]) == -1) {
// prizeArr.push(selectArr[i]);
// } else {
// $('#tipMsg').text('您已选择过相同奖品');
// $('#tipModal').modal('show');
// return;
// }
// }
var awardArr = $('.selectBox').find('input[type="hidden"]');
var awardIdArr = [];
var awardObj = {}, repeatBol = false;
for (var i = 0; i < awardArr.length; i++) {
var awardId = awardArr.eq(i).val();
if (parseInt(awardId)) {
console.log(awardId);
if (!awardObj[awardId]) {
awardObj[awardId] = 1;
awardIdArr.push(parseInt(awardId));
} else {
repeatBol = true;
break;
}
}
}
// var prizeArr = [];
// for(var i = 0 ; i < $('#addModal').find('.prize').length ; i++) {
// var $prize = $('#addModal').find('.prize').eq(i);
// if($prize.find('input[type=text],input[type=hidden]').val() != '' && $prize.find('img').attr('src') != '') {
// prizeArr.push($prize.find('input[type=text]').val() + '|' + $prize.find('img').attr('src'));
// }else if($prize.find('input[type=text]').val() != '') {
// if($prize.find('img').attr('src') == '') {
// $('#tipMsg').text('奖励'+ (i+1) +'没有对应图片');
// $('#tipModal').modal('show');
// return;
// }
// }else if($prize.find('img').attr('src') != '') {
// if($prize.find('input[type=text]').val() == '' || $prize.find('input[type=text]').val() == 'undefined') {
// $('#tipMsg').text('奖励' + (i+1) + '图片没有对应名称');
// $('#tipModal').modal('show');
// return;
// }
// }
// }
// 获取描述参数
var $introduce = $('#introduce').val();
// id
var id;
if ($id == '' || $id == 'undefined') {
id = '';
} else {
id = $id;
}
var $award = awardIdArr.join(',');
if ($award == 0) {
$('#tipMsg').text('礼物不能为空,至少设置一个');
$('#tipModal').modal('show');
return;
}
// 保存请求
$.post('/admin/familyPkConfig/save', {
id: id,
startDate: $time,
endDate: $time,
roomErbanNoListStr: $roomId,
description: $introduce,
// award: JSON.stringify(prizeArr)
award: $award
}, function (res) {
if (res.code == 200) {
$('#tipMsg').text('保存成功');
$('#tipModal').modal('show');
$('#addModal').modal('hide');
TableHelper.doRefresh('#table');
} else if (res.code == 500) {
$('#tipMsg').text(res.message);
$('#tipModal').modal('show');
}
})
})
// 编辑按钮点击事件
$('#table').on('click', '.opt-edit', function () {
$('#addModal').modal('show');
var id = $(this).data('id');
$id = id;
var data = $('#table').bootstrapTable('getRowByUniqueId', id);
clearModal();
console.log(data);
var date = new Date(data.startDate);
$('#addModal').find('#addTimeBegin').val(date.format('yyyy-MM-dd hh:mm:ss'));
$('#addModal').find('#roomId').val(data.roomErbanNoList);
$('#addModal').find('#introduce').val(data.description);
var arr = data.award.split(',');
var $list = $('#addForm').find('.selectBox select');
for (var i = 0; i < arr.length; i++) {
$list.eq(i).val(arr[i]);
var $target = $list.eq(i).find("option:selected");
var awardId = $target.val();
var awardText = $target.text();
$('.combobox-container').eq(i).find('input[type="text"]').val(awardText);
$('.combobox-container').eq(i).find('input[type="hidden"]').val(awardId);
}
});
// 图片选择监听事件
// $('.prize').on('change','input[type=file]',function() {
// console.log($(this).attr('id'));
// var id = $(this).attr('id').substring(10,11);
// console.log(id);
// $.ajaxFileUpload({
// fileElementId: $(this).attr('id'),
// url: '/admin/upload/img',
// type: 'post',
// dataType: 'json',
// secureuri: false,
// async: true,
// success: function(json) {
// if(json.path) {
// if(json.path != ''){
// $('#imgUrl' + id).attr('src',json.path);
// } else {
// console.log('图片上传失败');
// }
// } else {
// $('#tipMsg').text(json.msg);
// $('#tipModal').modal('show');
// }
// },
// error: function(data,status,e) {
// console.log(e);
// }
// })
// });
},
valueChange: function () {
$.get('/admin/activityAward/total', {}, function (res) {
if (res.code == 200) {
for (var i = 0; i < res.data.length; i++) {
var str = '<option value="' + res.data[i].id + '">' + res.data[i].prizeName + '</option>';
$('.selectBox').find('select').append(str);
prizeObj[res.data[i].id] = res.data[i].prizeName
}
console.log(prizeObj)
$('.selectBox').find('select').combobox();
}
})
}
};
main.init();
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: '编号', align: 'center', valign: 'middle', width: '10%' },
{
field: 'startDate', title: '开始时间', align: 'center', valign: 'middle', width: '15%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{
field: 'endDate', title: '结束时间', align: 'center', valign: 'middle', width: '15%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{
field: 'award', title: '家族奖励', align: 'center', valign: 'middle', width: '15%', formatter: function (val, row, index) {
if (val) {
var arr = val.split(',')
var value = null;
var content = '';
for (var i = 0; i < arr.length; i++) {
value = arr[i];
if (i < arr.length - 1) {
content += (prizeObj[value] + ',');
} else {
content += prizeObj[value];
}
}
return content;
}
// console.log(JSON.parse(val));//["狗|图片地址"]
// if(val) {
// var arr = JSON.parse(val);
// var value = null;
// var content = '';
// for(i in arr) {
// value = arr[i].split('|')[0];
// if(i < arr.length-1) {
// content += (value+',');
// } else {
// content += value;
// }
// }
// return content;
// }
}
},
{ field: 'roomErbanNoList', title: 'PK家族房主音萌号', align: 'center', valign: 'middle', width: '10%' },
{
field: 'createTime', title: '创建时间', align: 'center', valign: 'middle', width: '15%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{ field: 'description', title: '描述', align: 'center', valign: 'middle', width: '10%' },
{
field: '', title: '操作', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
var key = row.id;
var startDate = new Date(row.startDate);
var endDate = new Date(row.endDate);
var curDate = new Date();
if (curDate.getTime() >= startDate.getTime()) {
return '<button class="btn btn-primary btn-sm opt-edit" disabled data-id="' + key + '">不可编辑</button>';
} else {
return '<button class="btn btn-primary btn-sm opt-edit" data-id="' + key + '">编辑</button>';
}
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pageList: [10, 20, 30, 50],
pagination: true,
sidePagination: 'server',
queryParamsType: 'undefined',
queryParams: function queryParams(params) {
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
}
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/familyPkConfig/list',
onLOadSuccess: function () {
console.log('load success');
},
onLoadError: function () {
console.log('load fail');
}
});
})
function clearModal() {
$('#addForm').find('input[type=text],input[type=hidden],input[type=file]').each(function () {
$(this).val('');
})
$('#addForm').find('img').attr('src', '');
$('#addForm').find('.combobox-container').removeClass('combobox-selected');
var selectArr = [];
// $('#addForm').find('option[value="0"]').attr('selected',true);
}
}
}
};
</script>
<style scoped>
.input-group-addon {
width: 0;
padding: 5px 12px;
}
.selectBox .combobox-container {
margin-top: 5px;
}
</style>

View File

@@ -0,0 +1,549 @@
<template>
<section class="content">
<div class="box box-primary">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div class="group-table-section">
<div class="prize-group-wrapper js-normal-prize-group-wrapper">
<div class="header-wrapper">
<div class="right-content js-no-editing">
<div class="action-btn-wrap"><button class="btn btn-primary js-edit-group"
data-pool-type="1">编辑</button></div>
</div>
<div class="right-content right-content-edit js-editing">
<div class="action-btn-wrap">
<button class="btn btn-primary js-add-prize">新增</button>
<button class="btn btn-danger js-save-edit">保存</button>
<button class="btn btn-default js-cancel-edit">取消</button>
</div>
</div>
</div>
<table class="prize-group-table table table-hover table-striped">
<tr>
<th>ID</th>
<th>名称</th>
<th>图片</th>
<th>倍数</th>
</tr>
</table>
</div>
</div>
</section>
</div>
</section>
<!-- 添加弹窗 -->
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">x</span>
</button>
<h4 class="modal-title" id="addModalLabel">新增</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="addForm">
<input type="hidden" name="id" id="id" />
<div class="form-group">
<label for="modal_name" class="col-sm-3 control-label">名称<font color="red">*</font>:</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="name" id="modal_name"
placeholder="配置名称只能为中文,数字,大小写英文与下划线">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">配置图片<font color="red">*</font>:</label>
<div class="col-sm-9">
<img src="" id="picImage" style="width:250px;height:90px;" alt="">
<input type="file" id="picUploadFile" name="file">
<button class="btn btn-success" type="button" id="picUploadBtn">上传</button>
<input type="hidden" id="picUrl" name="imgUrl" class="form-control validate[required]" />
<span id="picImgInfo" style="color:red;"></span>
</div>
</div>
<div class="form-group">
<label for="module_multiple" class="col-sm-3 control-label">倍数:<font color="red">*</font>
:</label>
<div class="col-sm-9">
<input type="text" class="input-sm form-control datetime validate[required]" name="multiple"
id="module_multiple" placeholder="倍数需要大于等于1">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-default" type="button" id="addCancel">取消</button>
<button class="btn btn-primary" type="button" id="addSave">保存</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">提示信息</h4>
</div>
<div class="modal-body" id="tipMsg"></div>
</div>
</div>
</div>
</template>
<script>
var seniorPrizeGroupCache;
var isSeniorPrizeEditing;
export default {
name: "LuckySeaItemAdminView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
const POOL_TYPE = {
normal: 1,
senior: 2,
}
function changeDateValue(propName, idx, inputValue) {
editingNormalPrizeGroup[idx][propName] = inputValue;
reRenderPage({
normalPrizeGroup: editingNormalPrizeGroup,
})
}
function inputChanged(e) {
const propName = $(e.target).attr("name");
const idx = $(e.target).attr("data-idx");
const inputValue = e.target.value;
console.log("input change", e, propName, idx, inputValue);
changeDateValue(propName, idx, inputValue);
}
function removePirzeItem(e) {
const idx = $(e.target).attr("data-idx");
if (confirm("你确定要移除吗?")) {
editingNormalPrizeGroup.splice(idx, 1);
console.debug("remove item", editingNormalPrizeGroup)
reRenderPage({
normalPrizeGroup: editingNormalPrizeGroup,
});
}
}
function renderPrizeGroup(items, isEdit) {
let wrapperClassName = '.js-normal-prize-group-wrapper';
if (isEdit) {
console.debug("show editing action btns")
$(`${wrapperClassName} .js-no-editing`).hide();
$(`${wrapperClassName} .js-editing`).show();
} else {
console.debug("hide editing action btns")
$(`${wrapperClassName} .js-no-editing`).show();
$(`${wrapperClassName} .js-editing`).hide();
}
const groupTableDom = $(`${wrapperClassName} .prize-group-table`);
$(`${wrapperClassName} .prize-group-table input`).unbind("change");
$(`${wrapperClassName} .prize-group-table .js-remove-item`).unbind("click");
groupTableDom.html("<thead><tr>\n" +
" <th>ID</th>\n" +
" <th>名称</th>\n" +
" <th>图片</th>\n" +
" <th>倍数</th>\n" +
" </tr></thead>");
groupTableDom.append("<tbody>")
items.forEach((item, idx) => {
const tds = [];
if (isEdit) {
tds.push(`<td><i class="glyphicon glyphicon-remove js-remove-item" data-idx="${idx}"></i>${item.id}</td>`);
} else {
tds.push(`<td>${item.id}</td>`)
}
if (isEdit) {
tds.push(`<td><input type="text" name="name" data-idx="${idx}" value="${item.name}"></td>`);
} else {
tds.push(`<td>${item.name}</td>`)
}
if (isEdit) {
tds.push(`<td>
<img width="40" height="40" name="imgUrl" data-idx="${idx}" src="${item.imgUrl}"/>
<input type="file" id = "picUploadFile2${idx}" name="file">
<button class="btn btn-success picUploadBtn" type="button" class="picUploadBtn2" data-idx="${idx}" >上传</button>
</td>`)
} else {
tds.push(`<td><img width="40" height="40" src="${item.imgUrl}"/></td>`)
}
if (isEdit) {
tds.push(`<td><input type="text" name="multiple" data-idx="${idx}" value="${item.multiple}"></td>`)
} else {
tds.push(`<td>${item.multiple}</td>`)
}
let row = `<tr>${tds.join()}</tr>`;
groupTableDom.append(row);
})
groupTableDom.append("</tbody>")
// 注册输入框变更事件
$(`${wrapperClassName} .prize-group-table input[type=text]`).bind('change', inputChanged);
// 注册删除事件
$(`${wrapperClassName} .prize-group-table .js-remove-item`).bind("click", removePirzeItem);
// 变更图片
$(`${wrapperClassName} .prize-group-table .picUploadBtn`).bind("click", changedImg);
}
let normalPrizeGroupCache;
let statisticsDatas;
let deployedStatisticsDatas;
let editingNormalPrizeGroup;
let currentPoolLineId;
let maxLineId;
let isNormalPrizeEditing = false;
var renderPageWhenInit = function (groupData) {
const normalPrizeGroup = groupData.rows;
normalPrizeGroupCache = normalPrizeGroup;
editingNormalPrizeGroup = null;
isNormalPrizeEditing = false;
renderPrizeGroup(normalPrizeGroup, false)
}
var getPageInfo = function () {
$.get('/admin/luckySea/listItem.action', {
}, function (res) {
console.log(res);
const data = res;
renderPageWhenInit(data);
})
}
getPageInfo();
function deepClone(o) {
// 判断如果不是引用类型,直接返回数据即可
if (typeof o === 'string' || typeof o === 'number' || typeof o === 'boolean' || typeof o === 'undefined') {
return o
} else if (Array.isArray(o)) { // 如果是数组,则定义一个新数组,完成复制后返回
// 注意这里判断数组不能用typeof因为typeof Array 返回的是object
console.log(typeof []) // --> object
var _arr = []
o.forEach(item => { _arr.push(deepClone(item)) })
return _arr
} else if (typeof o === 'object') {
var _o = {}
for (let key in o) {
_o[key] = deepClone(o[key])
}
return _o
}
}
$('.js-edit-group').on('click', function () {
// 进入编辑状态,则使用深度拷贝复制2组数据
if (!editingNormalPrizeGroup) {
editingNormalPrizeGroup = deepClone(normalPrizeGroupCache);
}
isNormalPrizeEditing = true;
renderPrizeGroup(editingNormalPrizeGroup, true)
});
var reRenderPage = function (groupData) {
console.debug("reRenderPage groupData", groupData)
const normalPrizeGroup = groupData.normalPrizeGroup;
renderPrizeGroup(normalPrizeGroup, isNormalPrizeEditing)
}
$('.js-cancel-edit').on('click', function () {
console.log("js-cancel-edit ", normalPrizeGroupCache);
editingNormalPrizeGroup = null;
isNormalPrizeEditing = false;
reRenderPage({
normalPrizeGroup: normalPrizeGroupCache,
});
});
// 保存编辑
$('.js-save-edit').on('click', function () {
isNormalPrizeEditing = false;
const prizeItems = editingNormalPrizeGroup;
console.log("js-save-edit prizeGroup", editingNormalPrizeGroup);
prizeItems.forEach((item, idx) => {
if (item.id === '-') {
item.id = null;
}
});
$.ajax({
type: "post",
url: "/admin/luckySea/saveLuckySeaActItems",
data: JSON.stringify({
items: editingNormalPrizeGroup,
}),
dataType: "json",
contentType: 'application/json',
success: function (json) {
if (json.success) {
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
getPageInfo();
} else {
$("#tipMsg").text("保存失败." + json.message);
$("#tipModal").modal('show');
isNormalPrizeEditing = true;
}
}
});
});
function clearModal() {
$('#addForm').find('input[type=text],input[type=hidden],input[type=file],img,span').each(function () {
$(this).val('');
$(this).html('');
$(this).attr("src", '');
});
$('#editForm').find('input[type=text],select,input[type=hidden]').each(function () {
$(this).val('');
});
}
// 添加按钮事件
$('.js-add-prize').on('click', function () {
clearModal();
$('#addModal').modal('show');
});
// 保存按钮事件
$('#addSave').on('click', function () {
console.log(' before editingNormalPrizeGroup', editingNormalPrizeGroup)
const newItem = {
id: '-',
name: $('#modal_name').val(),
imgUrl: $('#picUrl').val(),
multiple: $('#module_multiple').val()
}
// 按平台价值递增排序
let insertIdx = editingNormalPrizeGroup.length;
for (let i = 0; i < editingNormalPrizeGroup.length; i++) {
const exsistsPrize = editingNormalPrizeGroup[i];
if (newItem.multiple < exsistsPrize.multiple) {
insertIdx = i;
break;
}
}
isNormalPrizeEditing = true;
editingNormalPrizeGroup.splice(insertIdx, 0, newItem);
console.log('after editingNormalPrizeGroup', editingNormalPrizeGroup)
reRenderPage({
normalPrizeGroup: editingNormalPrizeGroup,
});
$('#addModal').modal('hide');
});
$('#addCancel').on('click', function () {
$('#addModal').modal('hide');
});
// 上传图片
$('#picUploadBtn').on('click', function () {
$.ajaxFileUpload({
fileElementId: 'picUploadFile', //需要上传的文件域的ID即<input type="file">的ID。
url: '/admin/luckySea/upload', //后台方法的路径
type: 'post', //当要提交自定义参数时这个参数要设置成post
dataType: 'json', //服务器返回的数据类型。可以为xml,script,json,html。如果不填写jQuery会自动判断。
secureuri: false, //是否启用安全提交默认为false。
async: true, //是否是异步
success: function (json) { //提交成功后自动执行的处理函数参数data就是服务器返回的数据。
if (json.path) {
$('#picUrl').val(json.path);
$('#picImage').attr("src", json.path);
if (json.path != '') {
$("#picImgInfo").html('已上传成功');
} else {
$("#picImgInfo").html('未上传成功');
}
console.log(json.path);
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
}
},
error: function (data, status, e) { //提交失败自动执行的处理函数。
console.error(e);
}
});
})
function changedImg(e) {
console.log('发生点啥')
const idx = $(e.target).attr("data-idx");
$.ajaxFileUpload({
fileElementId: `picUploadFile2${idx}`, //需要上传的文件域的ID即<input type="file">的ID。
url: '/admin/luckySea/upload', //后台方法的路径
type: 'post', //当要提交自定义参数时这个参数要设置成post
dataType: 'json', //服务器返回的数据类型。可以为xml,script,json,html。如果不填写jQuery会自动判断。
secureuri: false, //是否启用安全提交默认为false。
async: true, //是否是异步
success: function (json) { //提交成功后自动执行的处理函数参数data就是服务器返回的数据。
if (json.path) {
console.log(json.path);
// 需要重新渲染table
changeDateValue('imgUrl', idx, json.path);
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
}
},
error: function (data, status, e) { //提交失败自动执行的处理函数。
console.error(e);
}
});
}
// 发布
$('.js-deploy').on('click', function () {
if (isSeniorPrizeEditing || isNormalPrizeEditing) {
$('#tipMsg').text('当前有礼物组未报错,请先保存礼物组后再尝试发布');
$('#tipModal').modal('show');
return;
}
if (!normalPrizeGroupCache.isUndeploy && !seniorPrizeGroupCache.isUndeploy) {
$('#tipMsg').text('没有待发布的修改');
$('#tipModal').modal('show');
return;
}
console.debug('js-deploy data', normalPrizeGroupCache, seniorPrizeGroupCache)
if ((normalPrizeGroupCache.prizeItems.length <= 0) ||
(seniorPrizeGroupCache.prizeItems.length <= 0)) {
$('#tipMsg').text('所有的礼物组都必须至少添加一个奖品');
$('#tipModal').modal('show');
return;
}
$('#deployedPrizeRate').text(deployedStatisticsDatas.prizeRate.toFixed(4));
$('#currPrizeRate').text(statisticsDatas.prizeRate.toFixed(4));
$('#currPoolLineId').text(currentPoolLineId);
$('#activePoolLineId').text(maxLineId + 1);
$('#deployConfirmModal').modal('show');
})
$('#deployCancel').on('click', function () {
$('#deployConfirmModal').modal('hide');
})
$('#deployConfirm').on('click', function () {
$.ajax({
type: "post",
url: "/admin/linearlyPool/deploy",
dataType: "json",
contentType: 'application/json',
success: function (json) {
if (json.success) {
$("#tipMsg").text("发布成功.当前奖池线: " + json.data.currentPoolLineId + ". 生效奖池线: " + json.data.willActiveLineId);
$("#tipModal").modal('show');
getPageInfo();
} else {
$("#tipMsg").text(json.message);
$("#tipModal").modal('show');
}
}
});
$('#deployConfirmModal').modal('hide');
})
})
}
}
};
</script>
<style scoped>
.pool-line-name {
font-size: 20px;
}
.dataCount {
display: flex;
justify-content: flex-start;
align-items: center;
margin-top: 10px;
}
.dataCount>p {
padding: 5px;
border-radius: 5px;
/*background: #ccc;*/
margin-right: 20px;
}
.tips {
color: red;
font-size: 14px;
}
.qry_col {
float: left;
}
.group-table-section {
display: flex;
width: 100%;
}
.group-table-section .prize-group-wrapper {
width: 50%;
}
.prize-group-wrapper .header-wrapper {
display: flex;
justify-content: space-between;
max-width: 512px;
}
.prize-group-wrapper .header-wrapper .title {
font-size: 20px;
}
.prize-group-wrapper .header-wrapper .right-content {
display: flex;
justify-content: flex-start;
}
.prize-group-wrapper .header-wrapper .right-content.right-content-edit {
display: none;
}
.prize-group-wrapper .header-wrapper .action-btn-wrap button:not(last-child) {
margin-right: 10px;
}
.prize-group-wrapper .header-wrapper .right-content .undeploy {
color: red;
margin-right: 10px;
}
.prize-group-wrapper .data-wrapper {
display: flex;
margin-top: 12px;
}
.prize-group-wrapper .data-wrapper div {
margin-right: 20px;
}
.prize-group-wrapper .prize-group-table {
margin-top: 12px;
margin-right: 10px;
max-width: 1024px;
}
.prize-group-wrapper .prize-group-table .glyphicon-remove {
color: red;
cursor: pointer;
}
#deployConfirmModal .modal-body {
display: flex;
flex-direction: column;
align-items: center;
}
#deployConfirmModal .modal-body #currPrizeRate {
color: red;
}
#deployConfirmModal .modal-body div:first-child {
margin-bottom: 10px;
}
#deployConfirmModal .modal-body div:last-child {
margin-top: 10px;
}
</style>

View File

@@ -0,0 +1,166 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-sm-12">
<div class="col-sm-4">
<label for="startTime" class="col-sm-4 control-label">开始日期:</label>
<div class="col-sm-8">
<input type="text" class="input-sm form-control" name="startTime" id="startTime">
</div>
</div>
<div class="col-sm-4">
<label for="endTime" class="col-sm-4 control-label">结束日期:</label>
<div class="col-sm-8">
<input type="text" class="input-sm form-control" name="endTime" id="endTime">
</div>
</div>
</div>
<div class="col-sm-12">
<button class="btn btn-default js-quick-search js-quick-search-1" data-days="1">
昨天
</button>
<button class="btn btn-default js-quick-search js-quick-search-7" data-days="7">
最近7天
</button>
<button class="btn btn-default js-quick-search js-quick-search-30" data-days="30">
最近30天
</button>
</div>
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button id="btnExport" class="btn btn-default">
<i class="glyphicon glyphicon-export"></i>导出
</button>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { formatTime } from '@/utils/maintainer';
export default {
name: "LuckySeaPlatformAdminView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('.js-quick-search').on('click', function () {
$('.js-quick-search').removeClass('active')
$(this).addClass('active');
setSearchTimeUseQuickWay($(this));
TableHelper.doRefresh('#table');
});
function setSearchTimeUseQuickWay(quickDom) {
const days = quickDom.attr("data-days");
const today = new Date(new Date().setHours(0, 0, 0, 0));
const todayStr = formatTime(today);
const startTime = formatTime(new Date(today.getTime() - days * 24 * 60 * 60 * 1000));
$('#startTime').val(startTime);
$('#endTime').val(todayStr);
}
const quickDom = $('.js-quick-search-7');
quickDom.addClass('active');
setSearchTimeUseQuickWay(quickDom);
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
var chargeStart = $('#startTime').datepicker({
format: 'yyyy-mm-dd 00:00:00',
autoclose: true
});
var chargeEnd = $('#endTime').datepicker({
format: 'yyyy-mm-dd 00:00:00',
autoclose: true
});
$('#btnExport').on('click', function () {
const startTime = $('#startTime').val();
const endTime = $('#endTime').val();
window.location.href = `/admin/luckySea/exportPlatformStat?startTime=${startTime}&endTime=${endTime}`
});
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#table').bootstrapTable({
columns: [
{
field: 'queryDate', title: '日期', align: 'center', width: '5%',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd');
} else {
return '-';
}
}
},
{ field: 'memberNum', title: '总人数', align: 'center', width: '10%' },
{ field: 'totalPlayTimes', title: '总人次', align: 'center', width: '10%', valign: 'center' },
{ field: 'roundNum', title: '总轮数', align: 'center', width: '5%', },
{ field: 'totalPiece', title: '总投入', align: 'center', width: '5%', },
{ field: 'totalPlatformValue', title: '总平台价值', align: 'center', width: '5%', },
{ field: 'totalTicket', title: '门票', align: 'center', width: '5%', },
],
undefinedText: 0,
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
startTime: $('#startTime').val(),
endTime: $('#endTime').val()
};
return param;
},
toolbar: '#toolbar',
url: '/admin/luckySea/listPlatformStat.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
});
}
}
};
</script>
<style scoped>
#teamDetailModal .modal-dialog,
#userDetailModal .modal-dialog {
width: 50%;
}
</style>

View File

@@ -0,0 +1,285 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
轮次: <input type="text" class="input-sm" name="roundId" id="roundId">
开始时间<input type="text" name="startTime" id="startTime" class="input-sm">
结束时间<input type="text" name="endTime" id="endTime" class="input-sm">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<div class="col-sm-12">
当前库存 <span name="stock" id="stock" />钻石
<button id="editStock" class="btn btn-default">编辑库存</button>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
<div class="modal fade" id="roundDetailModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="roundDetailModalTitle">单轮明细</h4>
</div>
<div class="modal-body">
<div id="roundDetailTable"></div>
</div>
<div class="modal-footer">
<h4 id="roundDetailModalFooter"></h4>
<button type="button" class="btn btn-primary" id="exportRoundDetail">导出</button>
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="editStockModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="editStockModalTitle">编辑库存</h4>
</div>
<div class="modal-body">
设置库存为 <input type="text" name="editedStock" id="editedStock" class="input-sm"> 钻石
</div>
<div class="modal-footer">
<h4 id="editStockModalFooter"></h4>
<button type="button" class="btn btn-primary" id="editStockModelBtn">保存</button>
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "LuckySeaRecordAdminView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
let roundDetailRoundId;
getStock()
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#table').bootstrapTable({
columns: [
{ field: 'roundId', title: '轮次', align: 'center', width: '5%' },
{
field: 'startTime', title: '开始时间', align: 'center', width: '5%',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{
field: 'endTime', title: '结束时间', align: 'center', width: '5%',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{ field: 'memberNum', title: '人数', align: 'center', width: '5%' },
{ field: 'userInputPieceNum', title: '投入', align: 'center', width: '5%' },
{ field: 'prizePieceNum', title: '平台价值', align: 'center', width: '5%' },
{ field: 'ticket', title: '门票', align: 'center', width: '5%' },
{ field: 'prizeName', title: '结果', align: 'center', width: '5%' },
{
field: 'roundId',
title: '操作',
align: 'center',
width: '10%',
formatter: function (val, row, index) {
const roundId = row.roundId
const startTime = new Date(row.startTime).format('yyyy-MM-dd hh:mm:ss')
const endTime = new Date(row.endTime).format('yyyy-MM-dd hh:mm:ss')
const prizeName = row.prizeName
const memberNum = row.memberNum
const userInputPieceNum = row.userInputPieceNum
const prizePieceNum = row.prizePieceNum
const ticket = row.ticket
return '<button id="btnDetail" name="btnDetail" class="btn btn-sm btn-success opt-info" data-roundId=' + roundId +
' startTime=' + startTime + ' endTime=' + endTime + ' prizeName=' + prizeName + ' memberNum=' + memberNum + ' userInputPieceNum=' + userInputPieceNum +
' prizePieceNum=' + prizePieceNum + ' ticket=' + ticket
+ '>' +
'详情</button>';
}
}
],
undefinedText: 0,
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
startTime: $('#startTime').val(),
endTime: $('#endTime').val(),
roundId: $('#roundId').val()
};
return param;
},
toolbar: '#toolbar',
url: '/admin/luckySea/listActRecord.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 查询刷新
$('#btnSearch').on('click', function () {
getStock();
TableHelper.doRefresh('#table');
});
var picker1 = $("#startTime").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
})
var picker2 = $('#endTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
})
// 获取轮次详情
$('#table').on('click', '.opt-info', function () {
const roundId = $(this).attr("data-roundId");
roundDetailRoundId = roundId;
const startTime = $(this).attr("startTime");
const endTime = $(this).attr("endTime");
const prizeName = $(this).attr("prizeName");
const memberNum = $(this).attr("memberNum");
const userInputPieceNum = $(this).attr("userInputPieceNum");
const prizePieceNum = $(this).attr("prizePieceNum");
const ticket = $(this).attr("ticket");
console.log("roundId", roundId, startTime, endTime, prizeName, memberNum, userInputPieceNum, prizePieceNum, ticket)
$('#roundDetailModal #roundDetailModalTitle').text(`${roundId}${startTime} -- ${endTime} 结果:${prizeName} 明细`)
$('#roundDetailModal #roundDetailModalFooter').text(`共计${memberNum}人参与 投入${userInputPieceNum} 平台价值 ${prizePieceNum} 门票${ticket}`)
$('#roundDetailTable').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#roundDetailTable').bootstrapTable({
columns: [
{ field: 'uid', title: 'uid', align: 'center', width: '5%' },
{ field: 'erbanNo', title: '平台号', align: 'center', width: '5%' },
{ field: 'nick', title: '昵称', align: 'center', width: '5%' },
{ field: 'costPieceNum', title: '投入', align: 'center', width: '5%', },
{ field: 'prizePieceNum', title: '平台价值', align: 'center', width: '5%', }
],
undefinedText: 0,
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
roundId: roundId
};
return param;
},
url: '/admin/luckySea/listRoundDrawDetail.action',
onLoadSuccess: function () { //加载成功时执行
$("#roundDetailModal").modal('show');
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
});
// 导出轮次明细
$("#exportRoundDetail").on("click", function () {
window.location.href = `/admin/luckySea/exportRoundDrawDetail?roundId=${roundDetailRoundId}`
});
// 获取库存
function getStock() {
$.ajax({
type: 'get',
url: "/admin/luckySea/getStock.action",
success: function (json) {
if (json.success) {
console.log('data', json.data)
$("#stock").html(json.data)
} else {
$("#stock").html('')
}
}
});
}
$('#editStock').on('click', function () {
$("#editStockModal").modal('show');
});
// 编辑库存
$('#editStockModelBtn').on('click', function () {
$.ajax({
type: 'get',
url: "/admin/luckySea/editStock.action",
data: {
stock: $("#editedStock").val(),
},
dataType: 'json',
success: function (json) {
if (json.success) {
$('#tipMsg').text('编辑成功');
$('#tipModal').modal('show');
$("#editStockModal").modal('hide');
} else {
$('#tipMsg').text('编辑失败,错误信息:' + json.message);
$('#tipModal').modal('show');
}
}
});
});
});
}
}
};
</script>

View File

@@ -0,0 +1,131 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
平台号: <input type="text" class="input-medium" name="erbanNoStr" id="erbanNoStr" placeholder="填多个用,隔开">
开始时间<input type="text" name="startTime" id="startTime" class="input-sm">
结束时间<input type="text" name="endTime" id="endTime" class="input-sm">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button id="btnExport" class="btn btn-sm btn-primary">导出</button>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { cleanArray } from '@/utils/maintainer';
export default {
name: "LuckySeaUserstatAdminView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#table').bootstrapTable({
columns: [
{ field: 'uid', title: 'uid', align: 'center', width: '5%' },
{ field: 'erbanNo', title: '平台号', align: 'center', width: '5%' },
{ field: 'nick', title: '昵称', align: 'center', width: '5%' },
{ field: 'roundId', title: '轮次', align: 'center', width: '5%' },
{
field: 'endTime', title: '结束时间', align: 'center', width: '5%',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{ field: 'costPieceNum', title: '投入', align: 'center', width: '5%' },
{ field: 'prizePieceNum', title: '平台价值', align: 'center', width: '5%' },
],
undefinedText: 0,
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
erbanNoStr: $('#erbanNoStr').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val(),
};
return param;
},
toolbar: '#toolbar',
url: '/admin/luckySea/listUserDrawRecordList.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 导出
$('#btnExport').on('click', function () {
console.log("导出")
window.location.href = `/admin/luckySea/exportUserDrawRecordList?${param(getQueryParams())}`
})
function param(json) {
if (!json) return ''
return cleanArray(Object.keys(json).map(key => {
if (json[key] === undefined) return ''
return encodeURIComponent(key) + '=' +
encodeURIComponent(json[key])
})).join('&')
}
function getQueryParams() {
var param = {
erbanNoStr: $('#erbanNoStr').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val(),
};
return param;
}
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
var picker1 = $("#startTime").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
})
var picker2 = $('#endTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
})
});
}
}
};
</script>

View File

@@ -0,0 +1,272 @@
<template>
<section class="content">
<div class="box box-primary">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
<button id="addBtn" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</section>
</div>
</section>
<div class="modal fade" id="actModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="addModalLabel">运营活动配置</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="actForm">
<input type="hidden" name="id" id="actId" value="0">
<input type="hidden" name="status" id="actStatus">
<div class="form-group">
<label for="actTitle" class="col-sm-3 control-label">活动标题:</label>
<div class="col-sm-8">
<input type="text" id="actTitle" name="actTitle"
class="form-control validate[required]">
</div>
</div>
<div class="form-group">
<label for="actDesc" class="col-sm-3 control-label">活动叙述:</label>
<div class="col-sm-8 control-label">
<input type="text" id="actDesc" name="actDesc"
class="form-control validate[required]">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">活动图:</label>
<div class="col-sm-8">
<img src="" id="imgUrl" style="width:200px;height:500px;" alt="">
<input type="file" id="uploadFile" name="uploadFile"
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
<button class="btn btn-success" type="button" id="uploadBtn">上传</button>
<span class="attention">注意:图片尺寸请注意在750*250,选择图片后请点击上传按钮</span>
<input type="hidden" id="actImage" name="actImage"
class="form-control validate[required]" />
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="save">保存</button>
</div>
</div>
</div>
</div>
<div id="imgMask"><img src="" alt=""></div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "OperationActAdminView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: 'id', align: 'center', valign: 'middle', width: '10%' },
{ field: 'actTitle', title: '活动名称', align: 'center', valign: 'middle', width: '20%' },
{ field: 'actDesc', title: '转发叙述', align: 'center', valign: 'middle', width: '20%' },
{
field: 'actImage',
title: '活动图',
align: 'center',
width: '10%',
formatter: function (val, row, index) {
return "<img src='" + val + "' width='40' height='80'>";
}
},
{
field: 'createTime',
title: '创建时间',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
{
field: 'tmp',
title: '操作',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
var key = row.id;
return "<button class='btn btn-sm btn-success opt-edit' data-id=" + key + ">编辑</button>" +
"<br />" +
"<button class='btn btn-sm btn-danger opt-del' data-id=" + key + ">删除</button>";
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
};
// console.log(param);
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/act/operational/list.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
$('#addBtn').on('click', function () {
cleanModal();
$('#actModal').modal('show');
});
$('#table').on('click', '.opt-edit', function () {
var id = parseInt($(this).data('id'));
cleanModal();
var data = $('#table').bootstrapTable('getRowByUniqueId', id);
$('#actId').val(data.id);
$('#actTitle').val(data.actTitle);
$('#actDesc').val(data.actDesc);
$('#imgUrl').attr('src', data.actImage);
$('#actImage').val(data.actImage);
$('#actStatus').val(data.status);
$('#actModal').modal('show');
});
$('#save').on('click', function () {
// $('#actId').val(0);
if ($('#actForm').validationEngine('validate')) {
$.ajax({
type: "post",
url: "/admin/act/operational/save.action",
data: $('#actForm').serialize(),
dataType: 'json',
success: function (json) {
if (json.code == 200) {
$("#actModal").modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败,错误码:" + json.message);
$("#tipModal").modal('show');
}
}
})
}
});
$('#table').on('click', '.opt-del', function () {
var key = parseInt($(this).attr('data-id'));
$.ajax({
type: 'post',
url: '/admin/act/operational/del.action',
data: { 'id': key },
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败,错误码:" + res.message);
$("#tipModal").modal('show');
}
}
})
});
$('#uploadBtn').on('click', function () {
var options = {
type: 'post',
url: '/admin/upload/img.action',
dataType: 'json',
success: function (json) {
if (json.path) {
$('#actImage').val(json.path);
$('#imgUrl').attr("src", json.path);
console.log(json.path);
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
}
}
}
$("#actForm").ajaxSubmit(options);
})
$('#table').on('mouseenter', 'img', function (e) {
console.log($(this), e.clientX);
var src = $(this).attr('src');
$('#imgMask img').attr('src', src);
$('#imgMask').show();
$('#imgMask').css({
top: e.clientY + 20,
left: e.clientX + 20
})
})
$('#table').on('mouseleave', 'img', function (e) {
console.log('移出');
$('#imgMask').hide();
})
function cleanModal() {
$('#actForm').find('input[type=text],input[type=hidden],input[type=file]').each(function () {
$(this).val('');
})
$('#actForm').find('img').attr('src', '');
}
})
}
}
};
</script>
<style scoped>
#imgMask {
position: absolute;
top: 0;
left: 0;
width: 250px;
height: 600px;
padding: 4px;
background: #fff;
z-index: 999;
display: none;
}
#imgMask img {
width: 100%;
height: 100%;
vertical-align: top;
}
</style>

View File

@@ -0,0 +1,264 @@
<template>
<section class="content">
<div class="box box-primary">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
<button id="addBtn" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</section>
</div>
</section>
<div class="modal fade" id="actModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="addModalLabel">页面静态活动配置</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="actForm">
<input type="hidden" name="id" id="actId" value="0">
<input type="hidden" name="status" id="actStatus">
<div class="form-group">
<label for="actTitle" class="col-sm-3 control-label">活动代码:</label>
<div class="col-sm-8">
<input type="text" id="actCode" name="code"
class="form-control validate[required]">
</div>
</div>
<div class="form-group">
<label for="actTitle" class="col-sm-3 control-label">活动标题:</label>
<div class="col-sm-8">
<input type="text" id="actTitle" name="title"
class="form-control validate[required]">
</div>
</div>
<div class="form-group">
<label for="actDesc" class="col-sm-3 control-label">活动叙述:</label>
<div class="col-sm-8 control-label">
<input type="text" id="actDesc" name="secondTitle"
class="form-control validate[required]">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">活动图:</label>
<div class="col-sm-8">
<img src="" id="imgUrl" style="width:200px;height:500px;" alt="">
<input type="file" id="uploadFile" name="uploadFile"
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
<button class="btn btn-success" type="button" id="uploadBtn">上传</button>
<span class="attention">注意:选择图片后请点击上传按钮</span>
<input type="hidden" id="actImage" name="imgUrl" class="form-control validate[required]" />
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="save">保存</button>
</div>
</div>
</div>
</div>
<div id="imgMask"><img src="" alt=""></div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "PageActivityView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: 'id', align: 'center', valign: 'middle', width: '10%' },
{ field: 'code', title: 'code', align: 'center', valign: 'middle', width: '10%' },
{ field: 'title', title: '活动名称', align: 'center', valign: 'middle', width: '20%' },
{ field: 'secondTitle', title: '活动详情', align: 'center', valign: 'middle', width: '30%' },
{
field: 'imgUrl',
title: '活动图',
align: 'center',
width: '50%',
formatter: function (val, row, index) {
return "<img src='" + val + "' width='40' height='80'>";
}
},
{
field: 'tmp',
title: '操作',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
const key = row.id;
return "<button class='btn btn-sm btn-danger opt-del' data-id=" + key + ">删除</button>";
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
};
// console.log(param);
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/act/static/list.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
$('#addBtn').on('click', function () {
cleanModal();
$('#actModal').modal('show');
});
$('#table').on('click', '.opt-edit', function () {
var id = parseInt($(this).data('id'));
cleanModal();
var data = $('#table').bootstrapTable('getRowByUniqueId', id);
$('#actId').val(data.id);
$('#actTitle').val(data.actTitle);
$('#actDesc').val(data.actDesc);
$('#imgUrl').attr('src', data.actImage);
$('#actImage').val(data.actImage);
$('#actStatus').val(data.status);
$('#actModal').modal('show');
});
$('#save').on('click', function () {
if ($('#actForm').validationEngine('validate')) {
$.ajax({
type: "post",
url: "/admin/act/static/save.action",
data: $('#actForm').serialize(),
dataType: 'json',
success: function (json) {
if (json.code == 200) {
$("#actModal").modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败,错误码:" + json.message);
$("#tipModal").modal('show');
}
}
})
}
});
$('#table').on('click', '.opt-del', function () {
if (confirm("确定删除吗?") === false) {
return;
}
var key = parseInt($(this).attr('data-id'));
$.ajax({
type: 'post',
url: '/admin/act/static/delete.action',
data: { 'id': key },
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败,错误码:" + res.message);
$("#tipModal").modal('show');
}
}
})
});
$('#uploadBtn').on('click', function () {
var options = {
type: 'post',
url: '/admin/upload/img.action',
dataType: 'json',
success: function (json) {
if (json.path) {
$('#actImage').val(json.path);
$('#imgUrl').attr("src", json.path);
console.log(json.path);
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
}
}
}
$("#actForm").ajaxSubmit(options);
})
$('#table').on('mouseenter', 'img', function (e) {
console.log($(this), e.clientX);
var src = $(this).attr('src');
$('#imgMask img').attr('src', src);
$('#imgMask').show();
$('#imgMask').css({
top: e.clientY + 20,
left: e.clientX + 20
})
})
$('#table').on('mouseleave', 'img', function (e) {
console.log('移出');
$('#imgMask').hide();
})
function cleanModal() {
$('#actForm').find('input[type=text],input[type=hidden],input[type=file]').each(function () {
$(this).val('');
})
$('#actForm').find('img').attr('src', '');
}
})
}
}
};
</script>
<style scoped>
#imgMask {
position: absolute;
top: 0;
left: 0;
width: 250px;
height: 600px;
padding: 4px;
background: #fff;
z-index: 999;
display: none;
}
#imgMask img {
width: 100%;
height: 100%;
vertical-align: top;
}
</style>

View File

@@ -0,0 +1,161 @@
<template>
<section class='content'>
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="toolbar">
音萌号: <input type="text" id='erbanNo' placeholder='必填'>
抽奖类型: <select name="lottoType" id="lottoType">
<option value="0">全部</option>
<option value="1">充值抽奖</option>
<option value="2">分享抽奖</option>
<option value="3">打怪兽抽奖</option>
</select>
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
<div class="userMessage">
<div class="avatar">
<img src="" alt="">
</div>
<div class="nick"></div>
<div class="erbanNo"></div>
</div>
</div>
<div id="table"></div>
</section>
</div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "UserDrawRecordAdminView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#btnSearch').on('click', function () {
// console.log($('#lottoType').val());
// TableHelper.doRefresh('#table');
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#table').bootstrapTable({
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: 'server',
queryParamsType: 'undefined',
queryParams: function (params) {
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
drawType: parseInt($('#lottoType').val()),
erbanNo: $('#erbanNo').val()
};
return param;
},
uniqueId: 'erbanNo',
toolbar: '#toolbar',
url: '/admin/userdraw/list',
onLoadSuccess: function (res) {
console.log('load success');
if (res.users) {
var $user = $('.userMessage');
$user.css('display', 'flex');
$user.find('.avatar img').attr('src', res.users.avatar)
$user.find('.nick').html('昵称:' + res.users.nick);
$user.find('.erbanNo').html('音萌号:' + res.users.erbanNo);
}
},
onLoadError: function () {
console.log('load fail');
},
columns: [
// {field:'userName',title:'用户昵称',align:'center',valign:'middle',width:'15%'},
{ field: 'uid', title: 'Uid', align: 'center', valign: 'middle', width: '15%' },
{ field: 'drawPrizeName', title: '礼物名称', align: 'center', valign: 'middle', width: '15%' },
{
field: 'createTime', title: '获得机会时间', align: 'center', valign: 'middle', width: '15%',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
{
field: 'updateTime', title: '抽奖时间', align: 'center', valign: 'middle', width: '15%',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
{
field: 'type', title: '抽奖类型', align: 'center', valign: 'middle', width: '15%',
formatter: function (val, row, index) {
switch (val) {
case 1:
return '充值抽奖';
case 2:
return '分享抽奖';
case 3:
return '打怪兽抽奖';
}
}
}
]
});
})
})
}
}
};
</script>
<style scoped>
#erbanNo {
height: 25px;
}
.userMessage {
display: flex;
justify-content: flex-start;
align-items: center;
display: none;
margin-top: 10px;
}
.avatar {
width: 50px;
height: 50px;
}
.avatar img {
width: 100%;
height: 100%;
}
.userMessage div {
margin-right: 30px;
}
</style>

View File

@@ -0,0 +1,413 @@
<template>
<section class="content">
<div class="box box-primary">
<section class="content-header">
<h1 id="itemTitle">周星榜配置</h1>
</section>
<section class="content">
<table id="table"></table>
<div id="toolbar">
<button id="addBtn" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</section>
</div>
</section>
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="addModalLabel">添加周星榜配置</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="addForm">
<div class="form-group">
<div class="tips">注意无论选择什么时间都会设置到选择时间所在周的周一</div>
<label for="addStartDate" class="col-sm-3 control-label">起始时间:</label>
<div class="col-sm-8">
<input type="text" id="addStartDate" name="startTime"
class="form-control validate[required]">
</div>
</div>
<div class="form-group">
<label for="addGiftId" class="col-sm-3 control-label">礼物</label>
<select name="giftId" id="addGiftId" class="giftSelect" multiple="multiple">
</select>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">魅力榜奖励</label>
<select name="packId" id="charmAwardId" class="awardSelect" multiple="multiple">
</select>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">豪气榜奖励</label>
<select name="packId" id="levelAwardId" class="awardSelect" multiple="multiple">
</select>
</div>
<div class="form-group">
<label for="addDesc" class="col-sm-3 control-label">备注</label>
<div class="col-sm-8">
<input type="text" name="desc" id="addDesc" class="form-control validate[required]" />
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="addSave">保存</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="editModalLabel">修改周星榜配置</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="editForm">
<input type="hidden" id="editId">
<div class="form-group">
<label for="addGiftId" class="col-sm-3 control-label">礼物</label>
<select name="giftId" id="editGiftId" class="giftSelect" multiple="multiple">
</select>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">魅力榜奖励</label>
<select name="packId" id="editCharmAwardId" class="awardSelect" multiple="multiple">
</select>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">豪气榜奖励</label>
<select name="packId" id="editLevelAwardId" class="awardSelect" multiple="multiple">
</select>
</div>
<div class="form-group">
<label for="editDesc" class="col-sm-3 control-label">备注</label>
<div class="col-sm-8">
<input type="text" name="desc" id="editDesc" class="form-control validate[required]" />
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="editSave">保存</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "WeekStarConfigAdminView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
var giftObj = {};
var packObj = {};
getGiftMsg();
function tableMake() {
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: 'id', align: 'center', valign: 'middle', width: '10%' },
{
field: 'startDate', title: '开始时间', align: 'center', valign: 'middle', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
{
field: 'endDate', title: '结束时间', align: 'center', valign: 'middle', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
{
field: 'giftIdList', title: '礼物清单', align: 'center', valign: 'middle', formatter: function (val, row, index) {
var giftArr = JSON.parse(val);
var str = '';
for (var i = 0; i < giftArr.length; i++) {
str += giftObj[giftArr[i]] + '';
}
return str.substr(0, str.length - 2);
}
},
{
field: 'charmAward', title: '魅力榜奖励', align: 'center', valign: 'middle', formatter: function (val, row, index) {
var packArr = JSON.parse(val);
var str = '';
for (var i = 0; i < packArr.length; i++) {
str += packObj[packArr[i]] + '';
}
return str.substr(0, str.length - 2);
}
},
{
field: 'levelAward', title: '豪气榜奖励', align: 'center', valign: 'middle', formatter: function (val, row, index) {
var packArr = JSON.parse(val);
var str = '';
for (var i = 0; i < packArr.length; i++) {
str += packObj[packArr[i]] + '';
}
return str.substr(0, str.length - 2);
}
},
{
field: 'createTime', title: '创建时间', align: 'center', valign: 'middle', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
{ field: 'description', title: '叙述', align: 'center', valign: 'middle' },
{
field: 'tmp',
title: '操作',
align: 'center',
width: '30%',
valign: 'middle',
formatter: function (val, row, index) {
var key = row.id;
var date = new Date(row.startDate);
var mondayDate = getFirstDayOfWeek(new Date());
var dis = mondayDate.getTime() - date.getTime();
if (dis > 0) {
return "<button class='btn btn-sm btn-success opt-edit' disabled data-id=" + key + ">不可编辑</button>";
} else {
return "<button class='btn btn-sm btn-success opt-edit' data-id=" + key + ">编辑</button>";
}
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
};
// console.log(param);
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/weekStarConfig/getWeekConfigList.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
}
$('#addBtn').on('click', function () {
clearModal();
getGiftMsg();
getPackMsg();
$('#addModal').modal('show');
})
var picker = $('#addStartDate').datepicker({
format: 'yyyy-mm-dd',
startDate: new Date(),
autoclose: true
});
function clearModal() {
$("#addForm").find('input[type=text],select,input[type=hidden]').each(function () {
$(this).val('');
});
$('#editForm').find('input[type=text],select,input[type=hidden]').each(function () {
$(this).val('');
});
}
$('#addSave').on('click', function () {
if ($('#addForm').validationEngine('validate')) {
var giftId = JSON.stringify($("#addGiftId").val());
var charmAward = JSON.stringify($("#charmAwardId").val());
var levelAward = JSON.stringify($("#levelAwardId").val());
if (giftId == '' || charmAward == '' || levelAward == '') {
$("#tipMsg").text('请选择礼物/奖励');
$("#tipModal").modal('show');
return;
}
$.get('/admin/weekStarConfig/insert', {
startTimeStr: $('#addStartDate').val(),
desc: $('#addDesc').val(),
giftList: giftId,
charmAward: charmAward,
levelAward: levelAward
}, function (res) {
if (res.code == 200) {
$('#addModal').modal('hide');
$("#tipMsg").text("添加成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败," + res.message);
$("#tipModal").modal('show');
}
})
}
})
$('#editSave').on('click', function () {
if ($('#editForm').validationEngine('validate')) {
var giftId = JSON.stringify($("#editGiftId").val());
var charmAward = JSON.stringify($("#editCharmAwardId").val());
var levelAward = JSON.stringify($("#editLevelAwardId").val());
if (giftId == '' || charmAward == '' || levelAward == '') {
$("#tipMsg").text('请选择礼物/奖励');
$("#tipModal").modal('show');
return;
}
$.get('/admin/weekStarConfig/update', {
id: $('#editId').val(),
desc: $('#editDesc').val(),
giftList: giftId,
charmAward: charmAward,
levelAward: levelAward
}, function (res) {
if (res.code == 200) {
$('#editModal').modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败," + res.message);
$("#tipModal").modal('show');
}
})
}
});
$('#table').on('click', '.opt-edit', function () {
var id = $(this).data('id');
var data = $('#table').bootstrapTable('getRowByUniqueId', id);
var giftArr = JSON.parse(data.giftIdList);
var charmAward = JSON.parse(data.charmAward);
var levelAward = JSON.parse(data.levelAward);
console.log(data);
$('#editId').val(data.id);
$('#editGiftId').multiselect('select', giftArr);
$('#editCharmAwardId').multiselect('select', charmAward);
$('#editLevelAwardId').multiselect('select', levelAward);
$('#editDesc').val(data.description);
$('#editModal').modal('show');
});
function getGiftMsg() {
$.get('/admin/gift/getAllGiftList?consumeType=1', function (res) {
if (res.code == 200) {
var str = '';
for (var i = 0; i < res.data.length; i++) {
// 存入对象
giftObj[res.data[i].giftId] = res.data[i].giftName;
// 渲染select
str += '<option value="' + res.data[i].giftId + '">' + res.data[i].giftName + '</option>';
}
console.log(JSON.stringify(giftObj));
// $('.giftSelect').html(str);
// multiSelect('.giftSelect');
getWeekStarGiftMsg();
getPackMsg();
}
})
}
// 旧逻辑是查询出所有的礼物, 新逻辑: 只查询出周星榜礼物类型作为增加项
// 此处是兼容回显礼物名称, 避免之前的 不是周星榜礼物类型 导致名称回显不存在
function getWeekStarGiftMsg() {
$.get('/admin/gift/getVaildGiftByType?consumeType=1&status=0&giftType=8', function (res) {
if (res.code == 200) {
var str = '';
for (var i = 0; i < res.data.length; i++) {
// 存入对象
giftObj[res.data[i].giftId] = res.data[i].giftName;
// 渲染select
str += '<option value="' + res.data[i].giftId + '">' + res.data[i].giftName + '</option>';
}
console.log(JSON.stringify(giftObj));
$('.giftSelect').html(str);
multiSelect('.giftSelect');
}
})
}
function getPackMsg() {
$.get('/admin/weekStarConfig/getPackList', function (res) {
if (res.code == 200) {
var str = '';
for (var i = 0; i < res.data.length; i++) {
// 存入对象
packObj[res.data[i].id] = res.data[i].name;
// 渲染select
str += '<option value="' + res.data[i].id + '">' + res.data[i].name + '</option>';
}
$('.awardSelect').html(str);
multiSelect('.awardSelect');
tableMake();
}
})
}
function getFirstDayOfWeek(date) {
var day = date.getDay() || 7;
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1 - day);
}
function multiSelect(obj) { //初始化方法
$(obj).multiselect({
includeSelectAllOption: false,
enableClickableOptGroups: true,
enableCollapsibleOptGroups: true,
noneSelectedText: '==请选择==',
buttonWidth: 195,
maxHeight: 300,
});
}
})
}
}
};
</script>
<style scoped>
/*.giftSelect{
width: 100%;
}*/
.col-sm-8 {
padding: 0;
}
.tips {
padding-left: 75px;
color: red;
}</style>

View File

@@ -0,0 +1,216 @@
<template>
<!DOCTYPE html>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-lg-12">
<div class="col-sm-3">
<label class="col-sm-4 control-label">开始时间:</label>
<div class="col-sm-8">
<input type="text" class="input-sm datetime" name="queryStartDate" id="queryStartDate">
</div>
</div>
<div class="col-sm-3">
<label class="col-sm-4 control-label">结束时间:</label>
<div class="col-sm-8">
<input type="text" class="input-sm datetime" name="queryEndDate" id="queryEndDate">
</div>
</div>
<div class="col-sm-3">
<label class="col-sm-4 control-label">用户id:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="erbanNo" id="erbanNo">
</div>
</div>
<div class="col-sm-3">
<label class="col-sm-4 control-label">礼物名称:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="giftName" id="giftName">
</div>
</div>
</div>
<div class="col-sm-12">
<button class="btn btn-default js-quick-search js-quick-search-1 active" data-days="1">
昨天
</button>
<button class="btn btn-default js-quick-search js-quick-search-7" data-days="7">
最近7天
</button>
<button class="btn btn-default js-quick-search js-quick-search-30" data-days="30">
最近30天
</button>
</div>
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button type="button" class="btn btn-primary" id="exportclanFlowstatsList">导出</button>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { formatTime, param } from '@/utils/maintainer';
export default {
name: "DrawLotteryStatsDetailView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
let listQueryParams = {};
$('.datetime').datetimepicker({
format: 'yyyy-mm-dd 00:00:00',
autoclose: true
});
$("#queryStartDate").datetimepicker({
minView: "month",
language: 'zh-CN',
todayBtn: 1,
autoclose: 1
}).on("changeDate", function (event) {
$("#queryEndDate").datetimepicker('setStartDate', event.date);
});
$("#queryEndDate").datetimepicker({
minView: "month",
language: 'zh-CN',
todayBtn: 1,
autoclose: 1,
useCurrent: false
}).on("changeDate", function (event) {
$("#queryStartDate").datetimepicker('setEndDate', event.date);
});
initDefaultDate();
function initDefaultDate() {
var today = new Date();
today.setHours(0);
today.setMinutes(0);
today.setSeconds(0);
today.setMilliseconds(0);
var oneDay = 1000 * 24 * 60 * 60;
var startDate = new Date(today.getTime() - oneDay);
$('#queryStartDate').val(startDate.format("yyyy-MM-dd hh:mm:ss"));
$('#queryEndDate').val(today.format("yyyy-MM-dd hh:mm:ss"));
}
$('.js-quick-search').on('click', function () {
$('.js-quick-search').removeClass('active')
$(this).addClass('active');
setSearchTimeUseQuickWay($(this));
TableHelper.doRefresh('#table');
});
function setSearchTimeUseQuickWay(quickDom) {
const days = quickDom.attr("data-days");
const today = new Date(new Date().setHours(0, 0, 0, 0));
const todayStr = formatTime(today);
const startTime = formatTime(new Date(today.getTime() - days * 24 * 60 * 60 * 1000));
$('#queryStartDate').val(startTime);
$('#queryEndDate').val(todayStr);
}
buildTable();
// 列表设置
function buildTable() {
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#table').bootstrapTable({
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20],
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) {
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
startTime: $('#queryStartDate').val(),
endTime: $('#queryEndDate').val(),
erbanNo: $('#erbanNo').val(),
giftName: $('#giftName').val()
};
listQueryParams = param;
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/statistics/draw/lottery/statistics/dayDetail',
onLoadSuccess: function (res) { //加载成功时执行
if (res.code == undefined || res.code === 200) {
console.log("加载成功!");
} else {
$("#tipMsg").text(res.message);
$("#tipModal").modal('show');
}
},
onLoadError: function (res) { //加载失败时执行
console.log("load fail");
},
columns: [
{ field: 'date', title: '日期', align: 'center', width: '5%' },
{ field: 'erbanNo', title: 'erbanNo', align: 'center', width: '5%' },
{ field: 'userNick', title: '昵称', align: 'center', width: '5%' },
{ field: 'sumKeyValue', title: '用户投入', align: 'center', width: '5%' },
{ field: 'sumPlatformValue', title: '平台产出', align: 'center', width: '5%' },
{ field: 'countNum', title: '产出次数', align: 'center', width: '5%' },
{ field: 'giftName', title: '礼物名称', align: 'center', width: '5%' },
{ field: 'giftPrice', title: '礼物价值', align: 'center', width: '5%' },
{ field: 'prizePoolType', title: '礼物组类型', align: 'center', width: '5%' },
]
});
}
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
$("#exportclanFlowstatsList").on("click", function () {
window.location.href = `/admin/statistics/draw/lottery/statistics/dayDetail/export?${param(listQueryParams)}`
});
});
}
}
};
</script>
<style scoped>
.control-label {
padding-right: 0;
margin-right: 0;
}
.col-sm-3 {
padding-right: 0;
padding-left: 0;
}
.col-sm-8 {
padding-right: 0;
padding-left: 0;
}
#editModal .modal-dialog {
width: 1200px;
height: 80%;
}
</style>

View File

@@ -0,0 +1,212 @@
<template>
<!DOCTYPE html>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-lg-12">
<div class="col-sm-3">
<label class="col-sm-4 control-label">开始时间:</label>
<div class="col-sm-8">
<input type="text" class="input-sm datetime" name="queryStartDate" id="queryStartDate">
</div>
</div>
<div class="col-sm-3">
<label class="col-sm-4 control-label">结束时间:</label>
<div class="col-sm-8">
<input type="text" class="input-sm datetime" name="queryEndDate" id="queryEndDate">
</div>
</div>
<div class="col-sm-3">
<label class="col-sm-4 control-label">用户id:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="erbanNo" id="erbanNo">
</div>
</div>
<div class="col-sm-3">
<label class="col-sm-4 control-label">礼物名称:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="giftName" id="giftName">
</div>
</div>
</div>
<div class="col-sm-12">
<button class="btn btn-default js-quick-search js-quick-search-1 active" data-days="1">
昨天
</button>
<button class="btn btn-default js-quick-search js-quick-search-7" data-days="7">
最近7天
</button>
<button class="btn btn-default js-quick-search js-quick-search-30" data-days="30">
最近30天
</button>
</div>
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button type="button" class="btn btn-primary" id="exportclanFlowstatsList">导出</button>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { formatTime, param } from '@/utils/maintainer';
export default {
name: "DrawLotteryStatsView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
let listQueryParams = {};
$('.datetime').datetimepicker({
format: 'yyyy-mm-dd 00:00:00',
autoclose: true
});
$("#queryStartDate").datetimepicker({
minView: "month",
language: 'zh-CN',
todayBtn: 1,
autoclose: 1
}).on("changeDate", function (event) {
$("#queryEndDate").datetimepicker('setStartDate', event.date);
});
$("#queryEndDate").datetimepicker({
minView: "month",
language: 'zh-CN',
todayBtn: 1,
autoclose: 1,
useCurrent: false
}).on("changeDate", function (event) {
$("#queryStartDate").datetimepicker('setEndDate', event.date);
});
initDefaultDate();
function initDefaultDate() {
var today = new Date();
today.setHours(0);
today.setMinutes(0);
today.setSeconds(0);
today.setMilliseconds(0);
var oneDay = 1000 * 24 * 60 * 60;
var startDate = new Date(today.getTime() - oneDay);
$('#queryStartDate').val(startDate.format("yyyy-MM-dd hh:mm:ss"));
$('#queryEndDate').val(today.format("yyyy-MM-dd hh:mm:ss"));
}
$('.js-quick-search').on('click', function () {
$('.js-quick-search').removeClass('active')
$(this).addClass('active');
setSearchTimeUseQuickWay($(this));
TableHelper.doRefresh('#table');
});
function setSearchTimeUseQuickWay(quickDom) {
const days = quickDom.attr("data-days");
const today = new Date(new Date().setHours(0, 0, 0, 0));
const todayStr = formatTime(today);
const startTime = formatTime(new Date(today.getTime() - days * 24 * 60 * 60 * 1000));
$('#queryStartDate').val(startTime);
$('#queryEndDate').val(todayStr);
}
buildTable();
// 列表设置
function buildTable() {
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#table').bootstrapTable({
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20],
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) {
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
startTime: $('#queryStartDate').val(),
endTime: $('#queryEndDate').val(),
erbanNo: $('#erbanNo').val(),
giftName: $('#giftName').val()
};
listQueryParams = param;
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/statistics/draw/lottery/statistics/day',
onLoadSuccess: function (res) { //加载成功时执行
if (res.code == undefined || res.code === 200) {
console.log("加载成功!");
} else {
$("#tipMsg").text(res.message);
$("#tipModal").modal('show');
}
},
onLoadError: function (res) { //加载失败时执行
console.log("load fail");
},
columns: [
{ field: 'date', title: '日期', align: 'center', width: '5%' },
{ field: 'userNum', title: '当日参与人数', align: 'center', width: '5%' },
{ field: 'sumKeyValue', title: '当日参与总流水', align: 'center', width: '5%' },
{ field: 'sumPlatformValue', title: '平台产出总流水', align: 'center', width: '5%' },
{ field: 'offsetValue', title: '偏差值', align: 'center', width: '5%' },
]
});
}
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
$("#exportclanFlowstatsList").on("click", function () {
window.location.href = `/admin/statistics/draw/lottery/statistics/day/export?${param(listQueryParams)}`
});
});
}
}
};
</script>
<style scoped>
.control-label {
padding-right: 0;
margin-right: 0;
}
.col-sm-3 {
padding-right: 0;
padding-left: 0;
}
.col-sm-8 {
padding-right: 0;
padding-left: 0;
}
#editModal .modal-dialog {
width: 1200px;
height: 80%;
}
</style>

View File

@@ -0,0 +1,226 @@
<template>
<!DOCTYPE html>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-lg-12">
<div class="col-sm-3">
<label class="col-sm-4 control-label">开始时间:</label>
<div class="col-sm-8">
<input type="text" class="input-sm datetime" name="queryStartDate" id="queryStartDate">
</div>
</div>
<div class="col-sm-3">
<label class="col-sm-4 control-label">结束时间:</label>
<div class="col-sm-8">
<input type="text" class="input-sm datetime" name="queryEndDate" id="queryEndDate">
</div>
</div>
<div class="col-sm-3">
<label class="col-sm-4 control-label">用户id:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="erbanNo" id="erbanNo">
</div>
</div>
<div class="col-sm-3">
<label class="col-sm-4 control-label">礼物名称:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="giftName" id="giftName">
</div>
</div>
</div>
<div class="col-sm-12">
<button class="btn btn-default js-quick-search js-quick-search-1 active" data-days="1">
昨天
</button>
<button class="btn btn-default js-quick-search js-quick-search-7" data-days="7">
最近7天
</button>
<button class="btn btn-default js-quick-search js-quick-search-30" data-days="30">
最近30天
</button>
</div>
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button type="button" class="btn btn-primary" id="exportclanFlowstatsList">导出</button>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { formatTime, param } from '@/utils/maintainer';
export default {
name: "LinearlyStatsDetailView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
let listQueryParams = {};
$('.datetime').datetimepicker({
format: 'yyyy-mm-dd 00:00:00',
autoclose: true
});
$("#queryStartDate").datetimepicker({
minView: "month",
language: 'zh-CN',
todayBtn: 1,
autoclose: 1
}).on("changeDate", function (event) {
$("#queryEndDate").datetimepicker('setStartDate', event.date);
});
$("#queryEndDate").datetimepicker({
minView: "month",
language: 'zh-CN',
todayBtn: 1,
autoclose: 1,
useCurrent: false
}).on("changeDate", function (event) {
$("#queryStartDate").datetimepicker('setEndDate', event.date);
});
initDefaultDate();
function initDefaultDate() {
var today = new Date();
today.setHours(0);
today.setMinutes(0);
today.setSeconds(0);
today.setMilliseconds(0);
var oneDay = 1000 * 24 * 60 * 60;
var startDate = new Date(today.getTime() - oneDay);
$('#queryStartDate').val(startDate.format("yyyy-MM-dd hh:mm:ss"));
$('#queryEndDate').val(today.format("yyyy-MM-dd hh:mm:ss"));
}
$('.js-quick-search').on('click', function () {
$('.js-quick-search').removeClass('active')
$(this).addClass('active');
setSearchTimeUseQuickWay($(this));
TableHelper.doRefresh('#table');
});
function setSearchTimeUseQuickWay(quickDom) {
const days = quickDom.attr("data-days");
const today = new Date(new Date().setHours(0, 0, 0, 0));
const todayStr = formatTime(today);
const startTime = formatTime(new Date(today.getTime() - days * 24 * 60 * 60 * 1000));
$('#queryStartDate').val(startTime);
$('#queryEndDate').val(todayStr);
}
buildTable();
// 列表设置
function buildTable() {
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#table').bootstrapTable({
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20],
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) {
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
startTime: $('#queryStartDate').val(),
endTime: $('#queryEndDate').val(),
erbanNo: $('#erbanNo').val(),
giftName: $('#giftName').val()
};
listQueryParams = param;
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/statistics/linearly/dayDetail',
onLoadSuccess: function (res) { //加载成功时执行
if (res.code == undefined || res.code === 200) {
console.log("加载成功!");
} else {
$("#tipMsg").text(res.message);
$("#tipModal").modal('show');
}
},
onLoadError: function (res) { //加载失败时执行
console.log("load fail");
},
columns: [
{ field: 'date', title: '日期', align: 'center', width: '5%' },
{ field: 'erbanNo', title: 'erbanNo', align: 'center', width: '5%' },
{ field: 'userNick', title: '昵称', align: 'center', width: '5%' },
{ field: 'sumKeyValue', title: '用户投入', align: 'center', width: '5%' },
{ field: 'sumPlatformValue', title: '平台产出', align: 'center', width: '5%' },
{ field: 'countNum', title: '产出次数', align: 'center', width: '5%' },
{ field: 'giftName', title: '礼物名称', align: 'center', width: '5%' },
{ field: 'giftPrice', title: '礼物价值', align: 'center', width: '5%' },
{
field: 'prizePoolType', title: '礼物组类型', align: 'center', width: '5%',
formatter: function (val) {
if (val == null || val == undefined) return '-';
if (val == 1) {
return '普通组奖池';
} else if (val == 2) {
return '高级组奖池';
}
}
},
]
});
}
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
$("#exportclanFlowstatsList").on("click", function () {
window.location.href = `/admin/statistics/linearly/dayDetail/export?${param(listQueryParams)}`
});
});
}
}
};
</script>
<style scoped>
.control-label {
padding-right: 0;
margin-right: 0;
}
.col-sm-3 {
padding-right: 0;
padding-left: 0;
}
.col-sm-8 {
padding-right: 0;
padding-left: 0;
}
#editModal .modal-dialog {
width: 1200px;
height: 80%;
}
</style>

View File

@@ -0,0 +1,212 @@
<template>
<!DOCTYPE html>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-lg-12">
<div class="col-sm-3">
<label class="col-sm-4 control-label">开始时间:</label>
<div class="col-sm-8">
<input type="text" class="input-sm datetime" name="queryStartDate" id="queryStartDate">
</div>
</div>
<div class="col-sm-3">
<label class="col-sm-4 control-label">结束时间:</label>
<div class="col-sm-8">
<input type="text" class="input-sm datetime" name="queryEndDate" id="queryEndDate">
</div>
</div>
<div class="col-sm-3">
<label class="col-sm-4 control-label">用户id:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="erbanNo" id="erbanNo">
</div>
</div>
<div class="col-sm-3">
<label class="col-sm-4 control-label">礼物名称:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="giftName" id="giftName">
</div>
</div>
</div>
<div class="col-sm-12">
<button class="btn btn-default js-quick-search js-quick-search-1 active" data-days="1">
昨天
</button>
<button class="btn btn-default js-quick-search js-quick-search-7" data-days="7">
最近7天
</button>
<button class="btn btn-default js-quick-search js-quick-search-30" data-days="30">
最近30天
</button>
</div>
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button type="button" class="btn btn-primary" id="exportclanFlowstatsList">导出</button>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { formatTime, param } from '@/utils/maintainer';
export default {
name: "LinearlyStatsView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
let listQueryParams = {};
$('.datetime').datetimepicker({
format: 'yyyy-mm-dd 00:00:00',
autoclose: true
});
$("#queryStartDate").datetimepicker({
minView: "month",
language: 'zh-CN',
todayBtn: 1,
autoclose: 1
}).on("changeDate", function (event) {
$("#queryEndDate").datetimepicker('setStartDate', event.date);
});
$("#queryEndDate").datetimepicker({
minView: "month",
language: 'zh-CN',
todayBtn: 1,
autoclose: 1,
useCurrent: false
}).on("changeDate", function (event) {
$("#queryStartDate").datetimepicker('setEndDate', event.date);
});
initDefaultDate();
function initDefaultDate() {
var today = new Date();
today.setHours(0);
today.setMinutes(0);
today.setSeconds(0);
today.setMilliseconds(0);
var oneDay = 1000 * 24 * 60 * 60;
var startDate = new Date(today.getTime() - oneDay);
$('#queryStartDate').val(startDate.format("yyyy-MM-dd hh:mm:ss"));
$('#queryEndDate').val(today.format("yyyy-MM-dd hh:mm:ss"));
}
$('.js-quick-search').on('click', function () {
$('.js-quick-search').removeClass('active')
$(this).addClass('active');
setSearchTimeUseQuickWay($(this));
TableHelper.doRefresh('#table');
});
function setSearchTimeUseQuickWay(quickDom) {
const days = quickDom.attr("data-days");
const today = new Date(new Date().setHours(0, 0, 0, 0));
const todayStr = formatTime(today);
const startTime = formatTime(new Date(today.getTime() - days * 24 * 60 * 60 * 1000));
$('#queryStartDate').val(startTime);
$('#queryEndDate').val(todayStr);
}
buildTable();
// 列表设置
function buildTable() {
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#table').bootstrapTable({
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20],
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) {
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
startTime: $('#queryStartDate').val(),
endTime: $('#queryEndDate').val(),
erbanNo: $('#erbanNo').val(),
giftName: $('#giftName').val()
};
listQueryParams = param;
return param;
},
uniqueId: 'id',
toolbar: '#toolbar',
url: '/admin/statistics/linearly/day',
onLoadSuccess: function (res) { //加载成功时执行
if (res.code == undefined || res.code === 200) {
console.log("加载成功!");
} else {
$("#tipMsg").text(res.message);
$("#tipModal").modal('show');
}
},
onLoadError: function (res) { //加载失败时执行
console.log("load fail");
},
columns: [
{ field: 'date', title: '日期', align: 'center', width: '5%' },
{ field: 'userNum', title: '当日参与人数', align: 'center', width: '5%' },
{ field: 'sumKeyValue', title: '当日参与总流水', align: 'center', width: '5%' },
{ field: 'sumPlatformValue', title: '平台产出总流水', align: 'center', width: '5%' },
{ field: 'offsetValue', title: '偏差值', align: 'center', width: '5%' },
]
});
}
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
$("#exportclanFlowstatsList").on("click", function () {
window.location.href = `/admin/statistics/linearly/day/export?${param(listQueryParams)}`
});
});
}
}
};
</script>
<style scoped>
.control-label {
padding-right: 0;
margin-right: 0;
}
.col-sm-3 {
padding-right: 0;
padding-left: 0;
}
.col-sm-8 {
padding-right: 0;
padding-left: 0;
}
#editModal .modal-dialog {
width: 1200px;
height: 80%;
}
</style>

View File

@@ -0,0 +1,168 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
<label class="source">
选择时间: <input type="text" name="startTime" id="startTime" class="input-sm">
<input type="text" id="endTime" name="endTime" class="input-sm">
</label>
<label class="erbanNo">
音萌号<input type="text" placeholder="" id="erbanNo" class="input-sm">
</label>
<label class="rewardName">
奖励名称<input type="text" placeholder="" id="rewardName" class="input-sm">
</label>
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
<button id="export" class="btn btn-sm btn-primary">导出</button>
<button id="Rankexport" class="btn btn-sm btn-primary">上周榜单导出</button>
</div>
</section>
</div>
</div>
</section>
</template>
<script>
export default {
name: "SingleHeartbeatDarwView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
searchHistory();
function searchHistory() {
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#table').bootstrapTable({
columns: [
{ field: 'id', title: '抽奖id', align: 'center', valign: 'middle', width: '10%' },
{ field: 'erbanNo', title: '音萌号', align: 'center', valign: 'middle', width: '10%' },
{ field: 'nick', title: '昵称', align: 'center', valign: 'middle', width: '10%' },
{ field: 'rewardType', title: '奖励类型', align: 'center', valign: 'middle', width: '10%' },
{ field: 'rewardName', title: '奖励名称', align: 'center', valign: 'middle', width: '10%' },
{ field: 'rewardNum', title: '奖励数量', align: 'center', valign: 'middle', width: '10%' },
{ field: 'rewardUnit', title: '数量单位', align: 'center', valign: 'middle', width: '10%' },
{
field: 'createTime',
title: '抽奖时间',
align: 'center',
valign: 'middle',
width: '10%',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
},
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
erbanNo: $('#erbanNo').val(),
rewardName: $('#rewardName').val(),
startTime: $("#startTime").val(),
endTime: $("#endTime").val()
};
console.log(param);
return param;
},
uniqueId: 'uid',
toolbar: '#toolbar',
url: '/admin/single/heartbeat/record.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
}
$('#btnSearch').on('click', function () {
var startTime = $('#startTime').val();
var endTime = $('#endTime').val();
if (startTime == '') {
$("#tipMsg").text("请输入查询开始时间");
$("#tipModal").modal('show');
return;
}
if (endTime == '') {
$("#tipMsg").text("请输入查询结束时间");
$("#tipModal").modal('show');
return;
}
searchHistory();
});
$('#export').on('click', function () {
const erbanNo = $('#erbanNo').val();
const rewardName = $('#rewardName').val();
const startTime = $('#startTime').val();
const endTime = $('#endTime').val();
if (startTime == '') {
$("#tipMsg").text("请输入查询开始时间");
$("#tipModal").modal('show');
return;
}
if (endTime == '') {
$("#tipMsg").text("请输入查询结束时间");
$("#tipModal").modal('show');
return;
}
window.location.href = `/admin/single/heartbeat/export?erbanNo=${erbanNo}&rewardName=${rewardName}&startTime=${startTime}&endTime=${endTime}`
});
$('#Rankexport').on('click', function () {
window.location.href = `/admin/single/heartbeat/lastWeek/rank`
});
// 初始化时间选择器
$('#startTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
})
$("#endTime").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
});
})
}
}
};
</script>
<style scoped>
.deviation {
display: none;
}
#toolbar label {
margin-right: 6px;
}
</style>

View File

@@ -0,0 +1,190 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<div id="toolbar">
<div class="col-sm-12">
<label for="roomErbanNo" class="qry_col control-label">房间ID:</label>
<div class="col-sm-1"><input type="text" class="form-control" name="roomErbanNo" id="roomErbanNo">
</div>
<label for="targetErbanNo" class="qry_col control-label">用户ID:</label>
<div class="col-sm-1"><input type="text" class="form-control" name="targetErbanNo"
id="targetErbanNo"></div>
<label for="operatorErbanNo" class="qry_col control-label">超管ID:</label>
<div class="col-sm-1"><input type="text" class="form-control" name="operatorErbanNo"
id="operatorErbanNo"></div>
<label for="operateType" class="qry_col control-label">操作类型:</label>
<div class="col-sm-2"><select name="operateType" id="operateType" class="col-sm-2 form-control"
data-btn-class="btn-warning">
<option value="" selected="selected">全部</option>
<option value="1">解除房间限制</option>
<option value="2">锁麦</option>
<option value="3">闭麦</option>
<option value="4">抱TA下麦</option>
<option value="5">踢出房间</option>
<option value="6">加入黑名单</option>
<option value="7">关闭房间</option>
<option value="8">隐藏房间</option>
<option value="9">关闭公屏消息</option>
<option value="10">开启公屏消息</option>
<option value="11">移除黑名单</option>
</select></div>
<label class="qry_col control-label">操作时间:</label>
<div class="col-sm-2"><input type="text" class="qry_col form-control" name="beginDate"
id="beginDate"></div><span class="qry_col"></span>
<div class="col-sm-2"><input type="text" class="qry_col form-control" name="endDate" id="endDate">
</div>
</div>
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div>
</div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "SuperAdminOperateRecordView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
var picker1 = $("#beginDate").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true,
todayBtn: true
});
var picker2 = $("#endDate").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true,
todayBtn: true
});
picker1.on('changeDate', function () {
var date = $('#beginDate').datetimepicker('getDate');
picker2.datetimepicker('setStartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#endDate').datetimepicker('getDate');
picker1.datetimepicker('setEndDate', date);
});
$(function () {
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#table').bootstrapTable({
columns: [
{ field: 'roomUid', title: '房主UID', align: 'center', valign: 'middle', width: '5%' },
{ field: 'roomErbanNo', title: '房间ID', align: 'center', valign: 'middle', width: '5%' },
{ field: 'title', title: '房间标题', align: 'center', valign: 'middle', width: '10%' },
{ field: 'targetErbanNo', title: '用户ID', align: 'center', valign: 'middle', width: '5%' },
{ field: 'targetNick', title: '用户昵称', align: 'center', valign: 'middle', width: '10%' },
{ field: 'operatorErbanNo', title: '操作超管ID', align: 'center', valign: 'middle', width: '5%' },
{
field: 'operateType', title: '操作', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
switch (val) {
case 1:
return '解除房间限制';
case 2:
return '锁麦';
case 3:
return '闭麦';
case 4:
return '抱TA下麦';
case 5:
return '踢出房间';
case 6:
return '加入黑名单';
case 7:
return '关闭房间';
case 8:
return '隐藏房间';
case 9:
return '关闭公屏消息';
case 10:
return '开启公屏消息';
case 11:
return '移除黑名单';
default:
return '-';
}
}
},
{
field: 'createTime', title: '操作时间', align: 'center', valign: 'middle', width: '10%',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format('yyyy-MM-dd hh:mm:ss');
} else {
return '-';
}
}
}
],
undefinedText: '-',
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNum: params.pageNumber,
pageSize: params.pageSize,
roomErbanNo: $('#roomErbanNo').val(),
targetErbanNo: $('#targetErbanNo').val(),
operatorErbanNo: $('#operatorErbanNo').val(),
operateType: $('#operateType').val(),
beginDate: $('#beginDate').val(),
endDate: $('#endDate').val()
};
return param;
},
toolbar: '#toolbar',
url: '/admin/super/operate/record/list.action',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 查询刷新
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
});
});
}
}
};
</script>
<style scoped>
.qry_col {
float: left;
}
</style>

View File

@@ -0,0 +1,207 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<section class="content">
<div id="table"></div>
<div id="toolbar">
<button id="addBtn" class="btn btn-sm btn-primary">增加</button>
<div class="col-sm-12">
</div>
</div>
</section><!-- .content -->
</div>
</div>
</section>
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modalLabel">新增</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label for="erbanNoInput" class="col-sm-2 control-label">音萌号:</label>
<div class="col-sm-10">
<input type="text" id="erbanNoInput" name="erbanNo" class="form-control validate[required]">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="saveSuperAdmin">保存</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { showLoading, hideLoading } from '@/utils/maintainer';
export default {
name: "SuperAdminView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
initTable();
$("#exportBtn").on('click', function () {
$("#searchForm").submit();
})
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (confirm("你确认【删除】该超管吗?")) {
showLoading();
var params = "uids=" + id;
$.ajax({
type: 'post',
url: "/admin/super/del.action",
data: params,
dataType: "json",
success: function (json) {
hideLoading();
if (json.success == 'true') {
$("#tipMsg").text("操作成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("操作失败");
$("#tipModal").modal('show');
}
}
});
}
});
});
$("#addBtn").click(function () {
// 打开新增弹窗
$("#addModal").modal('show');
$("#erbanNoInput").val("");
});
$("#saveSuperAdmin").click(function () {
var erbanNo = $("#erbanNoInput").val();
if (erbanNo == '' || erbanNo == undefined || erbanNo == null) {
alert("请输入音萌号!")
} else {
showLoading()
$.ajax({
type: "post",
url: "/admin/super/save.action",
data: 'erbanNo=' + erbanNo,
dataType: "json",
success: function (json) {
hideLoading();
if (json.success == 'true') {
$("#addModal").modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败,原因: " + json.msg);
$("#tipModal").modal('show');
}
}
});
}
});
function initTable() {
$('#table').bootstrapTable({
columns: [
{ field: 'tmp', title: 'ID', align: 'center', width: '10%', checkbox: true },
{ field: 'uid', title: 'uid', align: 'center', width: '10%' },
{ field: 'erbanNo', title: '音萌号', align: 'center', width: '10%' },
{ field: 'nick', title: '昵称', align: 'center', width: '10%' },
{
field: 'uid', title: '创建时间', align: 'center', width: '12%', formatter: function (val, row, index) {
var ret = '<span id="createTimeSpan_' + val + '" >-</span>';
return ret;
}
},
{
field: 'uid', title: '操作', align: 'center', width: '10%', formatter: function (val, row, index) {
var ret = '<button class="btn btn-sm btn-danger opt-remove" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-remove"></i>删除</button>';
return ret;
}
}
],
cache: false,
striped: true,
showRefresh: false,
pagination: false,
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNumber: params.pageNumber,
pageSize: params.pageSize,
};
return param;
},
toolbar: '#toolbar',
url: '/admin/super/list.action',
onLoadSuccess: function (data) { //加载成功时执行
setTimeout(function () {
loadCreateTime(data);
}, 100);
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
}
/**
* 加载创建时间
* @param data
*/
function loadCreateTime(data) {
var param = '';
for (var i = 0; i < data.rows.length; i++) {
var user = data.rows[i];
param += "uids=" + user.uid + "&";
}
if (param != '') {
$.ajax({
type: "get",
url: "/admin/super/get/time.action",
data: param,
dataType: "json",
success: function (json) {
for (var i = 0; i < json.rows.length; i++) {
$("#createTimeSpan_" + json.rows[i].uid).text(json.rows[i].date);
}
}
});
}
}
}
}
};
</script>

View File

@@ -0,0 +1,252 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">
音萌号:<input type="text" class="input-sm validate[required]" name="erbanNo" id="erbanNum">
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
<button id="add" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
</section>
</div>
</div>
</section>
<div class="modal fade" id="addAnchor" tabindex="-1" role="dialog" aria-labelledby="modalLabel2">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">x</span></button>
<h4 class="modal-title" id="addModalLabel">新增白名单主播</h4>
</div>
<div class="modal-body">
<form id="addAnchorForm" class="form-horizontal">
<div class="form-group">
<label for="erbanNo" class="col-sm-3 control-label"><span
style="color: red; ">*</span>音萌号</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required]" name="erbanNo" id="erbanNo"
placeholder='多个音萌号请用-隔开'>
</div>
</div>
<div class="form-group">
<label for="reason" class="col-sm-3 control-label"><span
style="color: red; ">*</span>原因</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required]" name="reason" id="reason">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" id="addSave">保存</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
export default {
name: "AnchorAdminView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#table').bootstrapTable({
columns: [
{ field: 'uid', title: 'UID', align: 'center', valign: 'middle', visible: false, width: '20%' },
{ field: 'erbanNo', title: '音萌号', align: 'center', valign: 'middle', width: '5%' },
{ field: 'nick', title: '昵称', align: 'center', valign: 'middle', width: '5%' },
{
field: 'status',
title: '状态',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
switch (val) {
case 1:
return '白名单';
case 2:
return '非白名单';
}
}
},
{ field: 'operateReason', title: '原因', align: 'center', valign: 'middle', width: '5%' },
{
field: 'operateTime',
title: '操作时间',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm");
} else {
return '-';
}
}
},
{
field: 'tmp',
title: '操作',
align: 'center',
width: '10%',
valign: 'middle',
formatter: function (val, row, index) {
var key = row.erbanNo;
return "<button class='btn btn-sm btn-success opt-release' data-id=" + key + ">取消</button>&nbsp;&nbsp;";
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
erbanNo: $('#erbanNum').val()
};
console.log("")
return param;
},
uniqueId: 'erbanNo',
toolbar: '#toolbar',
url: '/admin/anchor/whitelist',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
})
/*查询刷新*/
$('#btnSearch').on('click', function () {
TableHelper.doRefresh('#table');
})
/*保存*/
$('#addSave').on('click', function () {
if ($('#addAnchorForm').validationEngine('validate')) {
$("#tipMsg").text("正在处理,请稍后");
$("#tipModal").modal('show');
$.ajax({
type: "post",
url: "/admin/anchor/whitelist/save",
data: {
erbanNo: $("#erbanNo").val(),
reason: $("#reason").val()
},
dataType: 'json',
success: function (data) {
if (data.code == 200) {
$('#addAnchor').modal('hide');
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("保存失败,错误码:" + data.message);
$("#tipModal").modal('show');
}
}
})
}
})
//增加主播白名单
$('#add').on('click', function () {
console.log("add")
$('#addAnchorForm')[0].reset();
$('#addAnchor').modal('show');
})
//更改
$('#table').on('click', '.opt-release', function () {
var key = parseInt($(this).data('id'));
console.log(key, typeof key);
if (confirm("确定要取消音萌号:" + key + "的白名单资格吗?")) {
$.ajax({
type: 'post',
url: '/admin/anchor/whitelist/update',
data: { 'erbanNo': key, 'status': 2 },
dataType: 'json',
success: function (data) {
if (data.code == 200) {
$("#tipMsg").text("操作成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("操作失败,错误信息:" + data.message);
$("#tipModal").modal('show');
}
}
});
}
})
}
}
};
</script>
<style scoped>
.bar1,
.bar2 {
margin-bottom: 10px;
}
label.col-sm-1 {
padding: 0;
line-height: 30px;
text-align: right;
/*padding-right: 4px;*/
}
label.col-sm-1 {
padding: 0;
line-height: 30px;
text-align: right;
/*padding-right: 4px;*/
}
input,
select {
margin-left: 8px;
margin-right: 8px;
}
#btnSearch {
margin-left: 36px;
}
.record {
margin-top: 10px;
}
.record .title {
font-size: 16px;
}
</style>

View File

@@ -0,0 +1,241 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
</div>
</div>
<div id="table"></div>
</section>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { showLoading, hideLoading } from '@/utils/maintainer';
export default {
name: "AnchorBillCheckView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
//获取模板列表
//初始化表格
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#table').bootstrapTable({
columns: [
// {field: 'temp', title: 'id', align: 'center', checkbox: true, width: '5%'},
{ field: 'id', title: 'ID', align: 'center', width: '5%' },
{ field: 'adminName', title: '上传者', align: 'center', width: '5%' },
{
field: 'uploadTime',
title: '上传时间',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:00");
} else {
return '-';
}
}
},
{ field: 'realName', title: '文件名', align: 'center', width: '5%' },
{
field: 'fileName', title: '下载', align: 'center', width: '5%',
formatter: function (val, row, index) {
var downloadLink = '/admin/anchor/downloadExcel?id=' + row.id;
var alink = '<a href="' + downloadLink + '">' + row.realName + ' </a> ';
// window.location.href=
return alink;
}
},
{
field: 'status', title: '状态', align: 'center', width: '5%',
formatter: function (val, row, index) {
if (val == 1) {
return "审核中";
} if (val == 2) {
return "审核通过";
} if (val == 3) {
return "驳回";
} if (val == 4) {
return "已导入";
} else {
return '-';
}
}
},
{ field: 'checkAdminName', title: '审核人', align: 'center', width: '5%' },
{
field: 'checkTime',
title: '审核时间',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:00");
} else {
return '-';
}
}
}
,
{
field: 'id',
title: '操作',
align: 'center',
width: '15%',
formatter: function (val, row, index) {
var result = '';
// console.log(row.status)
if (row.status == 1) {
result += '<button id="agree" name="agree" class="btn btn-sm btn-success btn-agree" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-ok"></i>同意</button>&nbsp;&nbsp;';
result += '<button id="reject" name="reject" class="btn btn-sm btn-success btn-reject" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-book"></i>驳回</button>&nbsp;&nbsp;'
}
return result;
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
erbanNo: $('#erbanNo').val(),
templateId: $('#templateId').val(),
sendStatus: $('#sendStatus').val(),
createTime: $('#createTime').val(),
sendTime: $('#sendTime').val()
};
return param;
},
toolbar: '#toolbar',
url: '/admin/anchor/uploadList',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
});
$("#btnSearch").click(function () {
TableHelper.doRefresh('#table');
})
$("#btnImport").click(function () {
$("#uploadFile").val("");
$("#fileUpload").modal('show');
});
$("#upload").click(function () {
var file = $("#uploadFile").val();
if (file == null || file == undefined || file == '') {
$("#tipMsg").text("上传文件不能为空.");
$("#tipModal").modal('show');
}
debugger;
$("#fileUpload").modal('hide');
showLoading();
var option = ({
type: "POST",
url: "/admin/anchor/uploadExcel",
cache: false,
contentType: false, //不可缺
processData: false, //不可缺
dataType: "json",
success: function (json) {
hideLoading();
console.log(json)
if (json.code == 200) {
$("#tipMsg").text("上传成功");
$("#tipModal").modal('show');
TableHelper.doRefresh('#table');
} else {
$("#tipMsg").text("上传失败.");
$("#tipModal").modal('show');
}
},
error: function () {
hideLoading();
$("#tipMsg").text("上传失败.");
$("#tipModal").modal('show');
}
});
$("#uploadForm").ajaxSubmit(option);
});
//同意
$('#table').on('click', '.btn-agree', function () {
var key = parseInt($(this).data('id'));
console.log(key, typeof key);
if (confirm("你确定要同意该流水账单?")) {
$.ajax({
type: 'post',
url: '/admin/anchor/check/agree',
data: { 'id': key },
dataType: 'json',
success: function (data) {
if (data.code == 200) {
$("#tipMsg").text("操作成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("操作失败,错误信息:" + data.message);
$("#tipModal").modal('show');
}
}
});
}
})
//同意
$('#table').on('click', '.btn-reject', function () {
var key = parseInt($(this).data('id'));
console.log(key, typeof key);
if (confirm("你确定要驳回该流水账单?")) {
$.ajax({
type: 'post',
url: '/admin/anchor/check/reject',
data: { 'id': key },
dataType: 'json',
success: function (data) {
if (data.code == 200) {
$("#tipMsg").text("操作成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("操作失败,错误信息:" + data.message);
$("#tipModal").modal('show');
}
}
});
}
})
}
}
};
</script>

View File

@@ -0,0 +1,261 @@
<template>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<div class="col-sm-12">
<button id="btnImport" class="btn btn-default">
<i class="glyphicon glyphicon-import"></i>上传流水附件
</button>
</div>
</div>
</div>
<div id="table"></div>
</section>
<div class=" modal fade" id="fileUpload" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel1">上传文件</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="uploadForm">
<div class="form-group">
<label for="uploadFile" class="col-sm-3 control-label">上传文件:</label>
<div class="col-sm-9">
<input type="file" class="form-control validate[required]" name="uploadFile"
id="uploadFile" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">注意:</label>
<div class="col-sm-9">
<span>
<font color="#dd4b39">1.上传文件仅支持.xlsx格式的文件<br>
2.文件内容第一行为标题(:音萌号,金币,钻石)<br>
3.第一列为用户音萌号,第二列为用户要添加的金币数量,第三列为用户要添加的钻石数量
</font>
</span>
</div>
</div>
</form>
</div>
<div class="modal-footer" style="height: 20%">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="upload">确定</button>
</div>
</div>
</div>
</div>
</template>
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { showLoading, hideLoading } from '@/utils/maintainer';
export default {
name: "AnchorBillUploadView",
setup() { },
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
$(function () {
//获取模板列表
//初始化表格
$('#table').bootstrapTable('destroy');
// 清空分页组件的容器
$('.fixed-table-pagination').empty();
$('#table').bootstrapTable({
columns: [
// {field: 'temp', title: 'id', align: 'center', checkbox: true, width: '5%'},
{ field: 'id', title: 'ID', align: 'center', width: '5%' },
{ field: 'adminName', title: '上传者', align: 'center', width: '5%' },
{
field: 'uploadTime',
title: '上传时间',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:00");
} else {
return '-';
}
}
},
{ field: 'realName', title: '文件名', align: 'center', width: '5%' },
{
field: 'fileName', title: '下载', align: 'center', width: '5%',
formatter: function (val, row, index) {
var downloadLink = '/admin/anchor/downloadExcel?id=' + row.id;
var alink = '<a href="' + downloadLink + '">' + row.realName + ' </a> ';
// window.location.href=
return alink;
}
},
{
field: 'status', title: '状态', align: 'center', width: '5%',
formatter: function (val, row, index) {
if (val == 1) {
return "审核中";
} if (val == 2) {
return "审核通过";
} if (val == 3) {
return "驳回";
} if (val == 4) {
return "已导入";
} else {
return '-';
}
}
},
{ field: 'checkAdminName', title: '审核人', align: 'center', width: '5%' },
{
field: 'checkTime',
title: '审核时间',
align: 'center',
width: '5%',
valign: 'middle',
formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:00");
} else {
return '-';
}
}
},
{
field: 'id',
title: '操作',
align: 'center',
width: '15%',
formatter: function (val, row, index) {
var result = '';
console.log(row.status)
if (row.status == 2) {
result += '<button id="import" name="import" class="btn btn-sm btn-success opt-import" data-id=' + val + '>' +
'<i class="glyphicon glyphicon-import"></i> 导入</button>&nbsp;&nbsp;';
}
return result;
}
}
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
erbanNo: $('#erbanNo').val(),
templateId: $('#templateId').val(),
sendStatus: $('#sendStatus').val(),
createTime: $('#createTime').val(),
sendTime: $('#sendTime').val()
};
return param;
},
toolbar: '#toolbar',
url: '/admin/anchor/uploadList',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
});
$("#btnSearch").click(function () {
TableHelper.doRefresh('#table');
})
$("#btnImport").click(function () {
$("#uploadFile").val("");
$("#fileUpload").modal('show');
});
$("#upload").click(function () {
var file = $("#uploadFile").val();
if (file == null || file == undefined || file == '') {
$("#tipMsg").text("上传文件不能为空.");
$("#tipModal").modal('show');
}
debugger;
$("#fileUpload").modal('hide');
showLoading();
var option = ({
type: "POST",
url: "/admin/anchor/uploadExcel",
cache: false,
contentType: false, //不可缺
processData: false, //不可缺
dataType: "json",
success: function (json) {
hideLoading();
console.log(json)
if (json.code == 200) {
$("#tipMsg").text("上传成功");
$("#tipModal").modal('show');
TableHelper.doRefresh('#table');
} else {
$("#tipMsg").text("上传失败.");
$("#tipModal").modal('show');
}
},
error: function () {
hideLoading();
$("#tipMsg").text("上传失败.");
$("#tipModal").modal('show');
}
});
$("#uploadForm").ajaxSubmit(option);
});
//更改
$('#table').on('click', '.opt-import', function () {
var key = parseInt($(this).data('id'));
console.log(key, typeof key);
if (confirm("确定要导入该流水账单吗?")) {
$.ajax({
type: 'post',
url: '/admin/anchor/check/import',
data: { 'id': key },
dataType: 'json',
success: function (data) {
if (data.code == 200) {
$("#tipMsg").text("操作成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("操作失败,错误信息:" + data.message);
$("#tipModal").modal('show');
}
}
});
}
})
}
}
};
</script>

Some files were not shown because too many files have changed in this diff Show More