TypeScript ts/opg wrapPanel示例

说明

typescript ts/opg wrappanel示例是从最受好评的开源项目中提取的实现代码,你可以参考下面示例的使用方式。

编程语言: TypeScript

命名空间/包名称: ts/opg

示例#1
文件: index.ts 项目: rpdg/fy.js

import Panel from "ts/ui/Panel";


opg.api({
	collection: 'system/collection/findPage',
	amssp: 'system/amssp/findAll',
	'delete!DELETE!': 'system/collection/delete/${id}',
	'switch!delete!': 'system/collection/switch/${id}'
});


const infoPage = '/page/admin/collection/info.html';


let panel: Panel = opg.wrapPanel('#tbSearch', {
	title: '采集源查询',
	btnSearchText: '<i class="ico-find"></i> 查询'
});

panel.btnSearch.click(function () {
	let param = $('#tbSearch').fieldsToJson();
	param.pageNo = 1;
	//param.spCode = sel.getValue();
	console.log(param);
	tb.update(param);
});

let spHash = {};

opg('#spCode').listBox({
	api: opg.api.amssp,
	value: 'code',

示例#2
文件: index.ts 项目: rpdg/fy.js

		//console.log(tree);
		//tree.rootName = d.name;
	},
	onCreate: function () {
		tree.root.find('li:eq(0)').find('.sp:eq(0)').click();
	},
	onUpdate: function () {
		$('#tree' + tree.guid + 'Sp_' + tree.prevItemId).trigger('click');
	}
	//template : '<a href="#1"> ${name}</a>',
	//cmd : 'checkAll'
});


let panel = opg.wrapPanel('#tbSearch', {
	title: '角色信息',
	btnSearchText: '<i class="ico-edit"></i> 修改'
});

panel.btnSearch.click(function () {
	editRole.call(this, true);
});


//console.log(panel.jq);
let roleNameSp = $('#roleName');
let roleDescSp = $('#roleDesc');
let btnAdd = $('#btnAdd');

//Add new
btnAdd.click(function () {

展开阅读全文