Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vap

Package Overview
Dependencies
Maintainers
2
Versions
568
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vap - npm Package Compare versions

Comparing version 1.3.4 to 1.3.5

7

layouts/admin/FromModal/index.js

@@ -178,4 +178,2 @@ "use strict";

}
console.log(params);
console.log(column);
return React.createElement(antd_1.Select, __assign({}, params), column.options.map(function (item) { return React.createElement(antd_1.Select.Option, { value: item.value }, item.name); }));

@@ -206,2 +204,3 @@ };

// params.onChange(getFieldValue(column.field));
// column.onChange(getFieldValue(column.field));
}

@@ -278,3 +277,3 @@ else if (_.has(column, 'onChange')) {

return [];
}
} //console.log(column);
return _.has(this.props.data, column.field) ? this.props.data[column.field] + '' : '';

@@ -380,2 +379,4 @@ };

var data = _.assign({}, this.props.default, this.props.data);
// console.log(data);
// _.keys(data).map(key=>data[key]=data[key]+'');
// @ts-ignore

@@ -382,0 +383,0 @@ var DataFrom = antd_1.Form.create()(FromContent);

@@ -141,2 +141,4 @@ "use strict";

// }
//去掉被设置为false的列
params.columns = _.filter(this.props.columns, function (item) { return item.show === undefined || item.show == true; });
var selectedRowKeys = [];

@@ -143,0 +145,0 @@ if (this.props.select) {

@@ -1,2 +0,2 @@

import { TableProps } from 'antd/lib/table/interface';
import { TableProps, ColumnProps } from 'antd/lib/table/interface';
/**

@@ -68,2 +68,8 @@ * 过滤器,目前支持单选和多选,通常用于类型选择,状态过滤等

}
export interface Column<T> extends ColumnProps<T> {
/**
* 是否展示 ,默认 true
*/
show?: boolean;
}
/**

@@ -76,2 +82,6 @@ * TableLayout 的 Props 继承于 antd 的 Table 的 Props

/**
* 列定义,参考 antd table columns ,扩展 show 属性
*/
columns: Column<T>[];
/**
* 记录总数

@@ -78,0 +88,0 @@ */

{
"name": "vap",
"version": "1.3.4",
"version": "1.3.5",
"description": "vap",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -157,2 +157,7 @@ /**

static CLEAR(...urls: string[]): void;
static TESTDATA(url: string, columns: any, method?: string, param?: {}): void;
static TESTLIST(url: string, columns: {
name: string;
type: 'string' | 'number' | 'date';
}[], method?: string, param?: {}): Promise<{}>;
}

@@ -456,2 +456,25 @@ "use strict";

};
default_1.TESTDATA = function (url, columns, method, param) {
if (method === void 0) { method = 'GET'; }
if (param === void 0) { param = {}; }
};
default_1.TESTLIST = function (url, columns, method, param) {
if (method === void 0) { method = 'GET'; }
if (param === void 0) { param = {}; }
return new Promise(function (resolve, reject) {
var success = _.random(1, 10) > 1;
var timeOut = _.random(100, 3000);
console.info("\u6A21\u4EFFAjax\u5411 " + url + " \u53D1\u51FA\u4E86 " + method + "\u8BF7\u6C42,\u8BF7\u6C42\u53C2\u6570\uFF1A" + JSON.stringify(param));
setTimeout(function () {
if (success) {
console.info("\u6A21\u62DF\u8BF7\u6C42\u6210\u529F");
resolve({ code: '0', message: '', total: _.random(5, 5000), list: [] });
}
else {
console.error("\u6A21\u62DF\u8BF7\u6C42\u5931\u8D25");
reject({ code: '9999', message: '模拟失败了' });
}
}, timeOut);
});
};
return default_1;

@@ -458,0 +481,0 @@ }());

@@ -141,3 +141,3 @@ "use strict";

var query = _a.query;
var call = _b.call, put = _b.put;
var put = _b.put;
var resp;

@@ -144,0 +144,0 @@ return __generator(this, function (_c) {

@@ -14,3 +14,17 @@ export default abstract class {

static theme(): string;
static getParam(): string;
/**
* 获取URL链接的参数 ?a=1&b=2
* Page.getParam('a') // '1'
* Page.getParam('b') // '2'
* Page.getParam('c') // ''
*/
static getParam(param: any): string;
/**
* 加载权限
*/
static loadRole(): void;
/**
* 判断是否有权限
*/
static hasRole(role: string): boolean;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var _ = require("lodash");
var Ajax_1 = require("./Ajax");
var MAPIDS = [

@@ -94,7 +95,37 @@ { "id": "65", "name": "新疆维吾尔自治区" },

};
default_1.getParam = function () {
/**
* 获取URL链接的参数 ?a=1&b=2
* Page.getParam('a') // '1'
* Page.getParam('b') // '2'
* Page.getParam('c') // ''
*/
default_1.getParam = function (param) {
var reg = window.location.search.match(new RegExp("[\?\&]" + param + "=([^\&]*)(\&?)", "i"));
if (reg != null) {
return decodeURI(reg[1]);
}
return '';
};
//权限
// private static Roles = new Set<string>();
/**
* 加载权限
*/
default_1.loadRole = function () {
window['_VAP_ROLE'] = new Set();
Ajax_1.default.SESION('/api-common/role/rules');
Ajax_1.default.GET('/api-common/role/rules', function (json) {
json.data.map(function (item) {
window['_VAP_ROLE'].add(item.path);
});
});
};
/**
* 判断是否有权限
*/
default_1.hasRole = function (role) {
return window['_VAP_ROLE'].has(role);
};
return default_1;
}());
exports.default = default_1;

@@ -8,2 +8,3 @@ "use strict";

var moment = require("moment");
var Page_1 = require("./Page");
/**

@@ -148,2 +149,5 @@ * 字符串截取 Render

}
function roleRender(role, render) {
return Page_1.default.hasRole(role) ? render : [];
}
exports.default = { statusRender: statusRender, strRender: strRender, listRender: listRender, momentRender: momentRender, dateRender: dateRender, htmlRender: htmlRender };
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc