|
|
|
@ -1,83 +1,39 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<div class="p20">
|
|
|
|
|
<BasicTable class="ds-table" @register="registerTable" @row-dbClick="handleAudit">
|
|
|
|
|
<template #tableTitle>
|
|
|
|
|
<div class="tableTitleBox">
|
|
|
|
|
<a-tooltip placement="top" :mouseEnterDelay="0.5">
|
|
|
|
|
<template #title>
|
|
|
|
|
<span>新建</span>
|
|
|
|
|
</template>
|
|
|
|
|
<span class="ds-action-svg-btn">
|
|
|
|
|
<a-button v-repeat type="link" @click="handleCreate">
|
|
|
|
|
<img src="../../../assets/svg/infoclient/xinjian.svg" class="SvgImg" />
|
|
|
|
|
</a-button>
|
|
|
|
|
</span>
|
|
|
|
|
</a-tooltip>
|
|
|
|
|
<a-tooltip placement="top" :mouseEnterDelay="0.5">
|
|
|
|
|
<template #title>
|
|
|
|
|
<span>复制</span>
|
|
|
|
|
</template>
|
|
|
|
|
<a-button v-repeat type="link" @click="handleCopy">
|
|
|
|
|
<img src="../../../assets/svg/infoclient/fuzhi.svg" class="SvgImg" />
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-tooltip>
|
|
|
|
|
<a-tooltip placement="top" :mouseEnterDelay="0.5">
|
|
|
|
|
<template #title>
|
|
|
|
|
<span>删除</span>
|
|
|
|
|
</template>
|
|
|
|
|
<span class="ds-action-svg-btn">
|
|
|
|
|
<a-popconfirm title="确定删除当前选中数据?" ok-text="是" cancel-text="否" @confirm="handleDelete">
|
|
|
|
|
<a-button v-repeat type="link">
|
|
|
|
|
<img src="../../../assets/svg/infoclient/shanchu.svg" class="SvgImg" />
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-popconfirm>
|
|
|
|
|
</span>
|
|
|
|
|
</a-tooltip>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <a-button type="link" @click="handleCreate">
|
|
|
|
|
<span class="iconfont icon-new_document"></span>
|
|
|
|
|
添加
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-popconfirm
|
|
|
|
|
title="确定删除当前选中数据?"
|
|
|
|
|
ok-text="是"
|
|
|
|
|
cancel-text="否"
|
|
|
|
|
@confirm="handleDelete"
|
|
|
|
|
<TableButton
|
|
|
|
|
:show="{ add: null, del: null, copy: null }"
|
|
|
|
|
@add="handleCreate"
|
|
|
|
|
@del="handleDelete"
|
|
|
|
|
@copy="handleCopy"
|
|
|
|
|
>
|
|
|
|
|
<a-button type="link">
|
|
|
|
|
<span class="iconfont icon-shanchu21"></span>
|
|
|
|
|
删除
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-popconfirm> -->
|
|
|
|
|
</TableButton>
|
|
|
|
|
</template>
|
|
|
|
|
<template #bodyCell="{ column, record }">
|
|
|
|
|
<template v-if="column.key === 'action'">
|
|
|
|
|
<TableAction :actions="[
|
|
|
|
|
{
|
|
|
|
|
icon: 'clarity:note-edit-line',
|
|
|
|
|
tooltip: '编辑',
|
|
|
|
|
onClick: handleAudit.bind(null, record),
|
|
|
|
|
},
|
|
|
|
|
]" />
|
|
|
|
|
<template v-if="column.dataIndex === 'ruleType'">
|
|
|
|
|
{{ record.ruleType == 'visible' ? '可视' : (record.ruleType == 'operate' ? '可操作' : '-') }}
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="column.dataIndex == 'status'">
|
|
|
|
|
<a-tag v-if="record.status == '0'" color="success">启用</a-tag>
|
|
|
|
|
<a-tag v-else color="error">禁用</a-tag>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</BasicTable>
|
|
|
|
|
<TenantAuditStepModal @register="registerModal" @success="handleSuccess" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { defineComponent, onMounted, ref } from 'vue'
|
|
|
|
|
import { BasicTable, useTable, TableAction, SorterResult } from '/@/components/Table'
|
|
|
|
|
<script lang="ts" setup name="权限模版">
|
|
|
|
|
import { BasicTable, useTable, TableAction } from '/@/components/Table'
|
|
|
|
|
import { ApiList, ApiDel, BatchCopyDataRuleTemplate } from './api'
|
|
|
|
|
import { useModal } from '/@/components/Modal'
|
|
|
|
|
import TenantAuditStepModal from './TenantAuditStepModal.vue'
|
|
|
|
|
import { columns, searchFormSchema } from './columns'
|
|
|
|
|
import { formatParams } from '/@/hooks/web/common'
|
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'
|
|
|
|
|
const { notification } = useMessage()
|
|
|
|
|
const { createMessage } = useMessage()
|
|
|
|
|
const [registerModal, { openModal }] = useModal()
|
|
|
|
|
const [registerTable, { reload, getSelectRows, getForm, getPaginationRef }] = useTable({
|
|
|
|
|
title: '',
|
|
|
|
|
const [registerTable, { reload, getVxeSelectRows }] = useTable({
|
|
|
|
|
api: async (p) => {
|
|
|
|
|
const res: API.DataResult = await ApiList(p)
|
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
@ -98,19 +54,12 @@ const [registerTable, { reload, getSelectRows, getForm, getPaginationRef }] = us
|
|
|
|
|
useSearchForm: true,
|
|
|
|
|
showTableSetting: true,
|
|
|
|
|
bordered: true,
|
|
|
|
|
showIndexColumn: true,
|
|
|
|
|
indexColumnProps: {
|
|
|
|
|
width: 60,
|
|
|
|
|
},
|
|
|
|
|
canResize: true,
|
|
|
|
|
resizeHeightOffset: 35,
|
|
|
|
|
immediate: true,
|
|
|
|
|
actionColumn: {
|
|
|
|
|
width: 80,
|
|
|
|
|
title: '操作',
|
|
|
|
|
dataIndex: 'action',
|
|
|
|
|
fixed: 'right',
|
|
|
|
|
},
|
|
|
|
|
resizeHeightOffset: 45,
|
|
|
|
|
tableComponent: 'vxe',
|
|
|
|
|
id: '0',
|
|
|
|
|
autoHeight: window.innerHeight - 330.5
|
|
|
|
|
// rowSelection: { type: 'checkbox' },
|
|
|
|
|
// clickToRowSelect: false,
|
|
|
|
|
})
|
|
|
|
@ -127,28 +76,28 @@ function handleAudit(record: Recordable) {
|
|
|
|
|
}
|
|
|
|
|
function handleCopy() {
|
|
|
|
|
let ids = []
|
|
|
|
|
ids = getSelectRows().map((item) => {
|
|
|
|
|
ids = getVxeSelectRows().map((item) => {
|
|
|
|
|
return item.id
|
|
|
|
|
})
|
|
|
|
|
if (ids.length == 0) {
|
|
|
|
|
notification.error('请选择要复制的数据')
|
|
|
|
|
createMessage.warning('请选择要复制的数据')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
BatchCopyDataRuleTemplate({ids:ids}).then(res=>{
|
|
|
|
|
if(res.succeeded){
|
|
|
|
|
notification.success('复制成功')
|
|
|
|
|
createMessage.success('复制成功')
|
|
|
|
|
reload()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 删除
|
|
|
|
|
async function handleDelete(record: Recordable) {
|
|
|
|
|
const select = getSelectRows()
|
|
|
|
|
const select = getVxeSelectRows()
|
|
|
|
|
let ApiData: any = {
|
|
|
|
|
ids: [],
|
|
|
|
|
}
|
|
|
|
|
if (select.length === 0) {
|
|
|
|
|
notification.warning({ message: '请至少选择一条数据', duration: 3 })
|
|
|
|
|
createMessage.warning('请至少选择一条数据')
|
|
|
|
|
return false
|
|
|
|
|
} else {
|
|
|
|
|
ApiData.ids = select.map((item) => {
|
|
|
|
@ -158,19 +107,9 @@ async function handleDelete(record: Recordable) {
|
|
|
|
|
|
|
|
|
|
ApiDel(ApiData).then((res) => {
|
|
|
|
|
console.log(res)
|
|
|
|
|
notification.success({ message: res.message, duration: 3 })
|
|
|
|
|
createMessage.success(res.message)
|
|
|
|
|
reload()
|
|
|
|
|
})
|
|
|
|
|
// const res: API.DataResult = await ApiDel({
|
|
|
|
|
// id: '',
|
|
|
|
|
// ids: [record.id],
|
|
|
|
|
// })
|
|
|
|
|
// if (res.succeeded) {
|
|
|
|
|
// notification.success({ message: res.message, duration: 3 })
|
|
|
|
|
// reload()
|
|
|
|
|
// } else {
|
|
|
|
|
// notification.error({ message: res.message, duration: 3 })
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
function handleSuccess() {
|
|
|
|
|
reload()
|
|
|
|
|