ecology-develop/JS/test.js

67 lines
2.0 KiB
JavaScript
Raw Normal View History

2025-04-10 10:50:46 +08:00
let enable = true;
let isRun = false;
const config = {
58: {}
}
const viewSwitch = () => {
var ids = ModeList.getCheckedID();
var customId = ModeList.getCustomID();
if (!ids || ids.length === 0) {
ModeForm.showMessage("请至少选择一条数据");
} else {
const idArrays = ids.split(',');
const count = idArrays.length;
const msg = `是否将${count}条申请更改为省级事权?`;
ModeList.showConfirm(msg, function () {
$.ajax({
url: '/api/secret/authority/change/delegateToProvincialAuthority',
type: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data: {
"ids": ids,
"customId": customId
},
async: false,
success: function (res) {
if (res.api_status && res.data) {
ModeForm.showModalMsg("系统提示", "操作完成", 3);
} else {
ModeForm.showModalMsg("系统提示", res.errormsg, 2);
}
},
error: function (error) {
ModeForm.showModalMsg("系统提示", "接口请求异常,请联系管理员处理", 2);
}
});
});
}
}
ecodeSDK.overwritePropsFnQueueMapSet('WeaTop', {
fn: (newProps) => {
if (!enable) return;
const {hash} = window.location;
if (!hash.startsWith('#/main/cube/search')) return;
if (!ModeForm) return;
const customId = ModeList.getCustomID();
;
if (!config[customId]) return;
const {Button} = antd;
if (newProps.buttons.length >= 1) newProps.buttons[0] = (
<Button type="primary" onClick={() => viewSwitch()
}> 事权变更 < /Button>);
return newProps;
},
order: 1,
desc: '事权变更按钮'
});