Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
4716008b
提交
4716008b
authored
3月 31, 2020
作者:
徐立
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增model层
上级
76b10528
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
446 行增加
和
0 行删除
+446
-0
DataObj.js
one_stop_public/models/DataObj.js
+281
-0
DataRight.js
one_stop_public/models/DataRight.js
+165
-0
没有找到文件。
one_stop_public/models/DataObj.js
0 → 100644
浏览文件 @
4716008b
import
{
apiRequest
}
from
'../utils/request'
;
const
api
=
'/DataObjApi'
;
import
{
Base16Encode
}
from
"../Base16/index"
import
baseX
from
'base-x'
var
BASE16
=
'0123456789abcdef'
var
bs16
=
baseX
(
BASE16
)
export
default
{
namespace
:
'DataObj'
,
state
:
{
list
:
[],
data
:
{
list
:
[],
pagination
:
{},
},
code
:
{
list
:
[],
pagination
:
{},
},
},
effects
:
{
*
importAnalyse
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
'/importAnalyse'
,
payload
);
if
(
!
response
)
{
yield
put
({
type
:
'nom'
});
return
;
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
)
callback
(
response
);
},
*
importDataQuery
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
'/importDataQuery'
,
payload
);
if
(
!
response
)
{
yield
put
({
type
:
'nom'
});
return
;
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
)
callback
(
response
);
},
*
importExecute
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
'/importExecute'
,
payload
);
if
(
!
response
)
{
yield
put
({
type
:
'nom'
});
return
;
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
)
callback
(
response
);
},
*
getAll
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
'/getAll'
,
payload
);
if
(
!
response
)
{
yield
put
({
type
:
'nom'
});
return
;
}
if
(
callback
)
callback
(
response
);
},
*
getStatistics
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
'/getStatistics'
,
payload
);
if
(
!
response
)
{
yield
put
({
type
:
'nom'
});
return
;
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
)
callback
(
response
);
},
*
getExportInfo
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
'/getExportInfo'
,
payload
);
if
(
!
response
)
{
yield
put
({
type
:
'nom'
});
return
;
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
)
callback
(
response
);
},
*
changeCatalogue
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
'/changeCatalogue'
,
payload
);
if
(
!
response
)
{
yield
put
({
type
:
'nom'
});
return
;
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
)
callback
(
response
);
},
*
findByCode
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
'/findByCode'
,
payload
);
if
(
!
response
)
{
yield
put
({
type
:
'nom'
});
return
;
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
)
callback
(
response
);
},
*
findByName
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
'/findByName'
,
payload
);
if
(
!
response
)
{
yield
put
({
type
:
'nom'
});
return
;
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
)
callback
(
response
);
},
*
find
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
'/find'
,
payload
);
if
(
!
response
)
{
yield
put
({
type
:
'nom'
});
return
;
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
)
callback
(
response
);
},
*
add
({
payload
,
callback
},
{
call
,
put
})
{
if
(
payload
.
sqlScript
){
payload
.
sqlScript
=
Base16Encode
(
payload
.
sqlScript
)
}
const
response
=
yield
call
(
apiRequest
,
api
+
'/add'
,
payload
);
if
(
!
response
)
{
yield
put
({
type
:
'nom'
});
return
;
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
)
callback
(
response
);
},
*
fetch
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
'/getPage'
,
payload
);
if
(
!
response
)
{
yield
put
({
type
:
'nom'
});
return
;
}
yield
put
({
type
:
'page'
,
payload
:
{
...
response
,
isMain
:
payload
.
isMain
},
});
},
*
getTableList
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
'/getTableList'
,
payload
);
if
(
!
response
)
{
yield
put
({
type
:
'nom'
});
return
;
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
)
callback
(
response
);
},
*
createTableByName
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
'/createTableByName'
,
payload
);
if
(
!
response
)
{
yield
put
({
type
:
'nom'
});
return
;
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
)
callback
(
response
);
},
*
remove
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
'/remove'
,
payload
);
if
(
!
response
)
{
yield
put
({
type
:
'nom'
});
return
;
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
)
{
callback
();
}
},
*
open
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
'/open'
,
payload
);
if
(
!
response
)
{
yield
put
({
type
:
'nom'
});
return
;
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
)
{
callback
();
}
},
*
createTabel
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
'/createTable'
,
payload
);
if
(
!
response
)
{
yield
put
({
type
:
'nom'
});
return
;
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
)
{
callback
();
}
},
},
reducers
:
{
list
(
state
,
action
)
{
return
{
...
state
,
list
:
action
.
payload
,
};
},
page
(
state
,
{
payload
})
{
if
(
payload
.
isMain
)
{
return
{
...
state
,
data
:
{
list
:
payload
.
rows
,
pagination
:
{
current
:
payload
.
pageNo
,
pageSize
:
payload
.
pageSize
,
total
:
payload
.
total
,
},
},
};
}
else
{
return
{
...
state
,
code
:
{
list
:
payload
.
rows
,
pagination
:
{
current
:
payload
.
pageNo
,
pageSize
:
payload
.
pageSize
,
total
:
payload
.
total
,
},
},
};
}
},
nom
(
state
,
action
)
{
return
{
...
state
};
},
},
};
one_stop_public/models/DataRight.js
0 → 100644
浏览文件 @
4716008b
import
{
apiRequest
}
from
"../utils/request"
;
import
{
Base16Encode
}
from
"../Base16/index"
import
baseX
from
'base-x'
var
BASE16
=
'0123456789abcdef'
var
bs16
=
baseX
(
BASE16
)
const
api
=
"/DataRightApi"
export
default
{
namespace
:
'DataRight'
,
state
:
{
list
:
[],
},
effects
:
{
*
clear
({
payload
,
callback
},
{
call
,
put
})
{
yield
put
({
type
:
'list'
,
payload
:
[],
});
if
(
callback
)
callback
();
},
*
add
({
payload
,
callback
},
{
call
,
put
})
{
if
(
payload
.
filterSql
){
payload
.
filterSql
=
Base16Encode
(
payload
.
filterSql
)
}
const
response
=
yield
call
(
apiRequest
,
api
+
"/add"
,
payload
);
if
(
!
response
){
yield
put
({
type
:
'nom'
});
return
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
)
callback
(
response
);
},
*
addBatch
({
payload
,
callback
},
{
call
,
put
})
{
if
(
payload
.
filterSql
){
payload
.
filterSql
=
Base16Encode
(
payload
.
filterSql
)
}
const
response
=
yield
call
(
apiRequest
,
api
+
"/addBatch"
,
payload
);
if
(
!
response
){
yield
put
({
type
:
'nom'
});
return
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
)
callback
(
response
);
},
*
getUserRight
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
"/getUserRight"
,
payload
);
if
(
!
response
){
yield
put
({
type
:
'nom'
});
return
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
)
callback
(
response
);
},
*
getUserColumnRight
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
"/getUserColumnRight"
,
payload
);
if
(
!
response
){
yield
put
({
type
:
'nom'
});
return
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
)
callback
(
response
);
},
*
fetch
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
"/getList"
,
payload
);
if
(
!
response
){
yield
put
({
type
:
'nom'
});
return
}
yield
put
({
type
:
'list'
,
payload
:
{
list
:
response
,
isReference
:
payload
.
isReference
},
});
if
(
callback
)
callback
(
response
)
},
*
remove
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
"/remove"
,
payload
);
if
(
!
response
){
yield
put
({
type
:
'nom'
});
return
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
){
callback
()
}
},
*
open
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
"/open"
,
payload
);
if
(
!
response
){
yield
put
({
type
:
'nom'
});
return
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
){
callback
()
}
},
*
addReference
({
payload
,
callback
},
{
call
,
put
})
{
const
response
=
yield
call
(
apiRequest
,
api
+
"/addReference"
,
payload
);
if
(
!
response
){
yield
put
({
type
:
'nom'
});
return
}
yield
put
({
type
:
'nom'
,
payload
:
response
,
});
if
(
callback
){
callback
()
}
},
},
reducers
:
{
list
(
state
,
action
)
{
if
(
action
.
payload
.
isReference
){
return
{
...
state
,
refs
:
action
.
payload
.
list
,
};
}
else
{
return
{
...
state
,
list
:
action
.
payload
.
list
,
};
}
},
page
(
state
,
{
payload
})
{
return
{
...
state
,
data
:{
list
:
payload
.
rows
,
pagination
:
{
current
:
payload
.
pageNo
,
pageSize
:
payload
.
pageSize
,
total
:
payload
.
total
,
},
}
};
},
nom
(
state
,
action
)
{
return
{...
state
};
},
},
};
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论