|
|
@@ -24,6 +24,13 @@
|
|
|
icon: 'clarity:note-edit-line',
|
|
|
onClick: handleEdit.bind(null, record),
|
|
|
},
|
|
|
+ {
|
|
|
+ label: '显隐',
|
|
|
+ tooltip: '显隐',
|
|
|
+ icon: 'ant-design:delete-outlined',
|
|
|
+ color: 'error',
|
|
|
+ onClick: handleShow.bind(null, record)
|
|
|
+ },
|
|
|
{
|
|
|
label: '删除',
|
|
|
tooltip: '删除',
|
|
|
@@ -49,14 +56,19 @@ import ToolsDrawer from './ToolsDrawer.vue';
|
|
|
import { message, Modal } from 'ant-design-vue';
|
|
|
import moment from 'moment'
|
|
|
import { session } from '/@/utils/Memory';
|
|
|
-import { getAllTools, addTools, delTools } from '/@/api/sys/mapTools';
|
|
|
+import { getAllTools, addTools, delTools, showTools } from '/@/api/sys/mapTools';
|
|
|
import { useSyncConfirm } from '/@/hooks/component/useSyncConfirm';
|
|
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
|
|
+import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
+import { h } from 'vue';
|
|
|
+import { Tag } from 'ant-design-vue';
|
|
|
+
|
|
|
|
|
|
export default defineComponent({
|
|
|
components: { BasicTable, TableAction, Button, ToolsDrawer, ExclamationCircleOutlined },
|
|
|
name: "tools",
|
|
|
setup() {
|
|
|
+ const { t } = useI18n(); //加载国际化
|
|
|
const columns = [
|
|
|
{
|
|
|
title: '分组名称',
|
|
|
@@ -64,12 +76,12 @@ export default defineComponent({
|
|
|
key: 'group',
|
|
|
align: 'center'
|
|
|
},
|
|
|
- {
|
|
|
- title: 'id',
|
|
|
- dataIndex: 'id',
|
|
|
- key: 'id',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // title: 'id',
|
|
|
+ // dataIndex: 'id',
|
|
|
+ // key: 'id',
|
|
|
+ // align: 'center'
|
|
|
+ // },
|
|
|
{
|
|
|
title: '显示名称',
|
|
|
dataIndex: 'label',
|
|
|
@@ -88,6 +100,20 @@ export default defineComponent({
|
|
|
key: 'icon',
|
|
|
align: 'center'
|
|
|
},
|
|
|
+ {
|
|
|
+ title: '状态',
|
|
|
+ dataIndex: 'show',
|
|
|
+ width: 80,
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ const status = !record.show;
|
|
|
+ const enable = ~~status === 0;
|
|
|
+ const color = enable ? 'green' : 'red';
|
|
|
+ const enableText = t('routes.common.system.tableTitleSystemEnable'); //国际化处理--启用
|
|
|
+ const stopText = t('routes.common.system.tableTitleSystemStop'); //国际化处理--停用
|
|
|
+ const text = enable ? enableText : stopText;
|
|
|
+ return h(Tag, { color: color }, () => text);
|
|
|
+ },
|
|
|
+ },
|
|
|
{
|
|
|
title: '功能',
|
|
|
dataIndex: 'action',
|
|
|
@@ -109,7 +135,7 @@ export default defineComponent({
|
|
|
cancelText: '取消',
|
|
|
onOk: (() => {
|
|
|
let param = {
|
|
|
- id:record.id
|
|
|
+ id: record.id
|
|
|
}
|
|
|
delTools(param).then(res => {
|
|
|
message.success('操作成功');
|
|
|
@@ -118,6 +144,24 @@ export default defineComponent({
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
+ const handleShow = (record) => {
|
|
|
+ Modal.confirm({
|
|
|
+ title: '隐藏提示',
|
|
|
+ icon: createVNode(ExclamationCircleOutlined),
|
|
|
+ content: '确定隐藏该工具?',
|
|
|
+ centered: true,
|
|
|
+ okText: '确定',
|
|
|
+ okType: 'danger',
|
|
|
+ cancelText: '取消',
|
|
|
+ onOk: (() => {
|
|
|
+ showTools(record).then(res => {
|
|
|
+ message.success('操作成功');
|
|
|
+ reload();
|
|
|
+ })
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
const ifShowDialog = ref(false)
|
|
|
const handleAdd = () => {
|
|
|
ifShowDialog.value = true
|
|
|
@@ -189,6 +233,7 @@ export default defineComponent({
|
|
|
},
|
|
|
});
|
|
|
return {
|
|
|
+ handleShow,
|
|
|
hasSelected,
|
|
|
ifShowDialog,
|
|
|
registerTable,
|