修改表格操作列

This commit is contained in:
guanj
2026-01-20 14:18:41 +08:00
parent a19952b771
commit 6a112c8ae2
143 changed files with 17745 additions and 17546 deletions

View File

@@ -1,101 +1,101 @@
<template>
<div class="default-main">
<TableHeader ref="TableHeaderRef">
<template v-slot:select>
<el-form-item label="模板类型">
<el-select v-model="tableStore.table.params.type" placeholder="Select" size="large">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Memo" type="primary" @click="add">报告字典管理</el-button>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增模版</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { delTemplate } from '@/api/harmonic-boot/luckyexcel'
import { useDictData } from '@/stores/dictData'
import { ElMessage } from 'element-plus'
defineOptions({
name: 'BusinessAdministrator/ReportTemplate/ReportConfiguration'
})
const options = ([
{ value: '0', label: '监测点报告' },
{ value: '1', label: '区域报告' },
])
const tableStore: any = new TableStore({
url: '/system-boot/EventTemplate/getList',
method: 'POST',
column: [
{ field: 'name', title: '模板名称' },
{ field: 'code', title: '模板描述' },
{
title: '操作',
width: '220',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
}
},
{
name: 'del',
text: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除?'
},
click: row => {
delTemplate({ tempId: row.id, deptId: row.deptId }).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
loadCallback: () => { }
})
tableStore.table.params = {}
tableStore.table.params.type = '0'
provide('tableStore', tableStore)
const add = () => {
}
onMounted(() => {
tableStore.index()
})
</script>
<template>
<div class="default-main">
<TableHeader ref="TableHeaderRef">
<template v-slot:select>
<el-form-item label="模板类型">
<el-select v-model="tableStore.table.params.type" placeholder="Select" size="large">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Memo" type="primary" @click="add">报告字典管理</el-button>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增模版</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { delTemplate } from '@/api/harmonic-boot/luckyexcel'
import { useDictData } from '@/stores/dictData'
import { ElMessage } from 'element-plus'
defineOptions({
name: 'BusinessAdministrator/ReportTemplate/ReportConfiguration'
})
const options = ([
{ value: '0', label: '监测点报告' },
{ value: '1', label: '区域报告' },
])
const tableStore: any = new TableStore({
url: '/system-boot/EventTemplate/getList',
method: 'POST',
column: [
{ field: 'name', title: '模板名称' },
{ field: 'code', title: '模板描述' },
{
title: '操作',fixed: 'right',
width: '220',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
}
},
{
name: 'del',
text: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除?'
},
click: row => {
delTemplate({ tempId: row.id, deptId: row.deptId }).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
loadCallback: () => { }
})
tableStore.table.params = {}
tableStore.table.params.type = '0'
provide('tableStore', tableStore)
const add = () => {
}
onMounted(() => {
tableStore.index()
})
</script>

View File

@@ -1,136 +1,136 @@
<template>
<div class="default-main">
<div class="custom-table-header">
<div class="title">待审核用户</div>
<el-button :icon="Check" type="primary" @click="addRole" class="ml10">审核通过</el-button>
</div>
<Table ref="tableRef" />
</div>
</template>
<script setup lang="ts">
import { Check } from '@element-plus/icons-vue'
import { ref, onMounted, provide } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import { ElMessage } from 'element-plus'
import { checkUser } from '@/api/user-boot/user'
defineOptions({
name: 'auth/audit'
})
const tableStore = new TableStore({
showPage: false,
method: 'POST',
url: '/user-boot/user/checkUserList',
column: [
{ width: '60', type: 'checkbox' },
{ title: '名称', field: 'name' },
{ title: '登录名', field: 'loginName' },
{ title: '角色', field: 'roleName' },
{ title: '部门', field: 'deptId' },
{ title: '电话', field: 'phoneShow' },
{ title: '注册时间', field: 'registerTime' },
{ title: '类型', field: 'casualUserName' },
{ title: '状态', field: 'stateName' },
{
title: '操作',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '审核通过',
type: 'primary',
icon: 'el-icon-Check',
render: 'basicButton',
click: row => {
checkUser([row.id]).then(res => {
tableStore.index()
ElMessage.success('操作成功')
})
}
},
{
name: 'del',
title: '审核不通过',
type: 'danger',
icon: 'el-icon-Close',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定不通过该角色吗?'
},
click: row => {
ElMessage.warning('功能尚未实现')
}
}
]
}
],
loadCallback: () => {
tableStore.table.data.forEach((item: any) => {
item.deptId = item.deptId || '/'
item.phoneShow = item.phone || '/'
item.roleName = item.role.length ? item.role : '/'
switch (item.casualUser) {
case 0:
item.casualUserName = '临时用户'
break
case 1:
item.casualUserName = '长期用户'
break
default:
item.casualUserName = '/'
break
}
switch (item.state) {
case 0:
item.stateName = '注销'
break
case 1:
item.stateName = '正常'
break
case 2:
item.stateName = '锁定'
break
case 3:
item.stateName = '待审核'
break
case 4:
item.stateName = '休眠'
break
case 5:
item.stateName = '密码过期'
break
default:
item.stateName = '/'
break
}
})
}
})
tableStore.table.params.casualUser = 0
tableStore.table.params.searchState = 0
tableStore.table.params.searchValue = ''
tableStore.table.params.searchBeginTime = ''
tableStore.table.params.searchEndTime = ''
tableStore.table.params.sortBy = ''
tableStore.table.params.orderBy = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
const addRole = () => {
if (!tableStore.table.selection.length) {
ElMessage.warning('请选择用户')
return
}
checkUser(tableStore.table.selection.map((item: any) => item.id)).then(res => {
tableStore.index()
ElMessage.success('操作成功')
})
}
</script>
<template>
<div class="default-main">
<div class="custom-table-header">
<div class="title">待审核用户</div>
<el-button :icon="Check" type="primary" @click="addRole" class="ml10">审核通过</el-button>
</div>
<Table ref="tableRef" />
</div>
</template>
<script setup lang="ts">
import { Check } from '@element-plus/icons-vue'
import { ref, onMounted, provide } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import { ElMessage } from 'element-plus'
import { checkUser } from '@/api/user-boot/user'
defineOptions({
name: 'auth/audit'
})
const tableStore = new TableStore({
showPage: false,
method: 'POST',
url: '/user-boot/user/checkUserList',
column: [
{ width: '60', type: 'checkbox' },
{ title: '名称', field: 'name' },
{ title: '登录名', field: 'loginName' },
{ title: '角色', field: 'roleName' },
{ title: '部门', field: 'deptId' },
{ title: '电话', field: 'phoneShow' },
{ title: '注册时间', field: 'registerTime' },
{ title: '类型', field: 'casualUserName' },
{ title: '状态', field: 'stateName' },
{
title: '操作',fixed: 'right',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '审核通过',
type: 'primary',
icon: 'el-icon-Check',
render: 'basicButton',
click: row => {
checkUser([row.id]).then(res => {
tableStore.index()
ElMessage.success('操作成功')
})
}
},
{
name: 'del',
title: '审核不通过',
type: 'danger',
icon: 'el-icon-Close',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定不通过该角色吗?'
},
click: row => {
ElMessage.warning('功能尚未实现')
}
}
]
}
],
loadCallback: () => {
tableStore.table.data.forEach((item: any) => {
item.deptId = item.deptId || '/'
item.phoneShow = item.phone || '/'
item.roleName = item.role.length ? item.role : '/'
switch (item.casualUser) {
case 0:
item.casualUserName = '临时用户'
break
case 1:
item.casualUserName = '长期用户'
break
default:
item.casualUserName = '/'
break
}
switch (item.state) {
case 0:
item.stateName = '注销'
break
case 1:
item.stateName = '正常'
break
case 2:
item.stateName = '锁定'
break
case 3:
item.stateName = '待审核'
break
case 4:
item.stateName = '休眠'
break
case 5:
item.stateName = '密码过期'
break
default:
item.stateName = '/'
break
}
})
}
})
tableStore.table.params.casualUser = 0
tableStore.table.params.searchState = 0
tableStore.table.params.searchValue = ''
tableStore.table.params.searchBeginTime = ''
tableStore.table.params.searchEndTime = ''
tableStore.table.params.sortBy = ''
tableStore.table.params.orderBy = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
const addRole = () => {
if (!tableStore.table.selection.length) {
ElMessage.warning('请选择用户')
return
}
checkUser(tableStore.table.selection.map((item: any) => item.id)).then(res => {
tableStore.index()
ElMessage.success('操作成功')
})
}
</script>

View File

@@ -1,195 +1,195 @@
<template>
<div class="default-main">
<div class="custom-table-header">
<div class="title">部门列表</div>
<el-input
v-model="tableStore.table.params.searchValue"
style="width: 240px"
placeholder="请输入部门名称"
class="ml10"
clearable
@input="search"
/>
</div>
<Table />
<PopupForm ref="popupFormRef" @init="tableStore.index()"></PopupForm>
<PopupPoint ref="popupPointRef"></PopupPoint>
</div>
</template>
<script setup lang="ts">
import { ref, nextTick, inject, provide, watch, onMounted } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import PopupForm from './popupForm.vue'
import PopupPoint from './popupPoint.vue'
import { deleteDept, selectPid } from '@/api/user-boot/dept'
import { ElMessage, ElMessageBox } from 'element-plus'
defineOptions({
name: 'auth/department'
})
const popupFormRef = ref()
const popupPointRef = ref()
let originData: any[]
const tableStore = new TableStore({
publicHeight: 60,
showPage: false,
url: '/user-boot/dept/deptTree',
method: 'POST',
column: [
{
title: '名称',
field: 'name',
align: 'left',
width: 350,
treeNode: true
},
{ title: '区域', field: 'areaName', align: 'center' },
{
title: '类型',
field: 'type',
align: 'center',
render: 'renderFormatter',
renderFormatter: data => {
const typeArr = ['非自定义', 'web自定义', 'App自定义', 'Web测试']
return typeArr[data.type] || '/'
}
},
{
title: '描述',
field: 'remark',
align: 'center',
render: 'renderFormatter',
renderFormatter: data => {
return data.remark || '/'
}
},
{
title: '状态',
field: 'state',
align: 'center',
render: 'renderFormatter',
renderFormatter: data => {
return data.state === 1 ? '正常' : '删除'
}
},
{
title: '操作',
align: 'center',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
text: '新增',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
popupFormRef.value.open('新增部门', {
pid: row.id,
pArea: row.area
})
}
},
{
name: 'edit',
text: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
popupFormRef.value.open('编辑部门', {
...row
})
}
},
{
name: 'del',
text: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'basicButton',
click: (row: any) => {
if (row.children.length > 0) {
ElMessageBox.confirm('该部门有子部门,是否确认删除', '提示', {
confirmButtonText: '确认删除',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteDept([row.id]).then(response => {
ElMessage.success('删除成功')
tableStore.index()
})
})
} else {
ElMessageBox.confirm('是否确认删除该部门', '提示', {
confirmButtonText: '确认删除',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteDept([row.id]).then(response => {
ElMessage.success('删除成功')
tableStore.index()
})
})
}
}
},
{
name: 'edit',
text: '绑定监测点',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
disabled: (row: any) => {
return row.children.length > 0
},
click: row => {
popupPointRef.value.open( row)
}
}
]
}
],
loadCallback: () => {
originData = JSON.parse(JSON.stringify(tableStore.table.data))
tableStore.table.data.forEach((item: any) => {
item.stateName = item.state === 1 ? '正常' : '删除'
item.remark = item.remark || '/'
})
nextTick(() => {
tableStore.table.ref?.setAllTreeExpand(true)
})
}
})
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
const addMenu = () => {}
const search = () => {
tableStore.table.data = filterData(JSON.parse(JSON.stringify(originData)))
nextTick(() => {
tableStore.table.ref?.setAllTreeExpand(true)
})
}
// 过滤
const filterData = (arr: treeData[]): treeData[] => {
if (!tableStore.table.params.searchValue) {
return arr
}
return arr.filter((item: treeData) => {
if (item.name!.includes(tableStore.table.params.searchValue)) {
return true
} else if (item.children?.length > 0) {
item.children = filterData(item.children)
return item.children.length > 0
} else {
return false
}
})
}
</script>
<template>
<div class="default-main">
<div class="custom-table-header">
<div class="title">部门列表</div>
<el-input
v-model="tableStore.table.params.searchValue"
style="width: 240px"
placeholder="请输入部门名称"
class="ml10"
clearable
@input="search"
/>
</div>
<Table />
<PopupForm ref="popupFormRef" @init="tableStore.index()"></PopupForm>
<PopupPoint ref="popupPointRef"></PopupPoint>
</div>
</template>
<script setup lang="ts">
import { ref, nextTick, inject, provide, watch, onMounted } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import PopupForm from './popupForm.vue'
import PopupPoint from './popupPoint.vue'
import { deleteDept, selectPid } from '@/api/user-boot/dept'
import { ElMessage, ElMessageBox } from 'element-plus'
defineOptions({
name: 'auth/department'
})
const popupFormRef = ref()
const popupPointRef = ref()
let originData: any[]
const tableStore = new TableStore({
publicHeight: 60,
showPage: false,
url: '/user-boot/dept/deptTree',
method: 'POST',
column: [
{
title: '名称',
field: 'name',
align: 'left',
width: 350,
treeNode: true
},
{ title: '区域', field: 'areaName', align: 'center' },
{
title: '类型',
field: 'type',
align: 'center',
render: 'renderFormatter',
renderFormatter: data => {
const typeArr = ['非自定义', 'web自定义', 'App自定义', 'Web测试']
return typeArr[data.type] || '/'
}
},
{
title: '描述',
field: 'remark',
align: 'center',
render: 'renderFormatter',
renderFormatter: data => {
return data.remark || '/'
}
},
{
title: '状态',
field: 'state',
align: 'center',
render: 'renderFormatter',
renderFormatter: data => {
return data.state === 1 ? '正常' : '删除'
}
},
{
title: '操作',fixed: 'right',
align: 'center',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
text: '新增',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
popupFormRef.value.open('新增部门', {
pid: row.id,
pArea: row.area
})
}
},
{
name: 'edit',
text: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
popupFormRef.value.open('编辑部门', {
...row
})
}
},
{
name: 'del',
text: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'basicButton',
click: (row: any) => {
if (row.children.length > 0) {
ElMessageBox.confirm('该部门有子部门,是否确认删除', '提示', {
confirmButtonText: '确认删除',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteDept([row.id]).then(response => {
ElMessage.success('删除成功')
tableStore.index()
})
})
} else {
ElMessageBox.confirm('是否确认删除该部门', '提示', {
confirmButtonText: '确认删除',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteDept([row.id]).then(response => {
ElMessage.success('删除成功')
tableStore.index()
})
})
}
}
},
{
name: 'edit',
text: '绑定监测点',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
disabled: (row: any) => {
return row.children.length > 0
},
click: row => {
popupPointRef.value.open( row)
}
}
]
}
],
loadCallback: () => {
originData = JSON.parse(JSON.stringify(tableStore.table.data))
tableStore.table.data.forEach((item: any) => {
item.stateName = item.state === 1 ? '正常' : '删除'
item.remark = item.remark || '/'
})
nextTick(() => {
tableStore.table.ref?.setAllTreeExpand(true)
})
}
})
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
const addMenu = () => {}
const search = () => {
tableStore.table.data = filterData(JSON.parse(JSON.stringify(originData)))
nextTick(() => {
tableStore.table.ref?.setAllTreeExpand(true)
})
}
// 过滤
const filterData = (arr: treeData[]): treeData[] => {
if (!tableStore.table.params.searchValue) {
return arr
}
return arr.filter((item: treeData) => {
if (item.name!.includes(tableStore.table.params.searchValue)) {
return true
} else if (item.children?.length > 0) {
item.children = filterData(item.children)
return item.children.length > 0
} else {
return false
}
})
}
</script>

View File

@@ -47,7 +47,7 @@ const tableStore = new TableStore({
},
{ title: 'URL接口路径', field: 'path' },
{
title: '操作',
title: '操作',fixed: 'right',
align: 'center',
width: '180',
render: 'buttons',

View File

@@ -56,7 +56,7 @@ const tableStore = new TableStore({
render: 'icon'
},
{
title: '操作',
title: '操作',fixed: 'right',
align: 'center',
width: '180',
render: 'buttons',

View File

@@ -69,7 +69,7 @@ const tableStore = new TableStore({
}
},
{
title: '操作',
title: '操作',fixed: 'right',
align: 'center',
width: '180',
render: 'buttons',

View File

@@ -1,231 +1,231 @@
<template>
<div class="default-main">
<TableHeader>
<template v-slot:select>
<el-form-item label="用户状态">
<el-select v-model="tableStore.table.params.searchState" placeholder="选择用户状态">
<el-option
v-for="(item, index) in userState"
:label="item.label"
:key="index"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="用户类型:">
<el-select v-model="tableStore.table.params.casualUser" placeholder="选择用户类型">
<el-option
v-for="(item, index) in casualUser"
:label="item.label"
:key="index"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="关键词:">
<el-input
style="width: 240px"
v-model="tableStore.table.params.searchValue"
clearable
placeholder="仅根据用户名/登录名"
maxlength="10"
show-word-limit
/>
</el-form-item>
</template>
<template v-slot:operation>
<el-button :icon="Plus" type="primary" @click="addUser">添加</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<PopupEdit ref="popupEditRef"></PopupEdit>
<PopupPwd ref="popupPwdRef"></PopupPwd>
</div>
</template>
<script setup lang="ts">
import { Plus } from '@element-plus/icons-vue'
import { ref, onMounted, provide } from 'vue'
import { ElMessageBox, ElMessage } from 'element-plus'
import { activateUser, deluser, passwordConfirm } from '@/api/user-boot/user'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import PopupEdit from './popupEdit.vue'
import PopupPwd from './popupPwd.vue'
defineOptions({
name: 'auth/userlist'
})
const popupEditRef = ref()
const popupPwdRef = ref()
const tableStore = new TableStore({
url: '/user-boot/user/list',
method: 'POST',
column: [
{ title: '用户名称', field: 'name', minWidth: '130' },
{ title: '登录名', field: 'loginName', minWidth: '130' },
{ title: '角色', field: 'roleName', minWidth: '130' },
{ title: '部门', field: 'deptName', minWidth: '200' },
{ title: '电话', field: 'phoneShow', minWidth: '100' },
{ title: '注册时间', field: 'registerTime', minWidth: '130' },
{ title: '登录时间', field: 'loginTime', minWidth: '130' },
{ title: '类型', field: 'casualUserName', minWidth: '80' },
{
title: '状态',
field: 'state',
width: '100',
render: 'tag',
custom: {
0: 'danger',
1: 'success',
2: 'warning',
3: 'warning',
4: 'info',
5: 'danger'
},
replaceValue: {
0: '注销',
1: '正常',
2: '锁定',
3: '待审核',
4: '休眠',
5: '密码过期'
}
},
{
title: '操作',
width: '180',
render: 'buttons',
fixed: 'right',
buttons: [
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.state !== 1
},
click: row => {
popupEditRef.value.open('编辑用户', row)
}
},
{
name: 'edit',
title: '修改密码',
type: 'primary',
icon: 'el-icon-Lock',
render: 'basicButton',
disabled: row => {
return row.state !== 1
},
click: row => {
ElMessageBox.prompt('二次校验密码确认', '注销用户', {
confirmButtonText: '确认',
cancelButtonText: '取消',
inputType: 'password'
}).then(({ value }) => {
passwordConfirm(value).then(res => {
popupPwdRef.value.open(row.id)
})
})
}
},
{
name: 'edit',
title: '激活',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.state !== 2 && row.state !== 5 && row.state !== 0 && row.state !== 4
},
click: row => {
activateUser({
id: row.id
}).then(() => {
ElMessage.success('激活成功')
tableStore.index()
})
}
},
{
name: 'edit',
title: '注销',
type: 'danger',
icon: 'el-icon-SwitchButton',
render: 'basicButton',
disabled: row => {
return row.state !== 1 && row.state !== 3
},
click: row => {
ElMessageBox.prompt('二次校验密码确认', '注销用户', {
confirmButtonText: '确认',
cancelButtonText: '取消',
inputType: 'password'
}).then(({ value }) => {
passwordConfirm(value).then(res => {
deluser({
id: row.id
}).then(() => {
ElMessage.success('注销成功')
tableStore.index()
})
})
})
}
}
]
}
],
loadCallback: () => {
tableStore.table.data.forEach((item: any) => {
item.deptName = item.deptName || '/'
item.phoneShow = item.phone || '/'
item.roleName = item.role.length ? item.role : '/'
switch (item.casualUser) {
case 0:
item.casualUserName = '临时用户'
break
case 1:
item.casualUserName = '长期用户'
break
default:
item.casualUserName = '/'
break
}
})
},
resetCallback: () => {
tableStore.table.params.searchValue = ''
}
})
provide('tableStore', tableStore)
tableStore.table.params.searchState = 1
tableStore.table.params.casualUser = -1
tableStore.table.params.orderBy = ''
const userState = [
{ label: '全部', value: -1 },
{ label: '注销', value: 0 },
{ label: '正常', value: 1 },
{ label: '锁定', value: 2 },
{ label: '待审核', value: 3 },
{ label: '休眠', value: 4 },
{ label: '密码过期', value: 5 }
]
const casualUser = [
{ label: '全部', value: -1 },
{ label: '临时用户', value: 0 },
{ label: '长期用户', value: 1 }
]
onMounted(() => {
tableStore.index()
})
const addUser = () => {
popupEditRef.value.open('新增用户')
}
</script>
<template>
<div class="default-main">
<TableHeader>
<template v-slot:select>
<el-form-item label="用户状态">
<el-select v-model="tableStore.table.params.searchState" placeholder="选择用户状态">
<el-option
v-for="(item, index) in userState"
:label="item.label"
:key="index"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="用户类型:">
<el-select v-model="tableStore.table.params.casualUser" placeholder="选择用户类型">
<el-option
v-for="(item, index) in casualUser"
:label="item.label"
:key="index"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="关键词:">
<el-input
style="width: 240px"
v-model="tableStore.table.params.searchValue"
clearable
placeholder="仅根据用户名/登录名"
maxlength="10"
show-word-limit
/>
</el-form-item>
</template>
<template v-slot:operation>
<el-button :icon="Plus" type="primary" @click="addUser">添加</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<PopupEdit ref="popupEditRef"></PopupEdit>
<PopupPwd ref="popupPwdRef"></PopupPwd>
</div>
</template>
<script setup lang="ts">
import { Plus } from '@element-plus/icons-vue'
import { ref, onMounted, provide } from 'vue'
import { ElMessageBox, ElMessage } from 'element-plus'
import { activateUser, deluser, passwordConfirm } from '@/api/user-boot/user'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import PopupEdit from './popupEdit.vue'
import PopupPwd from './popupPwd.vue'
defineOptions({
name: 'auth/userlist'
})
const popupEditRef = ref()
const popupPwdRef = ref()
const tableStore = new TableStore({
url: '/user-boot/user/list',
method: 'POST',
column: [
{ title: '用户名称', field: 'name', minWidth: '130' },
{ title: '登录名', field: 'loginName', minWidth: '130' },
{ title: '角色', field: 'roleName', minWidth: '130' },
{ title: '部门', field: 'deptName', minWidth: '200' },
{ title: '电话', field: 'phoneShow', minWidth: '100' },
{ title: '注册时间', field: 'registerTime', minWidth: '130' },
{ title: '登录时间', field: 'loginTime', minWidth: '130' },
{ title: '类型', field: 'casualUserName', minWidth: '80' },
{
title: '状态',
field: 'state',
width: '100',
render: 'tag',
custom: {
0: 'danger',
1: 'success',
2: 'warning',
3: 'warning',
4: 'info',
5: 'danger'
},
replaceValue: {
0: '注销',
1: '正常',
2: '锁定',
3: '待审核',
4: '休眠',
5: '密码过期'
}
},
{
title: '操作',fixed: 'right',
width: '180',
render: 'buttons',
fixed: 'right',
buttons: [
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.state !== 1
},
click: row => {
popupEditRef.value.open('编辑用户', row)
}
},
{
name: 'edit',
title: '修改密码',
type: 'primary',
icon: 'el-icon-Lock',
render: 'basicButton',
disabled: row => {
return row.state !== 1
},
click: row => {
ElMessageBox.prompt('二次校验密码确认', '注销用户', {
confirmButtonText: '确认',
cancelButtonText: '取消',
inputType: 'password'
}).then(({ value }) => {
passwordConfirm(value).then(res => {
popupPwdRef.value.open(row.id)
})
})
}
},
{
name: 'edit',
title: '激活',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.state !== 2 && row.state !== 5 && row.state !== 0 && row.state !== 4
},
click: row => {
activateUser({
id: row.id
}).then(() => {
ElMessage.success('激活成功')
tableStore.index()
})
}
},
{
name: 'edit',
title: '注销',
type: 'danger',
icon: 'el-icon-SwitchButton',
render: 'basicButton',
disabled: row => {
return row.state !== 1 && row.state !== 3
},
click: row => {
ElMessageBox.prompt('二次校验密码确认', '注销用户', {
confirmButtonText: '确认',
cancelButtonText: '取消',
inputType: 'password'
}).then(({ value }) => {
passwordConfirm(value).then(res => {
deluser({
id: row.id
}).then(() => {
ElMessage.success('注销成功')
tableStore.index()
})
})
})
}
}
]
}
],
loadCallback: () => {
tableStore.table.data.forEach((item: any) => {
item.deptName = item.deptName || '/'
item.phoneShow = item.phone || '/'
item.roleName = item.role.length ? item.role : '/'
switch (item.casualUser) {
case 0:
item.casualUserName = '临时用户'
break
case 1:
item.casualUserName = '长期用户'
break
default:
item.casualUserName = '/'
break
}
})
},
resetCallback: () => {
tableStore.table.params.searchValue = ''
}
})
provide('tableStore', tableStore)
tableStore.table.params.searchState = 1
tableStore.table.params.casualUser = -1
tableStore.table.params.orderBy = ''
const userState = [
{ label: '全部', value: -1 },
{ label: '注销', value: 0 },
{ label: '正常', value: 1 },
{ label: '锁定', value: 2 },
{ label: '待审核', value: 3 },
{ label: '休眠', value: 4 },
{ label: '密码过期', value: 5 }
]
const casualUser = [
{ label: '全部', value: -1 },
{ label: '临时用户', value: 0 },
{ label: '长期用户', value: 1 }
]
onMounted(() => {
tableStore.index()
})
const addUser = () => {
popupEditRef.value.open('新增用户')
}
</script>

View File

@@ -1,115 +1,115 @@
<!--流程分类页面-->
<template>
<div class='default-main'>
<TableHeader>
<template v-slot:select>
<el-form-item label='流程分类'>
<el-input
v-model='tableStore.table.params.searchValue'
clearable
placeholder='请输入分类名称'
/>
</el-form-item>
</template>
<template v-slot:operation>
<el-button type='primary' class='ml10' @click='add' :icon='Plus'>新增</el-button>
</template>
</TableHeader>
<!--表格-->
<Table ref='tableRef'></Table>
<!--弹出框-->
<category-popup ref='categoryPopup' />
</div>
</template>
<script setup lang='ts'>
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref } from 'vue'
import { useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
import { Plus } from '@element-plus/icons-vue'
import CategoryPopup from '@/views/system/bpm/category/categoryPopup.vue'
import { deleteCategory } from '@/api/bpm-boot/category'
defineOptions({
name: 'bpmCategory'
})
const { push } = useRouter()
const categoryPopup = ref()
const tableStore = new TableStore({
url: '/bpm-boot/bpm/category/list',
method: 'POST',
column: [
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ title: '分类名称', field: 'name', minWidth: 130 },
{ title: '分类标识', field: 'code', minWidth: 130 },
{ title: '分类描述', field: 'description', minWidth: 170 },
{ title: '创建时间', field: 'createTime', minWidth: 170 },
{ title: '排序', field: 'sort', width: 170 },
{
title: '操作',
align: 'center',
minWidth: '150',
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'update',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
categoryPopup.value.open('修改流程分类', row)
}
},
{
name: 'update',
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
deleteCategory(row.id).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
beforeSearchFun: () => {
for (let key in tableStore.table.params) {
if (tableStore.table.params[key] === '') {
delete tableStore.table.params[key]
}
}
}
})
onMounted(() => {
// 加载数据
tableStore.index()
})
tableStore.table.params.name = ''
provide('tableStore', tableStore)
const add = () => {
categoryPopup.value.open('新增流程分类')
}
</script>
<!--流程分类页面-->
<template>
<div class='default-main'>
<TableHeader>
<template v-slot:select>
<el-form-item label='流程分类'>
<el-input
v-model='tableStore.table.params.searchValue'
clearable
placeholder='请输入分类名称'
/>
</el-form-item>
</template>
<template v-slot:operation>
<el-button type='primary' class='ml10' @click='add' :icon='Plus'>新增</el-button>
</template>
</TableHeader>
<!--表格-->
<Table ref='tableRef'></Table>
<!--弹出框-->
<category-popup ref='categoryPopup' />
</div>
</template>
<script setup lang='ts'>
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref } from 'vue'
import { useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
import { Plus } from '@element-plus/icons-vue'
import CategoryPopup from '@/views/system/bpm/category/categoryPopup.vue'
import { deleteCategory } from '@/api/bpm-boot/category'
defineOptions({
name: 'bpmCategory'
})
const { push } = useRouter()
const categoryPopup = ref()
const tableStore = new TableStore({
url: '/bpm-boot/bpm/category/list',
method: 'POST',
column: [
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ title: '分类名称', field: 'name', minWidth: 130 },
{ title: '分类标识', field: 'code', minWidth: 130 },
{ title: '分类描述', field: 'description', minWidth: 170 },
{ title: '创建时间', field: 'createTime', minWidth: 170 },
{ title: '排序', field: 'sort', width: 170 },
{
title: '操作',fixed: 'right',
align: 'center',
minWidth: '150',
render: 'buttons',
buttons: [
{
name: 'update',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
categoryPopup.value.open('修改流程分类', row)
}
},
{
name: 'update',
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
deleteCategory(row.id).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
beforeSearchFun: () => {
for (let key in tableStore.table.params) {
if (tableStore.table.params[key] === '') {
delete tableStore.table.params[key]
}
}
}
})
onMounted(() => {
// 加载数据
tableStore.index()
})
tableStore.table.params.name = ''
provide('tableStore', tableStore)
const add = () => {
categoryPopup.value.open('新增流程分类')
}
</script>

View File

@@ -1,167 +1,167 @@
<!--流程表单-->
<template>
<div class='default-main'>
<TableHeader>
<template v-slot:select>
<el-form-item label='表单名称'>
<el-input
v-model='tableStore.table.params.name'
clearable
/>
</el-form-item>
</template>
<template v-slot:operation>
<el-button type='primary' class='ml10' :icon='Plus' @click='openForm'>新增</el-button>
</template>
</TableHeader>
<!--表格-->
<Table ref='tableRef'></Table>
<!-- 预览表单对话框 -->
<el-dialog v-model="detailVisible" title="表单详情" width="800">
<form-create :option="detailData.option" :rule="detailData.rule" />
</el-dialog>
</div>
</template>
<script lang='ts' setup>
import { Plus } from '@element-plus/icons-vue'
import TableHeader from '@/components/table/header/index.vue'
import Table from '@/components/table/index.vue'
import TableStore from '@/utils/tableStore'
import { ElMessage } from 'element-plus'
import { onMounted, provide, ref, reactive,nextTick } from 'vue'
import { useRouter } from 'vue-router'
import { deleteForm, getById } from '@/api/bpm-boot/form'
import { setConfAndFields2 } from '@/utils/formCreate'
const { push } = useRouter()
defineOptions({
name: 'category'
})
const formJson = reactive({"widgetList":[],"formConfig":{"modelName":"formData","refName":"vForm","rulesName":"rules","labelWidth":80,"labelPosition":"left","size":"","labelAlign":"label-left-align","cssCode":"","customClass":"","functions":"","layoutType":"PC","jsonVersion":3,"onFormCreated":"","onFormMounted":"","onFormDataChange":"","onFormValidate":""}})
const formData = reactive({})
const optionData = reactive({})
const vfRenderRef = ref()
const render = reactive({
visible: false,
title: ''
})
const detailVisible = ref(false)
const detailData = ref({
rule: [],
option: {}
})
const tableStore = new TableStore({
url: '/bpm-boot/bpm/form/list',
method: 'POST',
column: [
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ title: '表单名称', minWidth: '160', field: 'name' },
{ title: '备注', minWidth: '140', field: 'remark' },
{ title: '状态', minWidth: '140', field: 'status',
render: 'tag',
custom: {
0: 'danger',
1: 'success',
},
replaceValue: {
0: '关闭',
1: '开启',
}
},
{ title: '排序', field: 'sort', width: 170 },
{
title: '操作',
align: 'center',
render: 'buttons',
minWidth: '230',
fixed: 'right',
buttons: [
{
name: 'view',
title: '预览',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
//首先根据id查询出详细数据然后渲染json
getById(row.id).then(res => {
nextTick(async () => {
setConfAndFields2(detailData, res.data.conf, res.data.fields)
// 弹窗打开
detailVisible.value = true
});
})
}
},
{
name: 'update',
title: '设计表单',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
// push(`/admin/form/formDesigner?id=${row.id}`)
openForm(row.id)
}
},
{
name: 'update',
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
deleteForm(row.id).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
beforeSearchFun: () => {
for (let key in tableStore.table.params) {
if (tableStore.table.params[key] === '') {
delete tableStore.table.params[key]
}
}
}
})
/** 添加/修改操作表单 */
const openForm = (id?: string) => {
const toRouter: { name: string; query?: { id: string } } = {
name: 'BpmFormEditor'
}
// 表单新建的时候id传的是event需要排除
if (typeof id === 'string') {
toRouter.query = {
id
}
}
push(toRouter)
}
tableStore.table.params.orderBy = 'desc'
tableStore.table.params.name = ''
provide('tableStore', tableStore)
onMounted(() => {
// 加载数据
tableStore.index()
})
</script>
<style scoped>
<!--流程表单-->
<template>
<div class='default-main'>
<TableHeader>
<template v-slot:select>
<el-form-item label='表单名称'>
<el-input
v-model='tableStore.table.params.name'
clearable
/>
</el-form-item>
</template>
<template v-slot:operation>
<el-button type='primary' class='ml10' :icon='Plus' @click='openForm'>新增</el-button>
</template>
</TableHeader>
<!--表格-->
<Table ref='tableRef'></Table>
<!-- 预览表单对话框 -->
<el-dialog v-model="detailVisible" title="表单详情" width="800">
<form-create :option="detailData.option" :rule="detailData.rule" />
</el-dialog>
</div>
</template>
<script lang='ts' setup>
import { Plus } from '@element-plus/icons-vue'
import TableHeader from '@/components/table/header/index.vue'
import Table from '@/components/table/index.vue'
import TableStore from '@/utils/tableStore'
import { ElMessage } from 'element-plus'
import { onMounted, provide, ref, reactive,nextTick } from 'vue'
import { useRouter } from 'vue-router'
import { deleteForm, getById } from '@/api/bpm-boot/form'
import { setConfAndFields2 } from '@/utils/formCreate'
const { push } = useRouter()
defineOptions({
name: 'category'
})
const formJson = reactive({"widgetList":[],"formConfig":{"modelName":"formData","refName":"vForm","rulesName":"rules","labelWidth":80,"labelPosition":"left","size":"","labelAlign":"label-left-align","cssCode":"","customClass":"","functions":"","layoutType":"PC","jsonVersion":3,"onFormCreated":"","onFormMounted":"","onFormDataChange":"","onFormValidate":""}})
const formData = reactive({})
const optionData = reactive({})
const vfRenderRef = ref()
const render = reactive({
visible: false,
title: ''
})
const detailVisible = ref(false)
const detailData = ref({
rule: [],
option: {}
})
const tableStore = new TableStore({
url: '/bpm-boot/bpm/form/list',
method: 'POST',
column: [
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ title: '表单名称', minWidth: '160', field: 'name' },
{ title: '备注', minWidth: '140', field: 'remark' },
{ title: '状态', minWidth: '140', field: 'status',
render: 'tag',
custom: {
0: 'danger',
1: 'success',
},
replaceValue: {
0: '关闭',
1: '开启',
}
},
{ title: '排序', field: 'sort', width: 170 },
{
title: '操作',fixed: 'right',
align: 'center',
render: 'buttons',
minWidth: '230',
buttons: [
{
name: 'view',
title: '预览',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
//首先根据id查询出详细数据然后渲染json
getById(row.id).then(res => {
nextTick(async () => {
setConfAndFields2(detailData, res.data.conf, res.data.fields)
// 弹窗打开
detailVisible.value = true
});
})
}
},
{
name: 'update',
title: '设计表单',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
// push(`/admin/form/formDesigner?id=${row.id}`)
openForm(row.id)
}
},
{
name: 'update',
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
deleteForm(row.id).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
beforeSearchFun: () => {
for (let key in tableStore.table.params) {
if (tableStore.table.params[key] === '') {
delete tableStore.table.params[key]
}
}
}
})
/** 添加/修改操作表单 */
const openForm = (id?: string) => {
const toRouter: { name: string; query?: { id: string } } = {
name: 'BpmFormEditor'
}
// 表单新建的时候id传的是event需要排除
if (typeof id === 'string') {
toRouter.query = {
id
}
}
push(toRouter)
}
tableStore.table.params.orderBy = 'desc'
tableStore.table.params.name = ''
provide('tableStore', tableStore)
onMounted(() => {
// 加载数据
tableStore.index()
})
</script>
<style scoped>
</style>

View File

@@ -1,271 +1,271 @@
<!--流程模型管理界面-->
<template>
<div class='default-main'>
<TableHeader>
<template v-slot:select>
<!-- <el-form-item label='用户'>-->
<!-- <el-select v-model='tableStore.table.params.userId' filterable clearable>-->
<!-- <el-option-->
<!-- v-for='item in userListData'-->
<!-- :key='item.id'-->
<!-- :label='item.userName'-->
<!-- :value='item.id'-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
</template>
<template v-slot:operation>
<el-button type='primary' @click='add' class='ml10' :icon='Plus'>新增模型</el-button>
</template>
</TableHeader>
<!--表格-->
<Table ref='tableRef' isGroup></Table>
<model-popup ref='modelPopup' />
<!-- 弹窗表单详情 -->
<el-dialog title='表单详情' v-model='formDetailVisible' width='800'>
<form-create :rule='formDetailPreview.rule' :option='formDetailPreview.option' />
</el-dialog>
</div>
</template>
<script setup lang='ts'>
import { Plus } from '@element-plus/icons-vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref } from 'vue'
import { useRouter } from 'vue-router'
import ModelPopup from '@/views/system/bpm/model/modelPopup.vue'
import { deleteModel, deployModel } from '@/api/bpm-boot/model'
import { getById } from '@/api/bpm-boot/form'
import { setConfAndFields2 } from '@/utils/formCreate'
import { getSignSimpleList } from '@/api/bpm-boot/sign'
defineOptions({
name: 'governSchemeHistory'
})
const { push } = useRouter()
const modelPopup = ref()
const tableStore = new TableStore({
url: '/bpm-boot/bpm/model/list',
method: 'POST',
column: [
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ title: '模型标识', field: 'key', width: 160 },
{ title: '模型名称', field: 'name', width: 160 },
{ title: '流程分类', field: 'categoryName', width: 150 },
{
title: '表单信息', field: 'formName', width: 170,
formatter: (obj: any) => {
const formType = obj.row.formType
if (formType == 20) {
return getFormNameByViewPath(obj.row.formCustomViewPath)
} else {
return obj.row.formName
}
}
},
{
title: '创建时间',
field: 'createTime',
width: 150
},
{
title: '最新部署的流程定义',
children: [
{
title: '模型版本',
width: '150',
field: 'processDefinition.version',
type: 'html',
formatter: (obj: any) => {
if (obj.row.processDefinition) {
const val = obj.row.processDefinition.version
return `<a href='javascript:void(0);' style='color: #409EFF;text-decoration: none'>v${val}</a>`
} else {
return '未部署'
}
}
},
{
title: '激活状态',
width: '150',
field: 'processDefinition.suspensionState',
// render: 'switch',
// activeValue: '1',
// inactiveValue: '0',
// onChangeField: (row: any, value) => {
// console.log(row, 444123, value)
// value == 0 ? (value = 1) : (value = 0)
// }
render: 'tag',
custom: {
2: 'danger',
1: 'success'
},
replaceValue: {
2: '关闭',
1: '开启'
}
},
{ title: '部署时间', width: '150', field: 'processDefinition.deploymentTime' }
]
},
{
title: '操作',
align: 'center',
minWidth: '200',
render: 'buttons',
fixed: 'right',
buttons: [
{
name: 'productSetting',
title: '设计流程',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
handleDesign(row.id)
}
},
{
name: 'productSetting',
title: '部署流程',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
handleDeployConfirm(row.id)
}
},
{
name: 'productSetting',
title: '表单预览',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
handleFormDetail(row.formId)
}
},
{
name: 'update',
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
deleteModel(row.id).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
beforeSearchFun: () => {
if (tableStore.table.params.addr) {
tableStore.table.params.addrStrOption = tableStore.table.params.addr.map(tempArray => tempArray.join('/'))
}
for (let key in tableStore.table.params) {
if (tableStore.table.params[key] === '') {
delete tableStore.table.params[key]
}
}
}
})
const flowInfo = ref()
onMounted(async () => {
//加载流程标识
await getSignSimpleList().then(res => {
flowInfo.value = res.data
})
// 加载数据
tableStore.index()
})
tableStore.table.params.userId = ''
provide('tableStore', tableStore)
//获取流程标识的名称
const getFormNameByViewPath = (viewPath: string) => {
const nameItem = flowInfo.value.filter(item => item.viewPath == viewPath)
if (nameItem.length > 0) {
return nameItem[0].name
} else {
return ''
}
}
//新增用户信息
const add = () => {
modelPopup.value.open('新增流程模型')
}
/** 设计流程 */
const handleDesign = (rowId: string) => {
push({
name: 'BpmModelEditor',
query: {
modelId: rowId
}
})
}
/** 发布流程 */
const handleDeployConfirm = (rowId: string) => {
try {
// 删除的二次确认
ElMessageBox.confirm('是否部署该流程?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
draggable: true,
type: 'warning'
}).then(() => {
handleDeploy(rowId)
})
.catch(() => {
})
} catch {
}
}
const handleDeploy = async (rowId: string) => {
// 发起部署
await deployModel(rowId)
ElMessage.success('部署成功')
tableStore.index()
}
/** 流程表单的详情按钮操作 */
const formDetailVisible = ref(false)
const formDetailPreview = ref({
rule: [],
option: {}
})
const handleFormDetail = async (formId: string) => {
// 设置表单
await getById(formId).then(res => {
const data = res.data
setConfAndFields2(formDetailPreview, data.conf, data.fields)
// 弹窗打开
formDetailVisible.value = true
})
}
</script>
<!--流程模型管理界面-->
<template>
<div class='default-main'>
<TableHeader>
<template v-slot:select>
<!-- <el-form-item label='用户'>-->
<!-- <el-select v-model='tableStore.table.params.userId' filterable clearable>-->
<!-- <el-option-->
<!-- v-for='item in userListData'-->
<!-- :key='item.id'-->
<!-- :label='item.userName'-->
<!-- :value='item.id'-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
</template>
<template v-slot:operation>
<el-button type='primary' @click='add' class='ml10' :icon='Plus'>新增模型</el-button>
</template>
</TableHeader>
<!--表格-->
<Table ref='tableRef' isGroup></Table>
<model-popup ref='modelPopup' />
<!-- 弹窗表单详情 -->
<el-dialog title='表单详情' v-model='formDetailVisible' width='800'>
<form-create :rule='formDetailPreview.rule' :option='formDetailPreview.option' />
</el-dialog>
</div>
</template>
<script setup lang='ts'>
import { Plus } from '@element-plus/icons-vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref } from 'vue'
import { useRouter } from 'vue-router'
import ModelPopup from '@/views/system/bpm/model/modelPopup.vue'
import { deleteModel, deployModel } from '@/api/bpm-boot/model'
import { getById } from '@/api/bpm-boot/form'
import { setConfAndFields2 } from '@/utils/formCreate'
import { getSignSimpleList } from '@/api/bpm-boot/sign'
defineOptions({
name: 'governSchemeHistory'
})
const { push } = useRouter()
const modelPopup = ref()
const tableStore = new TableStore({
url: '/bpm-boot/bpm/model/list',
method: 'POST',
column: [
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ title: '模型标识', field: 'key', width: 160 },
{ title: '模型名称', field: 'name', width: 160 },
{ title: '流程分类', field: 'categoryName', width: 150 },
{
title: '表单信息', field: 'formName', width: 170,
formatter: (obj: any) => {
const formType = obj.row.formType
if (formType == 20) {
return getFormNameByViewPath(obj.row.formCustomViewPath)
} else {
return obj.row.formName
}
}
},
{
title: '创建时间',
field: 'createTime',
width: 150
},
{
title: '最新部署的流程定义',
children: [
{
title: '模型版本',
width: '150',
field: 'processDefinition.version',
type: 'html',
formatter: (obj: any) => {
if (obj.row.processDefinition) {
const val = obj.row.processDefinition.version
return `<a href='javascript:void(0);' style='color: #409EFF;text-decoration: none'>v${val}</a>`
} else {
return '未部署'
}
}
},
{
title: '激活状态',
width: '150',
field: 'processDefinition.suspensionState',
// render: 'switch',
// activeValue: '1',
// inactiveValue: '0',
// onChangeField: (row: any, value) => {
// console.log(row, 444123, value)
// value == 0 ? (value = 1) : (value = 0)
// }
render: 'tag',
custom: {
2: 'danger',
1: 'success'
},
replaceValue: {
2: '关闭',
1: '开启'
}
},
{ title: '部署时间', width: '150', field: 'processDefinition.deploymentTime' }
]
},
{
title: '操作',fixed: 'right',
align: 'center',
minWidth: '200',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '设计流程',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
handleDesign(row.id)
}
},
{
name: 'productSetting',
title: '部署流程',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
handleDeployConfirm(row.id)
}
},
{
name: 'productSetting',
title: '表单预览',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
handleFormDetail(row.formId)
}
},
{
name: 'update',
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
deleteModel(row.id).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
beforeSearchFun: () => {
if (tableStore.table.params.addr) {
tableStore.table.params.addrStrOption = tableStore.table.params.addr.map(tempArray => tempArray.join('/'))
}
for (let key in tableStore.table.params) {
if (tableStore.table.params[key] === '') {
delete tableStore.table.params[key]
}
}
}
})
const flowInfo = ref()
onMounted(async () => {
//加载流程标识
await getSignSimpleList().then(res => {
flowInfo.value = res.data
})
// 加载数据
tableStore.index()
})
tableStore.table.params.userId = ''
provide('tableStore', tableStore)
//获取流程标识的名称
const getFormNameByViewPath = (viewPath: string) => {
const nameItem = flowInfo.value.filter(item => item.viewPath == viewPath)
if (nameItem.length > 0) {
return nameItem[0].name
} else {
return ''
}
}
//新增用户信息
const add = () => {
modelPopup.value.open('新增流程模型')
}
/** 设计流程 */
const handleDesign = (rowId: string) => {
push({
name: 'BpmModelEditor',
query: {
modelId: rowId
}
})
}
/** 发布流程 */
const handleDeployConfirm = (rowId: string) => {
try {
// 删除的二次确认
ElMessageBox.confirm('是否部署该流程?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
draggable: true,
type: 'warning'
}).then(() => {
handleDeploy(rowId)
})
.catch(() => {
})
} catch {
}
}
const handleDeploy = async (rowId: string) => {
// 发起部署
await deployModel(rowId)
ElMessage.success('部署成功')
tableStore.index()
}
/** 流程表单的详情按钮操作 */
const formDetailVisible = ref(false)
const formDetailPreview = ref({
rule: [],
option: {}
})
const handleFormDetail = async (formId: string) => {
// 设置表单
await getById(formId).then(res => {
const data = res.data
setConfAndFields2(formDetailPreview, data.conf, data.fields)
// 弹窗打开
formDetailVisible.value = true
})
}
</script>

View File

@@ -1,113 +1,113 @@
<!--流程分类页面-->
<template>
<div class="default-main">
<TableHeader>
<template v-slot:select>
<el-form-item label="标识名称">
<el-input v-model="tableStore.table.params.name" clearable placeholder="请输入名称" />
</el-form-item>
<el-form-item label="标识key">
<el-input v-model="tableStore.table.params.signKey" clearable placeholder="请输入key" />
</el-form-item>
</template>
<template v-slot:operation>
<el-button type="primary" class="ml10" @click="add" :icon="Plus">新增</el-button>
</template>
</TableHeader>
<!--表格-->
<Table ref="tableRef"></Table>
<!--弹出框-->
<sign-popup ref="signPopup" />
</div>
</template>
<script setup lang="ts">
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref } from 'vue'
import { useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
import { Plus } from '@element-plus/icons-vue'
import SignPopup from '@/views/system/bpm/sign/signPopup.vue'
import { deleteSign } from '@/api/bpm-boot/sign'
defineOptions({
name: 'bpmSign'
})
const { push } = useRouter()
const signPopup = ref()
const tableStore = new TableStore({
url: '/bpm-boot/bpmSign/list',
method: 'POST',
column: [
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ title: '标识名称', field: 'name', minWidth: 130 },
{ title: '标识key', field: 'signKey', minWidth: 130 },
{ title: '表单查看地址', field: 'viewPath', minWidth: 200 },
{ title: '创建时间', field: 'createTime', minWidth: 170 },
{ title: '排序', field: 'sort', width: 170 },
{
title: '操作',
align: 'center',
minWidth: '150',
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'update',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
signPopup.value.open('修改流程标识', row)
}
},
{
name: 'update',
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
deleteSign(row.id).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
beforeSearchFun: () => {
for (let key in tableStore.table.params) {
if (tableStore.table.params[key] === '') {
delete tableStore.table.params[key]
}
}
}
})
onMounted(() => {
// 加载数据
tableStore.index()
})
tableStore.table.params.name = ''
tableStore.table.params.signKey = ''
provide('tableStore', tableStore)
const add = () => {
signPopup.value.open('新增流程标识')
}
</script>
<!--流程分类页面-->
<template>
<div class="default-main">
<TableHeader>
<template v-slot:select>
<el-form-item label="标识名称">
<el-input v-model="tableStore.table.params.name" clearable placeholder="请输入名称" />
</el-form-item>
<el-form-item label="标识key">
<el-input v-model="tableStore.table.params.signKey" clearable placeholder="请输入key" />
</el-form-item>
</template>
<template v-slot:operation>
<el-button type="primary" class="ml10" @click="add" :icon="Plus">新增</el-button>
</template>
</TableHeader>
<!--表格-->
<Table ref="tableRef"></Table>
<!--弹出框-->
<sign-popup ref="signPopup" />
</div>
</template>
<script setup lang="ts">
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref } from 'vue'
import { useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
import { Plus } from '@element-plus/icons-vue'
import SignPopup from '@/views/system/bpm/sign/signPopup.vue'
import { deleteSign } from '@/api/bpm-boot/sign'
defineOptions({
name: 'bpmSign'
})
const { push } = useRouter()
const signPopup = ref()
const tableStore = new TableStore({
url: '/bpm-boot/bpmSign/list',
method: 'POST',
column: [
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ title: '标识名称', field: 'name', minWidth: 130 },
{ title: '标识key', field: 'signKey', minWidth: 130 },
{ title: '表单查看地址', field: 'viewPath', minWidth: 200 },
{ title: '创建时间', field: 'createTime', minWidth: 170 },
{ title: '排序', field: 'sort', width: 170 },
{
title: '操作',fixed: 'right',
align: 'center',
minWidth: '150',
render: 'buttons',
buttons: [
{
name: 'update',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
signPopup.value.open('修改流程标识', row)
}
},
{
name: 'update',
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
deleteSign(row.id).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
beforeSearchFun: () => {
for (let key in tableStore.table.params) {
if (tableStore.table.params[key] === '') {
delete tableStore.table.params[key]
}
}
}
})
onMounted(() => {
// 加载数据
tableStore.index()
})
tableStore.table.params.name = ''
tableStore.table.params.signKey = ''
provide('tableStore', tableStore)
const add = () => {
signPopup.value.open('新增流程标识')
}
</script>

View File

@@ -1,292 +1,292 @@
<template>
<TableHeader area datePicker nextFlag theCurrentTime ref="TableHeaderRef">
<!-- <template #operation>-->
<!-- <el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>-->
<!-- <el-button icon="el-icon-Delete" type="primary">删除</el-button>-->
<!-- </template>-->
</TableHeader>
<Table ref="tableRef" />
<!--弹框-->
<feedback-popup ref="feedbackPopup" />
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import FeedbackPopup from '@/views/pqs/supervise/technology/feedbackPopup.vue'
import { useRouter } from 'vue-router'
import { cancelFeedback } from '@/api/supervision-boot/leaflet'
import { useAdminInfo } from '@/stores/adminInfo'
import { useDictData } from '@/stores/dictData'
import { getFileNameAndFilePath } from '@/api/system-boot/file'
const dictData = useDictData()
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const { push } = useRouter()
const tableRef = ref()
const TableHeaderRef = ref()
const feedbackPopup = ref()
const tableStore = new TableStore({
url: '/supervision-boot/warningLeaflet/allPageData',
publicHeight: 65,
method: 'POST',
column: [
{
title: '序号',
align: 'center',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{
field: 'problemType',
title: '预告警单问题来源',
minWidth: '150',
render: 'tag',
custom: {
1: 'warning',
2: 'warning',
3: 'warning',
4: 'warning'
},
replaceValue: {
1: '技术监督计划',
2: '在线监测超标问题',
3: '用户投诉问题',
4: '试运行监测点问题'
}
},
{ field: 'dutyOrgName', title: '负责单位', minWidth: '150' },
{
field: 'leafletType',
title: '告警类型',
render: 'tag',
minWidth: '150',
custom: {
1: 'warning',
2: 'danger'
},
replaceValue: {
1: '预警单',
2: '告警单'
}
// formatter: (row: any) => {
// return row.row.leafletType == 1 ? '预警单' : '告警单'
// }
},
{ field: 'reformAdvice', title: '整改意见', minWidth: '200' },
{ field: 'leafletName', title: '单据名称', minWidth: '200' },
{
field: 'status',
title: '流程状态',
minWidth: '150',
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning',
5: 'primary'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消',
5: '新增'
}
},
{ field: 'createTime', title: '创建时间', minWidth: '150' },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',
minWidth: '220',
align: 'center',
render: 'buttons',
fixed: 'right',
buttons: [
// {
// name: 'productSetting',
// title: '发送督办单',
// type: 'primary',
// icon: 'el-icon-EditPen',
// render: 'basicButton',
// click: row => {
// // handleAudit(row.processInstanceId)
// ElMessage.warning('待打通生成管理系统接口!')
// }
// },
{
name: 'productSetting',
title: '问题反馈',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.dutyOrgId != adminInfo.$state.deptId || row.status !== 5
},
click: row => {
feedbackPopup.value.open(
'填报反馈单',
row.id,
row.status,
row.issueDetail,
row.problemPath,
row.supervisionReport,
row.reformAdvice
)
}
},
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.dutyOrgId != adminInfo.$state.deptId || !(row.status == 0)
},
disabled: row => {
return !(row.status == 0)
},
click: row => {
feedbackPopup.value.open(
'编辑',
row.id,
row.status,
row.issueDetail,
row.problemPath,
row.supervisionReport,
row.reformAdvice,
row.takeStep,
row.reportPath
)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
// deviceQuitPopup.value.open('重新发起', row)
feedbackPopup.value.open(
'重新发起告警单',
row.id,
row.status,
row.issueDetail,
row.problemPath,
row.supervisionReport,
row.reformAdvice,
row.takeStep,
row.reportPath,
row.reformAdvice
)
}
},
{
name: 'productSetting',
title: '报告下载',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.problemType != 2
},
click: row => {
window.open(row.filePath)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.currentPage = tableStore.table.params.pageNum
}
})
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelFeedback(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
/** 流程实例详情 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
query: {
id: instanceId,
historyInstanceId
}
})
}
</script>
<style scoped lang="scss"></style>
<template>
<TableHeader area datePicker nextFlag theCurrentTime ref="TableHeaderRef">
<!-- <template #operation>-->
<!-- <el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>-->
<!-- <el-button icon="el-icon-Delete" type="primary">删除</el-button>-->
<!-- </template>-->
</TableHeader>
<Table ref="tableRef" />
<!--弹框-->
<feedback-popup ref="feedbackPopup" />
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import FeedbackPopup from '@/views/pqs/supervise/technology/feedbackPopup.vue'
import { useRouter } from 'vue-router'
import { cancelFeedback } from '@/api/supervision-boot/leaflet'
import { useAdminInfo } from '@/stores/adminInfo'
import { useDictData } from '@/stores/dictData'
import { getFileNameAndFilePath } from '@/api/system-boot/file'
const dictData = useDictData()
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const { push } = useRouter()
const tableRef = ref()
const TableHeaderRef = ref()
const feedbackPopup = ref()
const tableStore = new TableStore({
url: '/supervision-boot/warningLeaflet/allPageData',
publicHeight: 65,
method: 'POST',
column: [
{
title: '序号',
align: 'center',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{
field: 'problemType',
title: '预告警单问题来源',
minWidth: '150',
render: 'tag',
custom: {
1: 'warning',
2: 'warning',
3: 'warning',
4: 'warning'
},
replaceValue: {
1: '技术监督计划',
2: '在线监测超标问题',
3: '用户投诉问题',
4: '试运行监测点问题'
}
},
{ field: 'dutyOrgName', title: '负责单位', minWidth: '150' },
{
field: 'leafletType',
title: '告警类型',
render: 'tag',
minWidth: '150',
custom: {
1: 'warning',
2: 'danger'
},
replaceValue: {
1: '预警单',
2: '告警单'
}
// formatter: (row: any) => {
// return row.row.leafletType == 1 ? '预警单' : '告警单'
// }
},
{ field: 'reformAdvice', title: '整改意见', minWidth: '200' },
{ field: 'leafletName', title: '单据名称', minWidth: '200' },
{
field: 'status',
title: '流程状态',
minWidth: '150',
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning',
5: 'primary'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消',
5: '新增'
}
},
{ field: 'createTime', title: '创建时间', minWidth: '150' },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',fixed: 'right',
minWidth: '220',
align: 'center',
render: 'buttons',
buttons: [
// {
// name: 'productSetting',
// title: '发送督办单',
// type: 'primary',
// icon: 'el-icon-EditPen',
// render: 'basicButton',
// click: row => {
// // handleAudit(row.processInstanceId)
// ElMessage.warning('待打通生成管理系统接口!')
// }
// },
{
name: 'productSetting',
title: '问题反馈',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.dutyOrgId != adminInfo.$state.deptId || row.status !== 5
},
click: row => {
feedbackPopup.value.open(
'填报反馈单',
row.id,
row.status,
row.issueDetail,
row.problemPath,
row.supervisionReport,
row.reformAdvice
)
}
},
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.dutyOrgId != adminInfo.$state.deptId || !(row.status == 0)
},
disabled: row => {
return !(row.status == 0)
},
click: row => {
feedbackPopup.value.open(
'编辑',
row.id,
row.status,
row.issueDetail,
row.problemPath,
row.supervisionReport,
row.reformAdvice,
row.takeStep,
row.reportPath
)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
// deviceQuitPopup.value.open('重新发起', row)
feedbackPopup.value.open(
'重新发起告警单',
row.id,
row.status,
row.issueDetail,
row.problemPath,
row.supervisionReport,
row.reformAdvice,
row.takeStep,
row.reportPath,
row.reformAdvice
)
}
},
{
name: 'productSetting',
title: '报告下载',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.problemType != 2
},
click: row => {
window.open(row.filePath)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.currentPage = tableStore.table.params.pageNum
}
})
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelFeedback(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
/** 流程实例详情 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
query: {
id: instanceId,
historyInstanceId
}
})
}
</script>
<style scoped lang="scss"></style>

View File

@@ -1,161 +1,161 @@
<!--待办事项列表-->
<template>
<div>
<TableHeader date-picker theCurrentTime showTimeAll showExport :showReset="false">
<template v-slot:select>
<el-form-item label='任务名称'>
<el-input v-model='tableStore.table.params.searchValue' placeholder='请输入任务名称' clearable maxlength="32" show-word-limit/>
</el-form-item>
</template>
</TableHeader>
<!--表格-->
<Table ref='tableRef'></Table>
</div>
</template>
<script setup lang='ts'>
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref, watch } from 'vue'
import { useRouter } from 'vue-router'
import { dateFormatter, formatPast2 } from '@/utils/formatTime'
defineOptions({
name: 'businessUser'
})
const props = defineProps({
height: [String, Number] ,
})
const { push, options, currentRoute } = useRouter()
const flag = ref(false)
const tableStore = new TableStore({
url: '/bpm-boot/bpm/task/doneList',
method: 'POST',
publicHeight: 65,
filename:'已办任务',
column: [
{
field: 'index',
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ title: '任务名称', field: 'processInstance.name', minWidth: 130 },
{ title: '任务内容', field: 'instanceSign', minWidth: 300 },
{ title: '发起人', field: 'processInstance.startUser.name', minWidth: 130 },
{ title: '发起部门', field: 'processInstance.startUser.deptName', minWidth: 130 },
{ title: '当前任务', field: 'name', minWidth: 130 },
{ title: '发起时间', field: 'createTime', minWidth: 170 },
{ title: '结束时间', field: 'endTime', minWidth: 170 },
{
title: '审批状态',
field: 'status',
minWidth: 130,
render: 'tag',
custom: {
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{ title: '审批建议', field: 'reason', minWidth: 150 },
{
title: '耗时',
field: 'durationInMillis',
minWidth: 150,
formatter: (obj: any) => {
return formatPast2(obj.row.durationInMillis)
}
},
{
title: '操作',
align: 'center',
minWidth: '150',
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
flag.value = true
handleAudit(row.processInstance.id, row.historyInstanceId)
}
}
]
}
],
beforeSearchFun: () => {
},
exportProcessingData: () => {
tableStore.table.allData = tableStore.table.allData.filter(item => {
item.status =
item.status == 0
? '待提交审批'
: item.status == 1
? '审批中'
: item.status == 2
? '审批通过'
: item.status == 3
? '审批不通过'
: '已取消'
return item
})
}
})
onMounted(() => {
// 加载数据
tableStore.index()
setTimeout(() => {
if (props.height) {
tableStore.table.height = props.height
}
},0)
})
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
/** 处理审批按钮 */
const handleAudit = (instanceId: string, historyInstanceId: string) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
</script>
<!--待办事项列表-->
<template>
<div>
<TableHeader date-picker theCurrentTime showTimeAll showExport :showReset="false">
<template v-slot:select>
<el-form-item label='任务名称'>
<el-input v-model='tableStore.table.params.searchValue' placeholder='请输入任务名称' clearable maxlength="32" show-word-limit/>
</el-form-item>
</template>
</TableHeader>
<!--表格-->
<Table ref='tableRef'></Table>
</div>
</template>
<script setup lang='ts'>
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref, watch } from 'vue'
import { useRouter } from 'vue-router'
import { dateFormatter, formatPast2 } from '@/utils/formatTime'
defineOptions({
name: 'businessUser'
})
const props = defineProps({
height: [String, Number] ,
})
const { push, options, currentRoute } = useRouter()
const flag = ref(false)
const tableStore = new TableStore({
url: '/bpm-boot/bpm/task/doneList',
method: 'POST',
publicHeight: 65,
filename:'已办任务',
column: [
{
field: 'index',
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ title: '任务名称', field: 'processInstance.name', minWidth: 130 },
{ title: '任务内容', field: 'instanceSign', minWidth: 300 },
{ title: '发起人', field: 'processInstance.startUser.name', minWidth: 130 },
{ title: '发起部门', field: 'processInstance.startUser.deptName', minWidth: 130 },
{ title: '当前任务', field: 'name', minWidth: 130 },
{ title: '发起时间', field: 'createTime', minWidth: 170 },
{ title: '结束时间', field: 'endTime', minWidth: 170 },
{
title: '审批状态',
field: 'status',
minWidth: 130,
render: 'tag',
custom: {
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{ title: '审批建议', field: 'reason', minWidth: 150 },
{
title: '耗时',
field: 'durationInMillis',
minWidth: 150,
formatter: (obj: any) => {
return formatPast2(obj.row.durationInMillis)
}
},
{
title: '操作',fixed: 'right',
align: 'center',
minWidth: '150',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
flag.value = true
handleAudit(row.processInstance.id, row.historyInstanceId)
}
}
]
}
],
beforeSearchFun: () => {
},
exportProcessingData: () => {
tableStore.table.allData = tableStore.table.allData.filter(item => {
item.status =
item.status == 0
? '待提交审批'
: item.status == 1
? '审批中'
: item.status == 2
? '审批通过'
: item.status == 3
? '审批不通过'
: '已取消'
return item
})
}
})
onMounted(() => {
// 加载数据
tableStore.index()
setTimeout(() => {
if (props.height) {
tableStore.table.height = props.height
}
},0)
})
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
/** 处理审批按钮 */
const handleAudit = (instanceId: string, historyInstanceId: string) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
</script>

View File

@@ -1,186 +1,186 @@
<!--待办事项列表-->
<template>
<div>
<TableHeader date-picker theCurrentTime showTimeAll showExport :showReset="false">
<template v-slot:select>
<el-form-item label="任务名称">
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入任务名称" clearable
maxlength="32" show-word-limit></el-input>
</el-form-item>
</template>
</TableHeader>
<!--表格-->
<Table ref="tableRef"></Table>
</div>
</template>
<script setup lang="ts">
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref, watch } from 'vue'
import { formatDate, formatPast2 } from '@/utils/formatTime'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const categoryOptionList = dictData.getBasicData('flow_category')
const props = defineProps({
height: [String, Number],
})
defineOptions({
name: 'businessUser'
})
const { push, options, currentRoute } = useRouter()
const flag = ref(false)
const tableStore = new TableStore({
url: '/bpm-boot/bpm/processInstance/myPage',
method: 'POST',
publicHeight: 65,
filename:'我发起的',
column: [
{
field: 'index',
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ title: '任务名称', field: 'name', minWidth: 130 },
{ title: '任务内容', field: 'instanceSign', minWidth: 300 },
{
title: '流程分类',
field: 'category',
minWidth: 130,
formatter: (row: any) => {
return categoryOptionList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'status',
title: '流程状态',
render: 'tag',
minWidth: 130,
custom: {
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{ title: '发起时间', field: 'startTime', minWidth: 140 },
{ title: '结束时间', field: 'endTime', minWidth: 140 },
{
title: '耗时',
field: 'durationInMillis',
minWidth: 130,
formatter: (obj: any) => {
const millis = obj.row.durationInMillis
return millis > 0 ? formatPast2(millis) : ''
}
},
{
title: '当前审批任务',
field: 'tasks',
minWidth: 140,
formatter: (obj: any) => {
const tasks = obj.row.tasks
if (tasks) {
return tasks[0].name
} else {
return ''
}
// return millis > 0 ? formatPast2(millis) : '--'
}
},
{
title: '操作',
align: 'center',
minWidth: '180',
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
flag.value = true
handleAudit(row.id, row.historyInstanceId)
}
}
]
}
],
beforeSearchFun: () => {
// for (let key in tableStore.table.params) {
// if (tableStore.table.params[key] === '') {
// delete tableStore.table.params[key]
// }
// }
},
exportProcessingData: () => {
tableStore.table.allData = tableStore.table.allData.filter(item => {
item.status =
item.status == 0
? '待提交审批'
: item.status == 1
? '审批中'
: item.status == 2
? '审批通过'
: item.status == 3
? '审批不通过'
: '已取消'
return item
})
}
})
onMounted(() => {
// 加载数据
tableStore.index()
setTimeout(() => {
if (props.height) {
tableStore.table.height = props.height
}
}, 0)
})
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
/** 处理审批按钮 */
const handleAudit = (instanceId: string, historyInstanceId: string) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
</script>
<!--待办事项列表-->
<template>
<div>
<TableHeader date-picker theCurrentTime showTimeAll showExport :showReset="false">
<template v-slot:select>
<el-form-item label="任务名称">
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入任务名称" clearable
maxlength="32" show-word-limit></el-input>
</el-form-item>
</template>
</TableHeader>
<!--表格-->
<Table ref="tableRef"></Table>
</div>
</template>
<script setup lang="ts">
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref, watch } from 'vue'
import { formatDate, formatPast2 } from '@/utils/formatTime'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const categoryOptionList = dictData.getBasicData('flow_category')
const props = defineProps({
height: [String, Number],
})
defineOptions({
name: 'businessUser'
})
const { push, options, currentRoute } = useRouter()
const flag = ref(false)
const tableStore = new TableStore({
url: '/bpm-boot/bpm/processInstance/myPage',
method: 'POST',
publicHeight: 65,
filename:'我发起的',
column: [
{
field: 'index',
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ title: '任务名称', field: 'name', minWidth: 130 },
{ title: '任务内容', field: 'instanceSign', minWidth: 300 },
{
title: '流程分类',
field: 'category',
minWidth: 130,
formatter: (row: any) => {
return categoryOptionList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'status',
title: '流程状态',
render: 'tag',
minWidth: 130,
custom: {
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{ title: '发起时间', field: 'startTime', minWidth: 140 },
{ title: '结束时间', field: 'endTime', minWidth: 140 },
{
title: '耗时',
field: 'durationInMillis',
minWidth: 130,
formatter: (obj: any) => {
const millis = obj.row.durationInMillis
return millis > 0 ? formatPast2(millis) : ''
}
},
{
title: '当前审批任务',
field: 'tasks',
minWidth: 140,
formatter: (obj: any) => {
const tasks = obj.row.tasks
if (tasks) {
return tasks[0].name
} else {
return ''
}
// return millis > 0 ? formatPast2(millis) : '--'
}
},
{
title: '操作',fixed: 'right',
align: 'center',
minWidth: '180',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
flag.value = true
handleAudit(row.id, row.historyInstanceId)
}
}
]
}
],
beforeSearchFun: () => {
// for (let key in tableStore.table.params) {
// if (tableStore.table.params[key] === '') {
// delete tableStore.table.params[key]
// }
// }
},
exportProcessingData: () => {
tableStore.table.allData = tableStore.table.allData.filter(item => {
item.status =
item.status == 0
? '待提交审批'
: item.status == 1
? '审批中'
: item.status == 2
? '审批通过'
: item.status == 3
? '审批不通过'
: '已取消'
return item
})
}
})
onMounted(() => {
// 加载数据
tableStore.index()
setTimeout(() => {
if (props.height) {
tableStore.table.height = props.height
}
}, 0)
})
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
/** 处理审批按钮 */
const handleAudit = (instanceId: string, historyInstanceId: string) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
</script>

View File

@@ -75,7 +75,7 @@ const tableStore = new TableStore({
}
},
{
title: '操作',
title: '操作',fixed: 'right',
align: 'center',
minWidth: 100,
render: 'buttons',

View File

@@ -1,166 +1,166 @@
<template>
<div class="default-main">
<div>
<TableHeader ref="TableHeaderRef">
<template #select>
<el-form-item label="icd名称">
<el-input
v-model="tableStore.table.params.searchValue"
maxlength="32"
show-word-limit
clearable
placeholder="请输入任务名称"
/>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
</div>
<!-- 新增 -->
<taskForm ref="taskFormRef" v-if="taskFormFlag" @submit="tableStore.index()" />
<!-- 补招 -->
<el-dialog v-model="dialogVisible" title="选择补招时间" width="500">
<el-date-picker
v-model="formDate.date"
type="date"
value-format="YYYY-MM-DD"
placeholder="选择日期"
></el-date-picker>
<template #footer>
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="okRun">确认</el-button>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import taskForm from './form.vue'
import { downloadFile } from '@/api/system-boot/file'
import { ElMessage, ElMessageBox, ElDatePicker } from 'element-plus'
import { timerRun, runTimer, deleteTimer, stop, start } from '@/api/system-boot/csDictData'
import { delIcdPath } from '@/api/device-boot/icd'
defineOptions({
name: 'icd'
})
const formDate = ref({
date: '',
id: ''
})
const taskFormRef = ref()
const dialogVisible = ref(false)
const taskFormFlag = ref(false)
const tableStore: any = new TableStore({
url: '/device-boot/icd/pageIcdList',
method: 'POST',
// isWebPaging: true,
column: [
{
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'name', title: 'icd名称' },
{ field: 'path', title: 'icd路径', minWidth: 250 },
{ field: 'createBy', title: '创建人' },
{ field: 'createTime', title: '创建时间' },
{ field: 'updateBy', title: '修改人' },
{ field: 'updateTime', title: '修改时间' },
{
title: '操作',
width: '220',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: async row => {
taskFormFlag.value = true
setTimeout(() => {
taskFormRef.value.open('编辑icd文件', row)
}, 10)
}
},
{
name: 'edit',
title: '下载',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: async row => {
downloadFile({ filePath: row.path }).then(res => {
let blob = new Blob([res], {
type: 'application/xml'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = row.name
document.body.appendChild(link)
link.click()
link.remove()
})
}
},
{
name: 'del',
text: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除?'
},
click: row => {
delIcdPath([row.id]).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
loadCallback: () => {
taskFormFlag.value = false
}
})
tableStore.table.params.searchValue = ''
tableStore.table.params.searchState = ''
provide('tableStore', tableStore)
const add = () => {
taskFormFlag.value = true
setTimeout(() => {
taskFormRef.value.open('新增icd文件')
}, 10)
}
const okRun = () => {
runTimer(formDate.value).then(res => {
ElMessage.success('操作成功')
dialogVisible.value = false
tableStore.index()
})
}
onMounted(() => {
tableStore.index()
})
</script>
<template>
<div class="default-main">
<div>
<TableHeader ref="TableHeaderRef">
<template #select>
<el-form-item label="icd名称">
<el-input
v-model="tableStore.table.params.searchValue"
maxlength="32"
show-word-limit
clearable
placeholder="请输入任务名称"
/>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
</div>
<!-- 新增 -->
<taskForm ref="taskFormRef" v-if="taskFormFlag" @submit="tableStore.index()" />
<!-- 补招 -->
<el-dialog v-model="dialogVisible" title="选择补招时间" width="500">
<el-date-picker
v-model="formDate.date"
type="date"
value-format="YYYY-MM-DD"
placeholder="选择日期"
></el-date-picker>
<template #footer>
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="okRun">确认</el-button>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import taskForm from './form.vue'
import { downloadFile } from '@/api/system-boot/file'
import { ElMessage, ElMessageBox, ElDatePicker } from 'element-plus'
import { timerRun, runTimer, deleteTimer, stop, start } from '@/api/system-boot/csDictData'
import { delIcdPath } from '@/api/device-boot/icd'
defineOptions({
name: 'icd'
})
const formDate = ref({
date: '',
id: ''
})
const taskFormRef = ref()
const dialogVisible = ref(false)
const taskFormFlag = ref(false)
const tableStore: any = new TableStore({
url: '/device-boot/icd/pageIcdList',
method: 'POST',
// isWebPaging: true,
column: [
{
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'name', title: 'icd名称' },
{ field: 'path', title: 'icd路径', minWidth: 250 },
{ field: 'createBy', title: '创建人' },
{ field: 'createTime', title: '创建时间' },
{ field: 'updateBy', title: '修改人' },
{ field: 'updateTime', title: '修改时间' },
{
title: '操作',fixed: 'right',
width: '220',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: async row => {
taskFormFlag.value = true
setTimeout(() => {
taskFormRef.value.open('编辑icd文件', row)
}, 10)
}
},
{
name: 'edit',
title: '下载',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: async row => {
downloadFile({ filePath: row.path }).then(res => {
let blob = new Blob([res], {
type: 'application/xml'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = row.name
document.body.appendChild(link)
link.click()
link.remove()
})
}
},
{
name: 'del',
text: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除?'
},
click: row => {
delIcdPath([row.id]).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
loadCallback: () => {
taskFormFlag.value = false
}
})
tableStore.table.params.searchValue = ''
tableStore.table.params.searchState = ''
provide('tableStore', tableStore)
const add = () => {
taskFormFlag.value = true
setTimeout(() => {
taskFormRef.value.open('新增icd文件')
}, 10)
}
const okRun = () => {
runTimer(formDate.value).then(res => {
ElMessage.success('操作成功')
dialogVisible.value = false
tableStore.index()
})
}
onMounted(() => {
tableStore.index()
})
</script>

View File

@@ -1,155 +1,155 @@
<template>
<div class="default-main">
<div>
<TableHeader ref="TableHeaderRef">
<template #select>
<el-form-item label="终端型号名称">
<el-input
v-model="tableStore.table.params.searchValue"
maxlength="32"
show-word-limit
clearable
placeholder="请输入任务名称"
/>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
</div>
<!-- 新增 -->
<taskForm ref="taskFormRef" v-if="taskFormFlag" @submit="tableStore.index()" />
<!-- 补招 -->
<el-dialog v-model="dialogVisible" title="选择补招时间" width="500">
<el-date-picker
v-model="formDate.date"
type="date"
value-format="YYYY-MM-DD"
placeholder="选择日期"
></el-date-picker>
<template #footer>
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="okRun">确认</el-button>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import taskForm from './form.vue'
import { delDevType } from '@/api/device-boot/modelManage'
import { getIcdList } from '@/api/device-boot/icd'
import { ElMessage, ElMessageBox, ElDatePicker } from 'element-plus'
import { timerRun, runTimer, deleteTimer, stop, start } from '@/api/system-boot/csDictData'
defineOptions({
name: 'modelManage'
})
const formDate = ref({
date: '',
id: ''
})
const options = ref([])
const taskFormFlag = ref(false)
const taskFormRef = ref()
const dialogVisible = ref(false)
const tableStore: any = new TableStore({
url: '/device-boot/devType/pageDevTypeList',
method: 'POST',
// isWebPaging: true,
column: [
{
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'name', title: '型号名称' },
{
field: 'icdId',
title: '关联icd',
formatter: (row: any) => {
return options.value.find((item: any) => item.id === row.cellValue)?.name
}
},
{ field: 'createBy', title: '创建人' },
{ field: 'createTime', title: '创建时间' },
{ field: 'updateBy', title: '修改人' },
{ field: 'updateTime', title: '修改时间' },
{
title: '操作',
width: '220',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: async row => {
taskFormFlag.value = true
setTimeout(() => {
taskFormRef.value.open('编辑终端型号', row)
}, 10)
}
},
{
name: 'del',
text: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除?'
},
click: row => {
delDevType([row.id]).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
loadCallback: () => {
taskFormFlag.value = true
}
})
tableStore.table.params.searchValue = ''
tableStore.table.params.searchState = ''
provide('tableStore', tableStore)
const add = () => {
taskFormFlag.value = true
setTimeout(() => {
taskFormRef.value.open('新增终端型号')
}, 10)
}
const okRun = () => {
runTimer(formDate.value).then(res => {
ElMessage.success('操作成功')
dialogVisible.value = false
tableStore.index()
})
}
onMounted(() => {
getIcdList().then(res => {
options.value = res.data
})
tableStore.index()
})
</script>
<template>
<div class="default-main">
<div>
<TableHeader ref="TableHeaderRef">
<template #select>
<el-form-item label="终端型号名称">
<el-input
v-model="tableStore.table.params.searchValue"
maxlength="32"
show-word-limit
clearable
placeholder="请输入任务名称"
/>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
</div>
<!-- 新增 -->
<taskForm ref="taskFormRef" v-if="taskFormFlag" @submit="tableStore.index()" />
<!-- 补招 -->
<el-dialog v-model="dialogVisible" title="选择补招时间" width="500">
<el-date-picker
v-model="formDate.date"
type="date"
value-format="YYYY-MM-DD"
placeholder="选择日期"
></el-date-picker>
<template #footer>
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="okRun">确认</el-button>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import taskForm from './form.vue'
import { delDevType } from '@/api/device-boot/modelManage'
import { getIcdList } from '@/api/device-boot/icd'
import { ElMessage, ElMessageBox, ElDatePicker } from 'element-plus'
import { timerRun, runTimer, deleteTimer, stop, start } from '@/api/system-boot/csDictData'
defineOptions({
name: 'modelManage'
})
const formDate = ref({
date: '',
id: ''
})
const options = ref([])
const taskFormFlag = ref(false)
const taskFormRef = ref()
const dialogVisible = ref(false)
const tableStore: any = new TableStore({
url: '/device-boot/devType/pageDevTypeList',
method: 'POST',
// isWebPaging: true,
column: [
{
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'name', title: '型号名称' },
{
field: 'icdId',
title: '关联icd',
formatter: (row: any) => {
return options.value.find((item: any) => item.id === row.cellValue)?.name
}
},
{ field: 'createBy', title: '创建人' },
{ field: 'createTime', title: '创建时间' },
{ field: 'updateBy', title: '修改人' },
{ field: 'updateTime', title: '修改时间' },
{
title: '操作',fixed: 'right',
width: '220',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: async row => {
taskFormFlag.value = true
setTimeout(() => {
taskFormRef.value.open('编辑终端型号', row)
}, 10)
}
},
{
name: 'del',
text: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除?'
},
click: row => {
delDevType([row.id]).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
loadCallback: () => {
taskFormFlag.value = true
}
})
tableStore.table.params.searchValue = ''
tableStore.table.params.searchState = ''
provide('tableStore', tableStore)
const add = () => {
taskFormFlag.value = true
setTimeout(() => {
taskFormRef.value.open('新增终端型号')
}, 10)
}
const okRun = () => {
runTimer(formDate.value).then(res => {
ElMessage.success('操作成功')
dialogVisible.value = false
tableStore.index()
})
}
onMounted(() => {
getIcdList().then(res => {
options.value = res.data
})
tableStore.index()
})
</script>

View File

@@ -51,7 +51,7 @@ const tableStore: any = new TableStore({
}
},
{
title: '操作',
title: '操作',fixed: 'right',
width: '220',
render: 'buttons',
buttons: [

View File

@@ -1,206 +1,206 @@
<template>
<div class="default-main">
<div>
<TableHeader ref="TableHeaderRef">
<template #select>
<el-form-item label="任务名称">
<el-input v-model="tableStore.table.params.searchValue" maxlength="32" show-word-limit clearable
placeholder="请输入任务名称" />
</el-form-item>
<el-form-item label="任务状态:">
<el-select v-model="tableStore.table.params.searchState" clearable placeholder="请选择任务状态">
<el-option label="运行" :value="1"></el-option>
<el-option label="停止" :value="2"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增定时任务</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
</div>
<!-- 新增 -->
<taskForm ref="taskFormRef" @submit="tableStore.index()" />
<!-- 补招 -->
<el-dialog v-model="dialogVisible" title="选择补招时间" width="500">
<el-date-picker v-model="formDate.date" type="date" value-format="YYYY-MM-DD" placeholder="选择日期">
</el-date-picker>
<template #footer>
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="okRun">
确认
</el-button>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import taskForm from '@/views/system/scheduledTasks/form.vue'
import { formatDate } from '@/utils/formatTime'
import { ElMessage, ElMessageBox, ElDatePicker } from 'element-plus'
import { timerRun, runTimer, deleteTimer, stop, start } from '@/api/system-boot/csDictData'
defineOptions({
name: 'system-boot/sysConfig/timer'
})
const formDate = ref({
date: '',
id: ''
})
const taskFormRef = ref()
const dialogVisible = ref(false)
const selectedTime = ref('')
const tableStore: any = new TableStore({
url: '/system-boot/timer/list',
method: 'POST',
isWebPaging: true,
column: [
{ field: 'timerName', title: '任务名称', },
{ field: 'actionClass', title: '任务执行器' },
{ field: 'cron', title: '定时任务表达式' },
{ field: 'remark', title: '备注' },
// {
// field: 'jobStatus', title: '状态', width: '100',
// render: 'tag',
// custom: {
// 0: 'danger',
// 1: 'success',
// 2: 'danger'
// },
// replaceValue: {
// 0: '未启动',
// 1: '运行中',
// 2: '未启动',
// }
// },
{
title: '状态',
render: 'switch',
width: 100,
field: 'jobStatus',
activeText: '运行中',
activeValue: '1',
inactiveText: '未启动',
inactiveValue: '2',
onChangeField: (row: any, value: any) => {
if (row.jobStatus == 1) {
stop({ id: row.id }).then(res => {
ElMessage.success(res.message)
tableStore.index()
})
}else{
start({ id: row.id }).then(res => {
ElMessage.success(res.message)
tableStore.index()
})
}
}
},
{ field: 'sort', title: '排序', width: '80' },
{
title: '操作',
width: '220',
render: 'buttons',
buttons: [
{
name: 'primary',
title: '执行',
type: 'primary',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'primary',
title: '是否确认执行该定时任务'
},
click: row => {
timerRun({ id: row.id }).then(res => {
ElMessage.success('执行成功')
tableStore.index()
})
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: async row => {
taskFormRef.value.open('编辑定时任务', row)
}
},
{
name: 'edit',
title: '补招',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: async row => {
formDate.value.date = formatDate(new Date(), 'YYYY-MM-DD')
formDate.value.id = row.id
dialogVisible.value = true
}
},
{
name: 'del',
text: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除?'
},
click: row => {
deleteTimer([row.id]).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
},
]
}
],
loadCallback: () => { }
})
tableStore.table.params.searchValue = ''
tableStore.table.params.searchState = ''
provide('tableStore', tableStore)
const add = () => {
setTimeout(() => {
taskFormRef.value.open('新增定时任务')
}, 10)
}
const okRun = () => {
runTimer(formDate.value).then(res => {
ElMessage.success('操作成功')
dialogVisible.value = false
tableStore.index()
})
}
onMounted(() => {
tableStore.index()
})
</script>
<template>
<div class="default-main">
<div>
<TableHeader ref="TableHeaderRef">
<template #select>
<el-form-item label="任务名称">
<el-input v-model="tableStore.table.params.searchValue" maxlength="32" show-word-limit clearable
placeholder="请输入任务名称" />
</el-form-item>
<el-form-item label="任务状态:">
<el-select v-model="tableStore.table.params.searchState" clearable placeholder="请选择任务状态">
<el-option label="运行" :value="1"></el-option>
<el-option label="停止" :value="2"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增定时任务</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
</div>
<!-- 新增 -->
<taskForm ref="taskFormRef" @submit="tableStore.index()" />
<!-- 补招 -->
<el-dialog v-model="dialogVisible" title="选择补招时间" width="500">
<el-date-picker v-model="formDate.date" type="date" value-format="YYYY-MM-DD" placeholder="选择日期">
</el-date-picker>
<template #footer>
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="okRun">
确认
</el-button>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import taskForm from '@/views/system/scheduledTasks/form.vue'
import { formatDate } from '@/utils/formatTime'
import { ElMessage, ElMessageBox, ElDatePicker } from 'element-plus'
import { timerRun, runTimer, deleteTimer, stop, start } from '@/api/system-boot/csDictData'
defineOptions({
name: 'system-boot/sysConfig/timer'
})
const formDate = ref({
date: '',
id: ''
})
const taskFormRef = ref()
const dialogVisible = ref(false)
const selectedTime = ref('')
const tableStore: any = new TableStore({
url: '/system-boot/timer/list',
method: 'POST',
isWebPaging: true,
column: [
{ field: 'timerName', title: '任务名称', },
{ field: 'actionClass', title: '任务执行器' },
{ field: 'cron', title: '定时任务表达式' },
{ field: 'remark', title: '备注' },
// {
// field: 'jobStatus', title: '状态', width: '100',
// render: 'tag',
// custom: {
// 0: 'danger',
// 1: 'success',
// 2: 'danger'
// },
// replaceValue: {
// 0: '未启动',
// 1: '运行中',
// 2: '未启动',
// }
// },
{
title: '状态',
render: 'switch',
width: 100,
field: 'jobStatus',
activeText: '运行中',
activeValue: '1',
inactiveText: '未启动',
inactiveValue: '2',
onChangeField: (row: any, value: any) => {
if (row.jobStatus == 1) {
stop({ id: row.id }).then(res => {
ElMessage.success(res.message)
tableStore.index()
})
}else{
start({ id: row.id }).then(res => {
ElMessage.success(res.message)
tableStore.index()
})
}
}
},
{ field: 'sort', title: '排序', width: '80' },
{
title: '操作',fixed: 'right',
width: '220',
render: 'buttons',
buttons: [
{
name: 'primary',
title: '执行',
type: 'primary',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'primary',
title: '是否确认执行该定时任务'
},
click: row => {
timerRun({ id: row.id }).then(res => {
ElMessage.success('执行成功')
tableStore.index()
})
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: async row => {
taskFormRef.value.open('编辑定时任务', row)
}
},
{
name: 'edit',
title: '补招',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: async row => {
formDate.value.date = formatDate(new Date(), 'YYYY-MM-DD')
formDate.value.id = row.id
dialogVisible.value = true
}
},
{
name: 'del',
text: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除?'
},
click: row => {
deleteTimer([row.id]).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
},
]
}
],
loadCallback: () => { }
})
tableStore.table.params.searchValue = ''
tableStore.table.params.searchState = ''
provide('tableStore', tableStore)
const add = () => {
setTimeout(() => {
taskFormRef.value.open('新增定时任务')
}, 10)
}
const okRun = () => {
runTimer(formDate.value).then(res => {
ElMessage.success('操作成功')
dialogVisible.value = false
tableStore.index()
})
}
onMounted(() => {
tableStore.index()
})
</script>

View File

@@ -1,150 +1,150 @@
<template>
<div class="default-main">
<TableHeader select ref="TableHeaderRef">
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<formTab ref="formTabRef" v-if="show" @Cancels=";(show = false), tableStore.index()" />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { activateTheme, deleteTheme } from '@/api/system/subject/index'
import formTab from './form/index.vue'
import { ElMessage } from 'element-plus'
import { useConfig } from '@/stores/config'
import { getTheme } from '@/api/systerm'
const configStore = useConfig()
defineOptions({
name: 'user-boot/function/functionTree'
})
const formTabRef = ref()
const TableHeaderRef = ref()
const show = ref(false)
const tableStore: any = new TableStore({
url: '/system-boot/theme/getAllThemes',
method: 'GET',
column: [
{
field: 'index',
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'name', title: '主题名称' },
{ field: 'remark', title: '描述' },
{ field: 'logoUrl', title: '主题图标', render: 'image' },
{
title: '操作',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '激活 ',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
disabled: row => {
return row.active == 1
},
click: row => {
activateTheme({ id: row.id }).then(res => {
ElMessage({
message: '激活成功!',
type: 'success'
})
tableStore.index()
})
}
},
{
name: 'edit',
title: '修改 ',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
show.value = true
setTimeout(() => {
formTabRef.value.open({
text: '修改主题',
row: row
})
}, 10)
}
},
{
name: 'edit',
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
deleteTheme({ id: row.id }).then(res => {
ElMessage({
message: '删除成功!',
type: 'success'
})
tableStore.index()
})
}
}
]
}
],
loadCallback: () => {
getTheme().then(res => {
let list: any = [
'elementUiPrimary',
'tableHeaderBackground',
'tableHeaderColor',
'tableCurrent',
'menuBackground',
'menuColor',
'menuTopBarBackground',
'menuActiveBackground',
'menuActiveColor',
'headerBarTabColor',
'headerBarBackground'
]
window.localStorage.setItem('getTheme', JSON.stringify(res.data))
for (let i = 0; i < list.length; i++) {
configStore.setLayout(list[i], JSON.parse(res.data[list[i]]))
}
configStore.setLayout('elementUiPrimary', JSON.parse(res.data['elementUiPrimary']))
})
}
})
provide('tableStore', tableStore)
// 新增主题
const add = () => {
show.value = true
setTimeout(() => {
formTabRef.value.open({
text: '新增主题'
})
}, 10)
}
onMounted(() => {
tableStore.index()
})
</script>
<template>
<div class="default-main">
<TableHeader select ref="TableHeaderRef">
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<formTab ref="formTabRef" v-if="show" @Cancels=";(show = false), tableStore.index()" />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { activateTheme, deleteTheme } from '@/api/system/subject/index'
import formTab from './form/index.vue'
import { ElMessage } from 'element-plus'
import { useConfig } from '@/stores/config'
import { getTheme } from '@/api/systerm'
const configStore = useConfig()
defineOptions({
name: 'user-boot/function/functionTree'
})
const formTabRef = ref()
const TableHeaderRef = ref()
const show = ref(false)
const tableStore: any = new TableStore({
url: '/system-boot/theme/getAllThemes',
method: 'GET',
column: [
{
field: 'index',
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'name', title: '主题名称' },
{ field: 'remark', title: '描述' },
{ field: 'logoUrl', title: '主题图标', render: 'image' },
{
title: '操作',fixed: 'right',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '激活 ',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
disabled: row => {
return row.active == 1
},
click: row => {
activateTheme({ id: row.id }).then(res => {
ElMessage({
message: '激活成功!',
type: 'success'
})
tableStore.index()
})
}
},
{
name: 'edit',
title: '修改 ',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
show.value = true
setTimeout(() => {
formTabRef.value.open({
text: '修改主题',
row: row
})
}, 10)
}
},
{
name: 'edit',
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
deleteTheme({ id: row.id }).then(res => {
ElMessage({
message: '删除成功!',
type: 'success'
})
tableStore.index()
})
}
}
]
}
],
loadCallback: () => {
getTheme().then(res => {
let list: any = [
'elementUiPrimary',
'tableHeaderBackground',
'tableHeaderColor',
'tableCurrent',
'menuBackground',
'menuColor',
'menuTopBarBackground',
'menuActiveBackground',
'menuActiveColor',
'headerBarTabColor',
'headerBarBackground'
]
window.localStorage.setItem('getTheme', JSON.stringify(res.data))
for (let i = 0; i < list.length; i++) {
configStore.setLayout(list[i], JSON.parse(res.data[list[i]]))
}
configStore.setLayout('elementUiPrimary', JSON.parse(res.data['elementUiPrimary']))
})
}
})
provide('tableStore', tableStore)
// 新增主题
const add = () => {
show.value = true
setTimeout(() => {
formTabRef.value.open({
text: '新增主题'
})
}, 10)
}
onMounted(() => {
tableStore.index()
})
</script>