isun
Version:
快速创建vue项目
311 lines (294 loc) • 8.27 kB
JavaScript
export const Result = {
code: 200, // 成功为200,后台错误为500,参数错误400, 参数407为token失效
msg: null, // 返回信息
data: null // 返回结果
}
export const Page = {
code: 200, // 成功为200,后台错误为500,参数错误400, 参数407为token失效
msg: null, // 返回信息
current: 0, // 当前第几页
size: 0, // 每页多少条
data: [], // 返回的数据list
pages: 0, // 总共多少页
total: 0 // 总共多少条
}
/**
* ****** 节点表 ******
*/
export const node = {
id: 0,
title: '', // 名称
loginID: 'admin', // 帐号
password: '123456', // 密码
userLogo: '/avatar2.jpg', // 头像
isCheckKey: false, // 是否校验
connectStatus: true, // 节点连接状态
userTotal: 0, // 用户总数
contractTotal: 0, // 合约总数
blockHeightTotal: 0, // 总区块高度,由下属各合约高度相加而得
token: 'QEFGQWERTYUIKL' // token
}
/**
* ****** 日志表 ******
*/
export const log = {
id: 0,
changeTime: '1991-03-23 16:54:27', // 联盟合约操作变更时间
operationName: 'admin', // 操作节点名称
contractName: '123456', // 合约名称
contractType: 0 // 操作类型0发布 1签署
}
/**
* ****** 用户统计返回实体 ******
*/
export const userTotal = {
id: 0,
region: '云南下一个地州', // 地区
adcd: '530100', // 6位行政区划编码
regionUserNum: 321321 // 用户数 userInfo.length
}
/**
* ****** 用户表******
*/
export const userInfo = {
id: 0,
logo: '', // 图标
longitude: 0, // 经度
latitude: 0, // 纬度
regDate: '1991-03-23 16:54:27', // 注册时间
addDate: '1991-03-23 16:54:27', // 上链时间
userType: 0, // 用户类型 关联字典表 userType
allianceUsersType: 0, // 联盟用户类型 关联字典表 allianceUsers
adcd: '530100', // 6位行政区划编码
belongNodeName: '隶属节点名', // 隶属节点名
belongNodeId: 0, // 隶属节点ID
title: '义乌市亿丁农业开发有限公司', // 公司名称
upperChainData: 13131, // 上链条数据
consensusItems: [], // 履行共识项
consensusItemsTitle: [], // 履行共识项中文名称
status: 0, // 状态 1上线 0下线
level: 0 // 用户级别 0普通用户 1高级认证
}
/**
* ****** 合约规则表 要与合约表关联 ******
*/
export const rule = [
{
id: 0, // 规则Id
title: '', // 名称
type: 0, // 类型 0字符串,1整数
length: '', // 字段长度/允许资料数量
checkRule: '', // 校验规则 (正则)
isNot: true, // 是否可以为空
desc: '', // 字段描述
isCheck: true // 是否需要节点审核
}
]
/**
* ****** 签署表 要与合约表关联******
*/
export const sign = [
{
id: 0, // 签署用户ID
contractId: 0, // 关联的合约ID
avatar: '', // 签署用户头像
name: '', // 签署用户名称
signDate: '1991-03-23 16:54:27' // 签署时间
}
]
/**
* ****** 合约表 ******
*/
export const contract = {
id: 0, // 合约Id
contractName: '合约名称', // 合约名称
releaseName: '发布方', // 发布方
releaseId: '007', // 发布方Id (发布这条信息的节点id)
releaseAvatar: '', // 发布方头像
version: '1.2', // 版本号
contractType: 'DataSpecification', // 合约类型 DataSpecification(数据规范) InfoRecord (资料备案)
contractDesc: '合约描述', // 合约描述
label: '标签', // 标签
userAuth: '0,1', // 合约用户授权 参照字典表联盟用户类型 allianceUsers,用英文逗号隔开
isSecretData: true, // 节点加密共享 true | false
nodeAuth: '0,1', // 节点授权 参照字典表 allianceNode,用英文逗号隔开
ruleList: rule, // 关联合约规则表
isConnect: true, // 是否链接
blockHeight: 32143, // 区块高度
involvesUser: 3000, // 涉及用户
transactions: 123344, // 交易次数
status: 1, // 0代表暂存 1代表已发布 2代表已经生效
signList: sign, // 关联签署表
publishTime: '1991-03-23 16:54:27'
}
/**
* ****** 链表 ******
*/
export const chain = {
id: 0, // 合约Id
contractId: 0, // 合约Id
seq: 0, // 区块序号(用于区块高度查询)
userName: '', // 上链用户名称
dataLinkCode: '', // 数据链码
ruleValue: [ // 根据ruleList显示的内容
{
ruleId: '', // 字段ID
value: '' // 显示值
}
],
ciphertext: '' // 密文
}
/**
* ****** 链表关联数据返回实体集 ******
*
* 返回结果思路
* 根据链表ID查出当前链表
* 根据链表ID查出关联合约list(关联合约表)
* 根据每个合约ID查出规则List(关联合约规则list)
* 根据每个合约ID查出与链表ID相关的链列表(关联链list)
*/
export const chainRelation = [ // 第一层分代
{
generation: [ // 第二层分合约
{
contractId: '合约Id', // 合约Id
contractName: '合约名称', // 合约名称
releaseAvatar: '合约发布方头像', // 合约发布方头像
releaseName: '合约发布方名称', // 合约发布方名称
ruleList: [], // 合约规则(关联合约规则表)
chainList: chain // (关联链表)
}
]
}
]
/**
* ****** 字典表 ******
* 接口: api/dic/List
* 参数: params
* params = {
* type: '', 合约类型(contractType) 联盟用户(allianceUsers) 用户类型(userType)字段类型(fieldType)资料类型(dataType)
* }
* 返回实体+数据
*/
export const dicList = [
{
id: 0,
key: 'DataSpecification',
value: '数据规范',
sort: 0,
pid: null,
type: 'contractType'
},
{
id: 1,
key: 'InfoRecord',
value: '资料备案',
sort: 1,
pid: null,
type: 'contractType'
},
{
id: 2,
key: '0',
value: '中药材种养殖',
sort: 0,
pid: null,
type: 'allianceUsers'
},
{
id: 3,
key: '1',
value: '中药饮片加工',
sort: 1,
pid: null,
type: 'allianceUsers'
},
{
id: 4,
key: '2',
value: '药材经销商',
sort: 2,
pid: null,
type: 'allianceUsers'
},
{
id: 5,
key: '3',
value: '第三方服务机构',
sort: 3,
pid: null,
type: 'allianceUsers'
},
{
id: 6,
key: '4',
value: '其它',
sort: 4,
pid: null,
type: 'allianceUsers'
},
{
id: 7,
key: '0',
value: '企业',
sort: 0,
pid: null,
type: 'userType'
},
{
id: 8,
key: '1',
value: '自然人',
sort: 1,
pid: null,
type: 'userType'
},
{
id: 9,
key: '2',
value: '贫困户',
sort: 2,
pid: null,
type: 'userType'
},
{
id: 10,
key: '0',
value: '字符串',
sort: 0,
pid: null,
type: 'fieldType'
},
{
id: 11,
key: '1',
value: '整数',
sort: 1,
pid: null,
type: 'fieldType'
},
{
id: 12,
key: '0',
value: '#jpg',
sort: 0,
pid: null,
type: 'dataType'
},
{
id: 13,
key: '1',
value: '#png',
sort: 1,
pid: null,
type: 'dataType'
},
{
id: 14,
key: '2',
value: '#zip',
sort: 1,
pid: null,
type: 'dataType'
}
]