當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ts.default.api方法代碼示例

本文整理匯總了TypeScript中ts/opg.ts.default.api方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ts.default.api方法的具體用法?TypeScript ts.default.api怎麽用?TypeScript ts.default.api使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ts/opg.ts.default的用法示例。


在下文中一共展示了ts.default.api方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: function

import opg from 'ts/opg.ts';

let id = opg.request['id'] ;
opg.api({
	'findById!!': 'system/organization/findById/${id}',
	'update!post' : 'system/organization/update' ,
	'add!post' : 'system/organization/add'
});

const codes = {
	'system_amsorganization_name_empty' : '組織名稱為空',
	'system_amsorganization_code_empty' : '組織代碼為空',
	'system_amsorganization_name_existed' : '組織名稱已被占用',
	'system_amsorganization_code_existed' : '組織代碼已被占用',
};

opg.api.add.set('codes', codes);
opg.api.update.set('codes', codes);



let form = $('#tbSearch');
if(id){
	opg.api.findById({id : opg.request['id']} , function (data) {
		form.jsonToFields(data);
	});
}



window['doSave'] = function (popWin , table) {
開發者ID:rpdg,項目名稱:fy.js,代碼行數:31,代碼來源:info.ts

示例2: opg

import opg from 'ts/opg.ts';


opg.api({
	queryContentGroups: 'admin/content/rel/queryContentGroups',
});

let checkedInfo = parent.window['checkedInfo'];
let checkedGroupData = checkedInfo.groups, checkedGroupDataHash = opg.convert.arrayToHash(checkedGroupData, 'id');

let tbSelected = opg('#selectedTb').table({
	data: checkedGroupData,
	columns: [
		{text: '已選分組', src: 'name'},
		{
			text: '操作', src: 'id', width: 60,
			render: function (val, i, row) {
				return `<button class="btn-mini btn-danger" data-id="${val}" data-index="${i}">刪除</button>`
			}
		},
	]
});

//remove the checked row
tbSelected.tbody.on('click', '.btn-danger', function () {
	let btn = $(this), i = btn.data('index');
	checkedGroupData.splice(i, 1);
	checkedGroupDataHash = opg.convert.arrayToHash(checkedGroupData, 'id');
	tbSelected.update(checkedGroupData);
});
開發者ID:rpdg,項目名稱:fy.js,代碼行數:30,代碼來源:groupCheck.ts

示例3:

import Table from "ts/ui/Table.ts";
import {Combo} from 'ts/ui/Combo' ;
import {store, Cache} from 'ts/util/store';
import PopUp from "ts/ui/Popup";
import AuditPutBack from '../@comm/auditPutBack' ;


let currentUser = store.get('userInfo');

console.log('currentUser', currentUser);

opg.api({
	contentType: 'content/contentType/findAll',
	sourceTypes: 'system/collection/collectSourceEnum',
	audit: 'audit/findPage?stepCode=collect_audit',
	checkAuditPermission: 'audit/checkAuditPermission/${orderId}',  //檢查審核權限
	'pass!POST': 'audit/pass',
	'cancelAuditOrder!!': 'audit/cancelAuditOrder/${orderId}',  //取消審核
	'delete!DELETE!': 'transcode/business/delete/${id}',
});


let panel: Panel = opg.wrapPanel('#tbSearch', {
	title: '二審工單查詢',
	btnSearchText: '<i class="ico-find"></i> 查詢'
});
Combo.makeClearableInput($('#createTimeBegin').datetimepicker({
	timepicker: false,
	closeOnDateSelect: true,
	format: 'Y-m-d'
}), $({}));
開發者ID:rpdg,項目名稱:fy.js,代碼行數:31,代碼來源:index.ts

示例4: opg

import opg from 'ts/opg.ts';


opg.api({
	'mainCategory!!': 'copyright/programType/findProgramtype',
	'subCategory!!': 'copyright/programType/findProgramtype/${parentId}',
	'findById!!': 'transcode/business/findById/${id}',
});


let selMainCategory = opg('#mainCategory').listBox({
	api: opg.api.mainCategory,
	text: 'programType',
	onSelect: () => {
		let parentId = selMainCategory.getValue();
		if (!parentId) parentId = -1;
		selSubCatagory.update({parentId});
	}
});
let selSubCatagory = opg('#minorCategory').listBox({
	lazy: true,
	api: opg.api.subCategory,
	text: 'programType',
});


const id = opg.request['id'];

const form = $('#tbProfile');

開發者ID:rpdg,項目名稱:fy.js,代碼行數:29,代碼來源:detail.ts

示例5:

import opg from 'ts/opg.ts';
import Panel from "ts/ui/Panel.ts";
import Table from "ts/ui/Table.ts";
import {Combo} from 'ts/ui/Combo' ;
import {store, Cache} from 'ts/util/store';

opg.api({
	contentType: 'content/contentType/findAll',
	sourceTypes: 'base/sourceTypes',
	collect: 'produce/order/findPage?stepCode=collect_catalog',
	'start!post!' : 'produce/collectCatalog/start/${orderId}' ,
});

const moduleName = '非編工單';

let panel = opg.wrapPanel('#tbSearch', {
	title: `${moduleName}`,
	btnSearchText: '<i class="ico-find"></i> 查詢'
});

panel.btnSearch.click(function () {
	let param = $('#tbSearch').fieldsToJson();

	if (param.beginTimeBegin && param.beginTimeBegin.indexOf(' ') < 0) {
		param.beginTimeBegin += ' 00:00:00';
	}
	if (param.beginTimeEnd && param.beginTimeEnd.indexOf(' ') < 0) {
		param.beginTimeEnd += ' 23:59:59';
	}

	//debugger;
開發者ID:rpdg,項目名稱:fy.js,代碼行數:31,代碼來源:index.ts

示例6: opg

/**
 * 此頁麵已被廢除
 */



import opg from 'ts/opg.ts';
import Table from "ts/ui/Table.ts";


opg.api({

});



let tb: Table = opg('#tb').table({
	api: opg.api.amssp,
	titleBar: {
		title: '采集任務列表',
	},
	columns: [
		{
			text: '狀態',
			width: 120,
			src: 'name'
		},
		{
			text: '輸入類別',
			width: 80,
			src: 'description'
開發者ID:rpdg,項目名稱:fy.js,代碼行數:31,代碼來源:worksheet.ts

示例7: opg

import opg from 'ts/opg.ts';
import {Cache} from 'ts/util/store' ;


opg.api({
	query: 'admin/catalog/getOrderstWithCatlog',
});



//
let tb = opg('#groupTb').table({
	titleBar: {
		title: '已編目列表',
	},
	columns: [
		{
			text: '內容名稱', src: 'assetName' ,
			render : function (val, i , row) {
				return `<a class="port" href="javascript:void(0);" data-id="${row.assetId}">${val}</a>`;
			}
		},
		{text: '內容類型', src: 'contentType', width: 100},
		{text: '來源', src: 'sourceName', width: 100},
		{text: '創建時間', src: 'createTime', width: 120},
		{ text: '創建人', src: 'creator', width: 80 },
	],
	api: opg.api.query,
	pagination: {
		pageSize: 20,
		customizable: [10, 20 , 30]
開發者ID:rpdg,項目名稱:fy.js,代碼行數:31,代碼來源:copyInfo.ts

示例8: opg

import opg from 'ts/opg.ts';

opg.api({
	amssp: 'content/contentType/findPage',
	'delete!DELETE!': 'content/contentType/delete/${id}'
});


const infoPage = '/page/content/contentType/info.html';

//wrap as search panel
let panel = opg.wrapPanel('#tbSearch', {
	title: '節目類型查詢',
	btnSearchText: '<i class="ico-find"></i> 查詢'
});

//click to search
panel.btnSearch.click(function () {
	let param = $('#tbSearch').fieldsToJson();
	param.pageNo = 1;
	//console.log(panel.jq, param);
	tb.update(param);
});

//create a data table
let tb = opg('#tb').table({
	api: opg.api.amssp,
	columns: [
		{
			text: '節目類型名稱',
			src: 'name'
開發者ID:rpdg,項目名稱:fy.js,代碼行數:31,代碼來源:index.ts

示例9:

import opg from 'ts/opg.ts';
import Panel from "ts/ui/Panel.ts";
import {ListBox} from "ts/ui/FormControls.ts";
import {store} from "../../../ts/util/store";


opg.api({
	operators: 'system/user/findPage',
	amssp: 'system/amssp/findPage?pageNo=1&pageSize=9999',
	'delete!DELETE!': 'system/user/${id}',
	'enable!PUT!': 'system//user/enable/${id}',
	'disable!PUT!': 'system/user/disable/${id}',
	'changePassword!PUT': 'system/user/changePassword',
});


const infoPage = '/page/admin/operator/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);
});
開發者ID:rpdg,項目名稱:fy.js,代碼行數:31,代碼來源:index.ts


注:本文中的ts/opg.ts.default.api方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。