<html>
<head>
<title>
配置管理器
</title>
<style type="text/css">
html, body {
font-family: Arial;
font-size: 14px;
} .fieldlabel {
float: left;
} .fieldtext {
float: left;
} .combobox {
float: left;
} .combobox.picker {
position: relative;
width: 100%;
height: 0px;
} .combobox.picker .option {
height: 24px;
border: 1px solid #ddd;
line-height: 24px;
text-indent: 10px;
text-align: left;
width: 100%;
cursor: pointer;
background-color: #efd;
} .combobox.picker .option:hover {
background-color: #ff0;
} .combobox.picker .option.select {
background-color: #ff0;
} .combotext {
float: left;
} .grid {
width: 100%;
float: left;
} .grid table {
width: 100%;
} .grid thead tr {
background-color: #3fc;
color: #fff;
font-weight: bold;
} .grid tbody tr {
cursor: pointer;
} .grid tbody tr:hover {
background-color: #ff0;
} .grid tbody tr.select {
background-color: #ff0;
} .container {
position: relative;
} .container .left {
position: relative;
left: 0px;
} .container .top {
position: relative;
top: 0px;
} .container .right {
position: relative;
right: 0px;
} .container .bottom {
position: relative;
bottom: 0px;
} .container .center {
position: relative;
}
</style>
<script src="~/Scripts/jquery-1.8.2.min.js"></script>
<script type="text/javascript">
var layer = null; var Wiu = {
define: function (name, obj) {
var win = window;
var names = name.split('.');
names.forEach(function (name, index) {
if (index + 1 == names.length) win = win[name] = obj || win[name] || {};
else win = win[name] = win[name] || {};
})
},
getObj: function (name) {
var win = window;
name && name.split('.').forEach(function (name) {
win = win[name];
});
return win;
},
apply: function (obj, com) {
for (var i in com) {
obj[i] = com[i];
}
return obj;
},
create: function (name, vm) {
var obj = Wiu.getObj(name);
Wiu.apply(obj, vm);
var event = Wiu.getObj(obj.extend);
return new event(obj);
},
Ajax: {
request: function (obj) {
$.ajax({
url: obj.api,
type: obj.type || 'post',
dataType: 'json',
data: obj.params,
async: obj.async || true,
success: function (result) {
if (result.IsSuccess) {
obj.success(result);
}
else if (result.ErrCode == '1001') {
alert('login');
}
else {
alert(result.ErrMsg);
}
}
});
}
},
Array: {
removeAt: function (array, index) {
return array.slice(0, index).concat(array.slice(index + 1, array.length));
},
remove: function (array, item) {
return array.filter(function (arr) { return arr != item; });
},
select: function (array, fn) {
var result = [];
array.forEach(function (arr) {
result.push(fn(arr));
});
return result;
},
find: function (array, fn) {
for (var i = 0; i < array.length; i++)
if (fn(array[i]))
return array[i];
}
},
Data: {
_modelid: 1,
_storeid: 1,
_viewmodelid: 1,
Model: function (obj) {
var data = obj;
var model = {
data: obj,
dirty: false,
id: 'wiu_model_' + (Wiu.Data._modelid++),
changeStatus: function () {
this.dirty = this.data != data;
},
change: function (data) {
this.data = data;
this.changeStatus();
this.onchange();
},
get: function (field) {
return this.data[field];
},
set: function (field, value) {
this.data[field] = value;
this.changeStatus();
this.onchange();
},
reset: function () {
this.change(data);
},
onchange: function () { }
};
return model;
},
Proxy: function (obj) {
return Wiu.apply({
page: 1,
size: 10,
outParams: {},
recordCount: 0
}, obj);
},
Store: function (obj) {
var me = this,
loadModel = function (item) { return new Wiu.Data.Model(item); } var store = {
id: 'store_' + (Wiu.Data._storeid++),
items: [],
ispage: obj.ispage === true,
updateRecords: [],
add: function (item) {
var me = this;
if (item instanceof Wiu.Data.Model) {
me.updateRecords.push({ type: 'create', data: item });
me.items.push(item);
} else {
me.items.concat(item);
item.forEach(function (item) {
me.updateRecords.push({ type: 'create', data: item });
});
}
me.datachange();
},
complete: function () { },
datachange: function () { },
proxy: obj.proxy ? Wiu.Data.Proxy(obj.proxy) : null,
load: function (params) {
var me = this;
if (!me.proxy) return me.complete();
Wiu.apply(me.proxy,
Wiu.apply({ params: params },
Wiu.apply(me.proxy.outParams,
me.ispage ? {} : { page: me.proxy.page, size: me.proxy.size })));
Wiu.Ajax.request(me.proxy);
},
loadPage: function (page, params) {
this.proxy.page = page;
this.load(params);
},
modify: function (model) {
var me = this;
for (var i in me.items) {
if (com.id === me.items[i].id) {
com.change(item.data);
me.datachange();
return;
}
}
},
getdata: function () {
var me = this;
return me.items.filter(function (item) {
var res = true;
me.filters.forEach(function (filter) {
res = res && filter(item);
})
return res;
})
},
remove: function (item) {
Wiu.Array.remove(this.items, item);
this.datachange();
},
removeAt: function (index) {
Wiu.Array.removeAt(this.items, index);
this.datachange();
},
filters: [],
filter: function (fn) {
this.filters.push(fn);
this.datachange();
},
clearfilter: function () {
this.filters = [];
this.datachange();
},
removeByFn: function (fn) {
this.items = this.items.filter(fn);
this.datachange();
},
status: 'init',
success: function (result) {
var me = this;
me.items = Wiu.Array.select(result, loadModel);
me.datachange();
me.status = 'complete';
me.complete();
}
};
if (obj.proxy) store.proxy.success = function (result) {
var me = this;
me.recordCount = result.RowCount || result.Result.length;
store.success(result.Result);
}
else store.items = Wiu.Array.select(obj.items, loadModel);
return store;
},
ViewModel: function (obj) {
var vm = {
id: 'wiu_viewmodel_' + (Wiu.Data._viewmodelid++),
change: {},
data: {},
event: {},
stores: {},
bind: function (field, value) {
this.data[field] = value;
},
get: function (field) {
return this.data[field];
},
getStore: function (name) {
return this.stores[name];
},
set: function (field, value) {
this.data[field] = value;
this.change[field] && this.change[field](value);
}
}
Wiu.apply(vm, obj); return vm;
}
},
ComponentManager: {
id: 1,
data: [],
register: function (obj) {
obj.id = 'component_' + Wiu.ComponentManager.id++;
obj.el.attr('id', obj.id);
this.data.push(obj);
},
getCmp: function (id) {
return Wiu.Array.find(this.data, function (item) {
return item.id === id;
});
}
},
Component: {
event: {
getBind: function (field, obj) {
return obj.component.bind && obj.component.bind[field] ?
obj.viewmodel.get(obj.component.bind[field]) : obj.component[field];
},
setBind: function (obj) {
var me = this;
return;
if (!obj.component.bind) return;
for (var i in obj.component.bind) {
switch (i) {
case 'text':
me.bindFieldLabel(obj.el, obj.component, obj.viewmodel);
break;
case 'value':
me.bindTextValue(obj.el, obj.component, obj.viewmodel);
break;
}
}
},
bindTextValue: function (dom, obj, vm) {
var input = dom.find('input');
input.change(function () {
vm.set(obj.bind.value, $(this).val());
});
vm.change[obj.bind.value] = function (val) {
input.val(val);
};
},
bindFieldLabel: function (dom, obj, vm) {
var text = dom.find('.fieldlabel');
vm.change[obj.bind.text] = function (val) {
text.html(val + ':');
}
},
getStyle: function (obj) {
var style = '';
for (var i in obj.style) {
style += i + ':' + obj.style[i] + ';';
}
return style;
},
getStore: function (obj) {
return obj.store ?
typeof obj.store == 'string' ?
Wiu.create(obj.store) : obj.store :
(typeof obj.viewmodel == 'string' ? Wiu.create(obj.viewmodel) : obj.viewmodel).getStore(obj.bind.store)
},
getViewModel: function (obj) {
return typeof obj.viewmodel == 'string' ? Wiu.create(obj.viewmodel) : obj.viewmodel;
}
},
bar: function (obj) {
var me = this,
event = Wiu.Component.event,
vm = event.getViewModel(obj),
bar = $('<div class="toolbar" style="' + event.getStyle(obj) + '"></div>') obj.items.forEach(function (item) {
item.viewmodel = vm;
Wiu.Component.create(item).render(bar);
});
me.component = obj;
me.el = bar;
me.render = function (obj) {
bar.appendTo(obj);
}
return me;
},
button: function (obj) {
var me = this,
event = Wiu.Component.event,
vm = event.getViewModel(obj),
button = {
xtype: 'button',
viewmodel: vm,
component: obj,
getView: function () {
return this.component;
},
getViewModel: function () {
return this.viewmodel;
},
render: function (obj) {
this.el.appendTo(obj);
}
},
temp = '<div class="button" style="' + event.getStyle(obj) + '">' + event.getBind('value', button, vm) + '</div>'; button.el = $(temp);
me.render = function (obj) {
me.el.appendTo(obj);
}
button.el.click(function (oEvent) {
var e = oEvent || window.event;
vm.event[obj.handler](e.srcElement, vm);
});
Wiu.ComponentManager.register(button);
Wiu.apply(me, button);
return me;
},
combobox: function (obj) {
var event = Wiu.Component.event;
var combobox = {
xtype: 'combobox',
text: [],
value: [],
viewmodel: event.getViewModel(obj),
component: obj,
el: null,
clear: function () {
me.value = [];
me.text = [];
input.val('');
},
status:false,
store: event.getStore(obj),
deselect: function (item) {
var items = item.slice ? item : [item];
this.el.find('.option').each(function (index, el) {
if (el.hasClass('select') &&
Wiu.Array.find(items, function (item) { return item.id === el.attr('id'); }) != null) {
el.click();
}
});
},
init: function () {
var me = this,
temp = '<div class="combobox"><div class="fieldlabel">' + event.getBind('text', combobox) + ':</div><div class="combotext"><input type="text" ><div class="combobox picker hidden"></div></div></div>';
me.el = $(temp);
me.store.complete = function () {
me.createPicker(this.items);
};
me.el.find('input').focus(function () {
if (me.status) return;
me.store.load();
layer = me.el.find('.picker');
layer.removeClass('hidden');
me.status = true;
});
},
select: function (item) {
var me = this;
var items = item.slice ? item : [item];
me.el.find('.option').each(function (index, el) {
if (!el.hasClass('select') &&
Wiu.Array.find(items, function (item) { return item.id === el.attr('id'); }) != null) {
el.click();
}
})
},
createPicker: function (items) {
var me = this, input = me.el.find('input'), picker = me.el.find('.picker');
picker.html('');
items.forEach(function (item) {
var option = $('<div id="' + item.id + '" class="combobox option" >' + item.get(obj.fieldText) + '</div>');
option.click(function () {
var el = $(this),
val = item.get(obj.fieldValue),
index = me.value.indexOf(val); if (index < 0) {
me.value.push(val);
me.text.push(item.get(obj.fieldText));
el.addClass('select');
}
else {
me.value = Wiu.Array.removeAt(me.value, index);
me.text = Wiu.Array.removeAt(me.text, index);
el.removeClass('select');
}
input.val(me.text.join(','));
});
picker.append(option);
});
},
render: function (obj) {
this.el.appendTo(obj);
}
}
combobox.init();
event.setBind(combobox);
Wiu.ComponentManager.register(combobox);
Wiu.apply(this, combobox);
return this;
},
container: function (obj) {
var me = this,
event = Wiu.Component.event,
vm = event.getViewModel(obj),
temp = '<div class="container" style="' + event.getStyle(obj) + '"></div>'; var container = $(temp);
obj.items.forEach(function (item) {
item.viewmodel = vm;
var com = Wiu.Component.create(item);
com.el.addClass(item.region);
com.render(container);
});
event.setBind(container, obj, vm);
me.component = obj;
em.el = container;
return me;
},
create: function (obj) {
var me = this;
switch (obj.xtype) {
case 'label':
return me.label(obj);
case 'combobox':
return me.combobox(obj);
case 'button':
return me.button(obj);
case 'textfield':
return me.textfield(obj);
case 'grid':
return me.grid(obj);
}
},
form: function (obj) {
var me = this,
event = Wiu.Component.event,
vm = event.getViewModel(obj),
temp = '<div class="form" style="' + event.getStyle(obj) + '"><table><tbody></tbody></table></div>'; var form = $(temp),
tbody = form.find('tbody'),
row = $('<tr></tr>'),
i = 0, j = 0;
for (; i < obj.items.length; i++, j += obj.items[i].colspan || 1) {
var cell = $('<td colspan=' + (obj.items[i].colspan || 1) + '></td>');
obj.items[i].viewmodel = vm;
var com = Wiu.Component.create(obj.items[i]);
com.render(cell);
cell.appendTo(row);
if (obj.cols && j > obj.cols) {
j = 0;
tbody.append(row);
row = $('<tr></tr>');
}
}
if (j > 0) {
obj.cols && row.append($('<td colspan=' + (obj.cols - j) + '></td>'));
tbody.append(row);
}
me.component = obj;
if (obj.buttons) {
Wiu.Component.bar({ items: obj.buttons, viewmodel: vm }).render(form);
}
me.render = function (obj) {
form.appendTo(obj);
}
me.el = form;
return me;
},
grid: function (obj) {
var me = this,
event = Wiu.Component.event,
vm = event.getViewModel(obj),
temp = '<div class="grid" style="' + event.getStyle(obj) + '"></div>',
store = event.getStore(obj, vm); var container = $(temp),
grid = $('<table><thead><tr>'
+ Wiu.Array.select(obj.columns, function (col) { return '<th style="' + event.getStyle(col) + '">' + col.text + '</th>'; }).join('')
+ '</tr></thead><tbody></tbody></table>');
if (obj.tbar) {
Wiu.Component.bar({ items: obj.tbar, viewmodel: vm }).render(container);
}
grid.appendTo(container);
me.store = store;
me.initData = function (items) {
var tbody = grid.find('tbody');
tbody.find('tr').remove();
items.forEach(function (item) {
var row = $('<tr>' + Wiu.Array.select(obj.columns, function (col) {
return '<td style="' + event.getStyle(col) + '"><div bind="' + col.bind + '" >' + item.get(col.bind) + '</div></td>';
}).join('') + '</tr>');
item.onchange = function (field, value) {
row.find('div[bind="' + field + '"]').html(value);
};
tbody.append(row);
row.click(function () {
var el = $(this);
me.select(el, item);
});
});
};
me.selection = [];
var bindSelect = obj.bind['selection'] || false;
me.select = function (el, item) {
if (el.hasClass('select')) {
me.selection = Wiu.Array.remove(me.selection, item);
el.removeClass('select');
} else {
me.selection.push(item);
el.addClass('select');
}
bindSelect && vm.set(bindSelect, me.selection);
}
event.setBind(obj);
store.complete = function () {
me.initData(store.getdata());
};
me.component = obj;
me.el = container;
me.viewmodel = vm;
if (obj.page) {
me.pagebar(me, store);
}
if (obj.bbar) {
Wiu.Component.bar({ items: obj.bbar, viewmodel: vm }).render(container);
}
me.render = function (obj) {
container.appendTo(obj);
}
store.load();
return me;
},
label: function (obj) {
var event = Wiu.Component.event;
var label = {
xtype: 'label',
component: obj,
viewmodel: event.getViewModel(obj),
el: null,
render: function (obj) {
this.el.appendTo(obj);
}
};
var temp = '<div class="label" style="' + event.getStyle(obj) + '">' + event.getBind('text', label) + '</div>';
label.el = $(temp)
event.setBind(label);
Wiu.ComponentManager.register(label);
Wiu.apply(this, label);
return this;
},
markstar: function (obj) {
var me = this,
remark = obj.remark || 1,
imgOn = '<img src="~/Images/star-on.png" />',
imgOff = '<img src="~/Images/star-off.png" />',
getStarHtml = function (remark) {
var html = '';
for (var i = 0; i < obj.changed ? 5 : remark; i++) { html += remark > i ? imgOn : imgOff; }
return html;
},
html = '<div style="width:100%;float:left;margin-top:5px;"><label style="float:left; font-size:13px;">' + title + ':</label><div style="float:left;">' + getStarHtml(remark)
+ '</div></div><br/>',
markstar = $(html); markstar.appendTo(container);
if (!obj.changed) return;
var imgs = markstar.find('img');
imgs.mouseover(function (obj) {
var mark = false;
imgs.each(function (index, el) {
el.src = mark ? imgOff : imgOn;
mark = mark || el == obj.target;
});
}) imgs.mouseout(function (obj) {
imgs.each(function (index, el) {
el.src = index < remark ? imgOn : imgOff;
});
}) imgs.click(function (obj) {
imgs.each(function (index, el) {
if (el == obj.target) {
remark = index + 1;
obj.fn && obj.fn(remark);
}
})
})
me.render = function (obj) {
markstar.appendTo(obj);
}
me.component = obj;
me.el = markstar;
},
pagebar: function (grid) {
var me = this,
store = grid.store,
proxy = store.proxy || { page: 1, size: 10, recordCount: 0 }; var plugin = {
sizeconfigs: [10, 20, 50, 100, 1000],
tpl: '<div class="pagebar"><div>每页</div><div><select>{size}</select></div><div>条</div><div class="split"></div><div class="handler" action="first">《</div><div class="handler" action="last"><</div><div class="split"></div><div>第</div><div><input type="text" action="page" value="{page}" /></div><div>页</div><div>共{pageCount}页</div><div class="split"></div><div class="handler" action="next">></div><div class="handler" action="end">》</div><div class="split"></div><div class="count"><div class="record">显示{recordStart}-{recordEnd}</div><div show="count">共{recordCount}条</div></div></div>',
page: proxy.page,
size: proxy.size,
pageCount: 1,
recordCount: 0,
recordStart: 0,
recordEnd: 0, view: grid.el, countPageRange: function () {
var me = this;
me.pageCount = Math.ceil(me.recordCount / me.size);
var recordEnd = me.page * me.size;
me.recordStart = recordEnd > 0 ? recordEnd - me.size + 1 : 0;
me.recordEnd = recordEnd < me.recordCount ? recordEnd : me.recordCount;
}, createPageBar: function () {
var me = this,
tpl = me.tpl; me.countPageRange(); //grid.el.find('.pagebar').remove(); var option = '';
me.sizeconfigs.forEach(function (item) {
option += '<option ' + (me.size == item ? 'selected' : '') + ' value="' + item + '">' + item + '</option>';
});
tpl = tpl.replace('{size}', option);
tpl = tpl.replace('{page}', me.page);
tpl = tpl.replace('{pageCount}', me.pageCount);
tpl = tpl.replace('{recordStart}', me.recordStart);
tpl = tpl.replace('{recordEnd}', me.recordEnd);
tpl = tpl.replace('{recordCount}', me.recordCount);
var bar = $(tpl);
bar.find('.handler').click(function () {
var action = $(this).attr('action');
var nowPage = me.page;
if (action == 'first') {
me.page = 1;
} else if (action == 'last') {
me.page = me.page - 1 || 1;
} else if (action == 'next') {
me.page = me.page < me.pageCount ? me.page + 1 : me.page;
} else {
me.page = me.pageCount;
}
if (nowPage != me.page) {
me.init();
}
});
bar.find('input').change(function () {
var el = $(this),
value = el.val(); me.page = value;
me.init();
});
bar.find('select').change(function () {
var el = $(this),
value = el.val(); me.size = value;
me.init();
});
var oldBar = me.view.find('.pagebar');
if (oldBar.length > 0) {
me.view[0].replaceChild(bar[0], oldBar[0]);
} else {
me.view.append(bar);
}
}, init: function () {
proxy.page = me.page;
proxy.size = me.size;
store.load();
}
};
Wiu.apply(plugin, proxy);
store.complete = function () {
plugin.recordCount = proxy.recordCount;
plugin.createPageBar();
if (store.proxy) {
grid.initData(store.items);
} else {
grid.initData(store.items.slice(plugin.recordStart, plugin.recordEnd));
}
}
plugin.createPageBar();
},
textfield: function (obj) {
var me = this,
event = Wiu.Component.event,
textfield = {
xtype: 'textfield',
viewmodel: event.getViewModel(obj),
component: obj,
el: null,
getView: function () {
return this.component;
},
getViewModel: function () {
return this.viewmodel;
},
render: function (obj) {
this.el.appendTo(obj);
}
}; var temp = '<div class="textfield" style="' + event.getStyle(textfield.component) + '"><div class="fieldlabel">' + event.getBind('text', textfield) + ':</div><div class="fieldtext"><input type="text" value="' + event.getBind('value', textfield) + '"></input></div></div>';
textfield.el = $(temp);
event.setBind(textfield);
if (obj.bind) {
if (obj.bind.value) {
var input = textfield.el.find('input');
input.change(function () {
textfield.viewmodel.bind(obj.bind.value, $(this).val());
});
textfield.viewmodel.change[obj.bind.value] = function (val) {
input.val(val);
};
}
if (obj.bind.text) {
var text = textfield.el.find('fieldlabel');
textfield.viewmodel.change[obj.bind.text] = function (val) {
text.html(val + ':');
};
}
}
Wiu.ComponentManager.register(textfield);
Wiu.apply(this, textfield);
return this;
},
window: function (obj) {
var me = this,
event = Wiu.Component.event,
vm = event.getViewModel(obj),
temp = '<div class="window" style="' + event.getStyle(obj) + '"><div class="window_title">'
+ event.getBind('title', obj) + '</div></div>'; var container = $(temp);
obj.items.forEach(function (item) {
var com = Wiu.Component.create(item, vm);
com.el.addClass(item.region);
com.render(container);
});
event.setBind(container, obj, vm);
me.component = obj;
me.el = container;
me.show = function () {
me.el.css({ 'display': 'block' })
}
me.close = function () {
me.el.css({ 'display': 'none' })
}
return me;
}
}
};
Wiu.define('Web.Store.QueryList', {
extend: 'Wiu.Data.Store',
proxy: {
api: '/Config/getquerylist'
}
});
Wiu.define('Web.Store.Combo', {
extend: 'Wiu.Data.Store',
items: [
{ text: 'a', value: 1 },
{ text: 'b', value: 2 },
{ text: 'c', value: 3 },
{ text: 'd', value: 4 }
]
});
Wiu.define('Web.ViewModel.QueryList', {
extend: 'Wiu.Data.ViewModel',
data: {
name: '测试',
value: 'Hello World',
text: '下拉框',
selection: []
},
stores: {
data: Wiu.create('Web.Store.Combo'),
store: Wiu.create('Web.Store.QueryList')
},
event: {
Add: function (el, vm) {
alert(vm.get('value'));
},
ConfigQuery: function (el) { },
ConfigReport: function (el) { },
ConfigOperation: function (el) { },
Delete: function (el) { }
}
})
window.onload = function () {
$('body').click(function () {
var e = window.event;
if (layer && layer.find(e.target).length==0) {
layer.addClass('hidden');
}
})
Wiu.Component.grid({
tbar: [{
xtype: 'textfield',
bind: {
text: 'name',
value: 'value'
}
}, {
xtype: 'combobox',
fieldText: 'text',
fieldValue: 'value',
bind: {
text: 'text',
store: 'data'
}
}],
columns: [
{ text: '值', bind: 'Id' },
{ text: '名称', bind: 'Name' },
{ text: '位置', bind: 'Position' }
],
viewmodel: 'Web.ViewModel.QueryList',
page: true,
bbar: [
{ xtype: 'button', value: '新增', handler: 'Add' },
{ xtype: 'button', value: '配置查询', handler: 'ConfigQuery' },
{ xtype: 'button', value: '配置列表', handler: 'ConfigList' },
{ xtype: 'button', value: '配置功能', handler: 'ConfigFunction' },
{ xtype: 'button', value: '删除', handler: 'Delete' }
],
bind: {
store: 'store'
}
}).render($('body'));
}
</script> <style type="text/css">
html, body {
margin: 0;
padding: 0;
} .window {
position: absolute;
border: 1px solid #ccc;
background-color: #fff;
} .window .title {
height: 30px;
text-align: left;
line-height: 30px;
font-weight: bold;
text-indent: 5px;
background-color: #cbf;
color: #fff;
} .layer {
width: 100%;
height: 100%;
position: absolute;
top: 0px;
left: 0px;
background-color: #edb;
opacity: 0.4;
} .hidden {
display: none;
} .close {
} .frt {
float: right;
}
</style>
<link href="~/Content/page.css" rel="stylesheet" />
<link href="~/Content/table.css" rel="stylesheet" />
<link href="~/Content/component.css" rel="stylesheet" />
<script src="~/layer/layer.min.js"></script>
</head>
<body>
</body>
</html>

完全没有继续下去的欲望

extjs后自己写了一些见不得人的脚本的更多相关文章

  1. 【CSS学习笔记】初始化CSS后,写li,并利用背景图片,来完成li小图标的效果,且达到个浏览器兼容

    第一种情况 /*当标题前的图标时单独的一个点儿或者方块或者其他类似图标时,定义背景图background要放在<li>里.    在<li>中设置背景图片的尺寸,地址,不重复, ...

  2. 七、K3 WISE 开发插件《Update字段级更新触发器 - BOS单审核后反写源单》

    审核成功触发,是一个比较典型的场景.需要用到update触发器,跟踪到审核状态的变化. 引用的源码<采购检验单审核后反写收料通知单>,其中采购检验单是BOS自定义单据. if (objec ...

  3. c:param 标签后不要写 注释 。否则报错 Encountered illegal body of tag "c:import" tag, given its attributes

    c:param 标签后不要写 注释 .否则报错  Encountered illegal body of tag "c:import" tag, given its attribu ...

  4. 自己写的一个tomcat发布脚本

    闲来无事,就自己写一个shell脚本,方便自己以后在服务器上部署tomcat下的项目.我本地用maven打包,然后每次都要人工去切换一堆堆目录,有点繁琐,所以我写了下面的shell脚本. #! /bi ...

  5. Extjs 让combobox写起来更简单

    也已经写了很久时间的extjs ,每次都用到很多的combobox,配置很多东西觉得实在是太麻烦,所以根据常用到的情况写了一个简便的combobox,再次记录下来,以免放在某个地方忘记了找不到了. 定 ...

  6. 填报表导出excel后不可写的单元格处于锁定状态

     填报表单元格分为可写和不可写两种状态,当填报表在web上展现的时候可写单元格可以进行数据填报和修改,非可写单元格不可操作. 报表导出为excel时,润乾导出excel包默认情况下不对excel单 ...

  7. 自从用python写了个自动弹幕脚本后,各大主播都来找我,净赚十万!

    大家好,今天又给大家带来了Python爬虫的分享,今天我们继续上次的问题,继续来研究一下虎牙平台的爬虫. 起因 写完上次的代码,我冒出有一个很有趣的想法,就是,我们可以使用selenium来完成虎牙自 ...

  8. 看完阮一峰的React教程后, 我写了一个TodoList

    看完阮一峰的React教程后,就自己做了这个TodoList,自己慢慢琢磨效率差了点但是作为入门小练习还是不错的. 以下是效果图:我的源码:todolistUI:bootstrap 4 一.组件化 我 ...

  9. postman从body,headers,data中获取token后回写做全局变量

    设置全局变量

随机推荐

  1. 如何 实现PHP多版本的 共存 和 切换?

    编译PHP时指定路径 ./configure --prefix=/opt/php/php-5.6 make && make install 这样可以PHP版本就可以安装到一个特别的路径 ...

  2. php引用

    1.需求 了解php引用 2.变量的引用 目前为止看到的引用是变量的引用, 例子1 $a="ABC"; $b =&$a; echo $a;//这里输出:ABC echo $ ...

  3. hadoop 2.6 centos 7.1 下的一些操作

    开启hdfs: start-dfs.sh 开启yarn: start-yarn.sh 查看hdfs:http://ip:50070/ 查看RM:http://ip:8088/

  4. linux c 笔记-1

    指令帮助: man xxx_command man 2 xxx_command man 3 xxx_command eg. 打开文件的函数open, 如果不清楚传参,则 man open man 2 ...

  5. source和./的区别

    熟悉Linux的朋友常使用·bash·.·sh·.·source·.·.·,但却并非每位朋友都知道其中的区别.我们通过下面一幅图来为大家说明白.

  6. jQuery UI 实现图片循环显示,常用于网站首页banner广告切换

    http://www.runoob.com/try/try.php?filename=jqueryui-example-position-cycler <!doctype html>< ...

  7. 一个简单的servlet的demo

    javaweb  的应用我们需要参考javaee  api 查找servlet接口 javax.servletInterface Servlet All Known Subinterfaces: Ht ...

  8. 【原创】js实现一个可随意拖拽排序的菜单导航栏

    1.想做这个效果的原因主要是用在UC上看新闻发现他们的导航菜单很有趣.无聊的时候在哪划着玩了很久.所以就干脆自己写一个.原效果如下 2.整体效果如下,在已推荐和未添加里面每个小方块可以触摸移动位置互换 ...

  9. ios如何一个证书多台设备测试

    在苹果开发者网站申请的证书,是授权mac设备的开发或者发布的证书,这意味着一个设备对应一个证书,但是99美元账号只允许生成3个发布证书,两个开发证书,这满足不了多mac设备的使用,使用p12文件可以解 ...

  10. js串讲整理

    js子级窗口向父级窗口传值 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http ...