本文整理汇总了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) {
示例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);
});
示例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'
}), $({}));
示例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');
示例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;
示例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'
示例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]
示例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'
示例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);
});