|
@@ -15,6 +15,11 @@
|
|
|
<TableAction
|
|
|
:actions="[
|
|
|
{
|
|
|
+ label: '激活',
|
|
|
+ ifShow: getCheckPerm('rtk-updata'),
|
|
|
+ onClick: handleActive.bind(null, record),
|
|
|
+ },
|
|
|
+ {
|
|
|
label: '编辑',
|
|
|
ifShow: getCheckPerm('rtk-updata'),
|
|
|
onClick: handleEdit.bind(null, record),
|
|
@@ -42,7 +47,7 @@
|
|
|
TableImg,
|
|
|
FormProps,
|
|
|
} from '/@/components/Table';
|
|
|
- import { rtkInfoList, rtkdelOrEdit } from '/@/api/product';
|
|
|
+ import { rtkInfoList, rtkdelOrEdit, activation } from '/@/api/product';
|
|
|
import { useModal } from '/@/components/Modal';
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
import { copyTextToClipboard } from '/@/hooks/web/useCopyToClipboard';
|
|
@@ -229,6 +234,18 @@
|
|
|
copyTextToClipboard(str)
|
|
|
createMessage.success('复制成功');
|
|
|
}
|
|
|
+ function handleActive(record) {
|
|
|
+ createConfirm({
|
|
|
+ iconType: 'warning',
|
|
|
+ title: () => h('span', '温馨提示'),
|
|
|
+ content: () => h('span', `确定要${record.status ? '禁用' : '激活'}吗?`),
|
|
|
+ onOk: async () => {
|
|
|
+ await activation({ id: record.id, status: record.status ? 0 : 1 });
|
|
|
+ reload();
|
|
|
+ createMessage.success(t('common.optSuccess'));
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
function handleEdit(record = {}) {
|
|
|
openModal(true, {
|
|
|
...record,
|
|
@@ -241,6 +258,7 @@
|
|
|
handleDelete,
|
|
|
reload,
|
|
|
register,
|
|
|
+ handleActive,
|
|
|
getCheckPerm,
|
|
|
handleEdit,
|
|
|
};
|