xy 2 years ago
parent 90118d2e61
commit b67084e674

@ -140,9 +140,9 @@ export default {
let per = 0 let per = 0
if (m2 !== 0) { if (m2 !== 0) {
per = ((m3 / m2) * 100).toFixed(2) per = m2 === 0 ? ((m3 / m2) * 100) : 0
} else if (m1 !== 0) { } else if (m1 !== 0) {
per = ((m3 / m1) * 100).toFixed(2) per = m1 === 0 ? ((m3 / m1) * 100) : 0
} }
return Number(per) + '%' return Number(per) + '%'
} }

@ -110,19 +110,10 @@ export default {
}, },
{ {
title: '内容', title: '内容',
key: 'data', key: 'data.title',
align: 'left', align: 'left',
'show-overflow-tooltip': true, 'show-overflow-tooltip': true,
minWidth: 200, minWidth: 200
formatter: (row, column, cellValue) => {
try {
const data = JSON.parse(cellValue)
return data.title
} catch (err) {
console.error(err)
return ''
}
}
} }
] ]
} }
@ -202,7 +193,7 @@ export default {
}, },
handle(row) { handle(row) {
try { try {
const data = JSON.parse(row.data) const data = row.data
if (data.from === 'ht') { if (data.from === 'ht') {
this.modalUrl = `/${data.from}/#/contract/contractList?auth_token=${window.encodeURIComponent(getToken())}&module_name=${data.from}&keyword=${(/\[(.*?)]/.exec(data.title) ? /\[(.*?)]/.exec(data.title)[1] : '')}` this.modalUrl = `/${data.from}/#/contract/contractList?auth_token=${window.encodeURIComponent(getToken())}&module_name=${data.from}&keyword=${(/\[(.*?)]/.exec(data.title) ? /\[(.*?)]/.exec(data.title)[1] : '')}`
} else if (data.from === 'oa') { } else if (data.from === 'oa') {

@ -11,9 +11,16 @@
@input="e => $emit('update:isShow',e)" @input="e => $emit('update:isShow',e)"
> >
<template> <template>
<vxe-toolbar>
<template #buttons>
<el-input v-model="select.keyword" style="max-width: 200px;margin-right: 10px;" size="small" placeholder="请输入关键词" />
<el-button icon="el-icon-search" type="primary" plain size="small" @click="select.page = 1,getUsers()">搜索</el-button>
</template>
</vxe-toolbar>
<vxe-table <vxe-table
ref="table" ref="table"
stripe stripe
:loading="tableLoading"
style="margin-top: 10px;" style="margin-top: 10px;"
keep-source keep-source
show-overflow show-overflow
@ -70,6 +77,7 @@ export default {
data() { data() {
return { return {
loading: false, loading: false,
tableLoading: false,
select: { select: {
page: 1, page: 1,
@ -124,9 +132,15 @@ export default {
}, },
async getUsers() { async getUsers() {
const res = await index(this.select) this.tableLoading = true
this.tableData = res.data try {
this.total = res.total const res = await index(this.select)
this.tableData = res.data
this.total = res.total
this.tableLoading = false
} catch (err) {
this.tableLoading = false
}
}, },
async getRoleUsers() { async getRoleUsers() {
@ -148,7 +162,7 @@ export default {
try { try {
batchUser({ batchUser({
id: this.form.id, id: this.form.id,
user_ids: selectRecords.map(row => row.id) user_ids: Array.from(new Set([...selectRecords.map(row => row.id), ...this.form.user_ids]))
}) })
// //
setTimeout(() => { setTimeout(() => {

@ -12,6 +12,12 @@
@input="e => $emit('update:isShow',e)" @input="e => $emit('update:isShow',e)"
> >
<template> <template>
<vxe-toolbar>
<template #buttons>
<el-input v-model="select.keyword" style="max-width: 200px;margin-right: 10px;" size="small" placeholder="请输入关键词" />
<el-button icon="el-icon-search" type="primary" plain size="small" @click="select.page = 1,getUsers()">搜索</el-button>
</template>
</vxe-toolbar>
<vxe-table <vxe-table
ref="table" ref="table"
stripe stripe
@ -78,6 +84,7 @@ export default {
return { return {
zIndex: PopupManager.nextZIndex(), zIndex: PopupManager.nextZIndex(),
loading: false, loading: false,
tableLoading: false,
select: { select: {
page: 1, page: 1,
@ -135,9 +142,15 @@ export default {
}, },
async getUsers() { async getUsers() {
const res = await index(this.select) this.tableLoading = true
this.tableData = res.data try {
this.total = res.total const res = await index(this.select)
this.tableData = res.data
this.total = res.total
this.tableLoading = false
} catch (err) {
this.tableLoading = false
}
}, },
async getRoleUsers() { async getRoleUsers() {
@ -161,7 +174,7 @@ export default {
batchRoles({ batchRoles({
...this.form, ...this.form,
module_id: this.moduleId, module_id: this.moduleId,
user_ids: selectRecords.map(row => row.id) user_ids: Array.from(new Set([...selectRecords.map(row => row.id), this.form.user_ids]))
}) })
// //
setTimeout(() => { setTimeout(() => {

Loading…
Cancel
Save