123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244 |
- var fileUrl = "https://hsws.enstation.com/radar_war";
- // var fileUrl = "http://10.60.11.150:8085";
- var _header = {
- "Authorization": "Bearer " + getCookie("tzToken")
- };
- // 雷达同舟登录
- function setFileLogin(){
- $.ajax({
- url: fileUrl + "/login",
- type: "POST",
- dataType: "JSON",
- async: false,
- data:JSON.stringify({
- username: "n5cMa8laaQm+x24QXdu2+A==",
- password: "n/kedxFbY0pPAAbTPfIbZg==",
- code: null,
- uuid: "f53582934d844429a52be829a9291789"
- }),
- headers: {
- "Content-Type": "application/json"
- },
- success:function (json) {
- if(json.code == 200){
- delCookie("tzToken");
- setCookie("tzToken", json.token);
- }
- }
- })
- }
- function getUseDict(...args){
- var res = {};
- return (() => {
- args.forEach((d, index) => {
- res[d] = [];
- getAxios({
- url: fileUrl + "/system/dict/data/type/"+d,
- type:"GET"
- }, {}, _header).then(resp => {
- res[d] = resp.data.map(p => ({ label: p.dictLabel, value: p.dictValue, elTagType: p.listClass }))
- })
- })
- return res;
- })()
- }
- // 证书列表
- function getCertificateList(_data){
- let _opts = {
- url: fileUrl + "/tongzhou/certificate/certificate/list",
- type:"GET"
- };
- return getAxios(_opts, _data, _header)
- }
- // 证书单个详情
- function getCertificateDetail(_id){
- let _opts = {
- url: fileUrl + "/tongzhou/certificate/certificate/"+_id,
- type:"GET"
- };
- return getAxios(_opts, {}, _header)
- }
- // 证书单个删除
- function DelCertificate(_id){
- let _opts = {
- url: fileUrl + "/tongzhou/certificate/certificate/"+_id,
- type:"DELETE"
- };
- return getAxios(_opts, {}, _header)
- }
- // 证书编辑
- function updateCertificate(_data){
- let _opts = {
- url: fileUrl + '/tongzhou/certificate/certificate',
- type:"PUT"
- };
- _header['Content-Type'] = 'application/json;charset=utf-8';
- return postAxios(_opts, JSON.stringify(_data), _header);
- }
- // 证书新增
- function addCertificate(_data){
- let _opts = {
- url: fileUrl + '/tongzhou/certificate/certificate',
- type:"POST"
- };
- _header['Content-Type'] = 'application/json;charset=utf-8';
- return postAxios(_opts, JSON.stringify(_data), _header);
- }
- // 证书部门
- function getDeptList(){
- let _opts = {
- url: fileUrl + "/system/dept/treeselect",
- type:"GET"
- };
- return getAxios(_opts, {}, _header)
- }
- // 备件列表
- function getStorageList(_data){
- let _opts = {
- url: fileUrl + "/tongzhou/sparePart/sparePart/list",
- type:"GET"
- };
- return getAxios(_opts, _data, _header)
- }
- // 备件单个详情
- function getStorageDetail(_id){
- let _opts = {
- url: fileUrl + "/tongzhou/sparePart/sparePart/"+_id,
- type:"GET"
- };
- return getAxios(_opts, {}, _header)
- }
- // 备件编辑
- function updateStorage(_data){
- let _opts = {
- url: fileUrl + '/tongzhou/sparePart/sparePart',
- type:"PUT"
- };
- _header['Content-Type'] = 'application/json;charset=utf-8';
- return postAxios(_opts, JSON.stringify(_data), _header);
- }
- // 备件新增
- function addStorage(_data){
- let _opts = {
- url: fileUrl + '/tongzhou/sparePart/sparePart',
- type:"POST"
- };
- _header['Content-Type'] = 'application/json;charset=utf-8';
- return postAxios(_opts, JSON.stringify(_data), _header);
- }
- // 备件单个删除
- function DelStorage(_id){
- let _opts = {
- url: fileUrl + "/tongzhou/sparePart/sparePart/"+_id,
- type:"DELETE"
- };
- return getAxios(_opts, {}, _header)
- }
- // 备件出入库请求
- function setInOutOrder(_data){
- let _opts = {
- url: fileUrl + '/tongzhou/sparePartAccess/sparePartAccess',
- type:"POST"
- };
- _header['Content-Type'] = 'application/json;charset=utf-8';
- return postAxios(_opts, JSON.stringify(_data), _header);
- }
- // 备件出入库列表
- function getInOutList(_data){
- let _opts = {
- url: fileUrl + "/tongzhou/sparePartAccess/sparePartAccess/list",
- type:"GET"
- };
- return getAxios(_opts, _data, _header)
- }
- // 出入库单个记录详情
- function getInOutDetail(_id){
- let _opts = {
- url: fileUrl + "/tongzhou/sparePartAccess/sparePartAccess/"+_id,
- type:"GET"
- };
- return getAxios(_opts, {}, _header)
- }
- // 删除出入库单个记录
- function DelInOutDetail(_id){
- let _opts = {
- url: fileUrl + "/tongzhou/sparePartAccess/sparePartAccess/"+_id,
- type:"DELETE"
- };
- return getAxios(_opts, {}, _header)
- }
- // 维修记录表
- function getMaintenanceList(_data){
- let _opts = {
- url: fileUrl + "/tongzhou/MaintailRecord/MaintailRecord/list",
- type:"GET"
- };
- return getAxios(_opts, _data, _header)
- }
- // 单个维修记录
- function getMaintenanceDetail(id){
- let _opts = {
- url: fileUrl + "/tongzhou/MaintailRecord/MaintailRecord/"+id,
- type:"GET"
- };
- return getAxios(_opts, {}, _header)
- }
- // 新增维修记录
- function addMaintain(_data){
- let _opts = {
- url: fileUrl + '/tongzhou/MaintailRecord/MaintailRecord',
- type:"POST"
- };
- _header['Content-Type'] = 'application/json;charset=utf-8';
- return postAxios(_opts, JSON.stringify(_data), _header);
- }
- // 修改维修记录
- function updateMaintain(_data){
- let _opts = {
- url: fileUrl + '/tongzhou/MaintailRecord/MaintailRecord',
- type: "PUT"
- };
- _header['Content-Type'] = 'application/json;charset=utf-8';
- return postAxios(_opts, JSON.stringify(_data), _header);
- }
- // 删除单条维修记录
- function DelMaintenance(id){
- let _opts = {
- url: fileUrl + "/tongzhou/MaintailRecord/MaintailRecord/"+id,
- type:"DELETE"
- };
- return getAxios(_opts, {}, _header)
- }
- var comUrl = "https://www.enstation.com:8083/ruico/rueigao-admin"
- // 报警心跳
- function getHeartbeat(_data){
- let _opts = {
- url: fileUrl + "/facilityMonitor/facilityMonitor/list",
- type:"GET"
- };
- return getAxios(_opts, _data, _header)
- }
- // 获取心跳配置参数
- function getHeartbeatInfo(_data){
- let _opts = {
- url: fileUrl + "/facilityMonitor/facilityMonitor/getFacilityMonitorConfig",
- type:"GET"
- };
- return getAxios(_opts, {}, _header)
- }
- // 修改心跳配置参数
- function updateHeartbeatInfo(_data){
- let _opts = {
- url: fileUrl + '/facilityMonitor/facilityMonitor/updateFacilityMonitorConfig',
- type: "PUT"
- };
- _header['Content-Type'] = 'application/json;charset=utf-8';
- return postAxios(_opts, JSON.stringify(_data), _header);
- }
|