xy 1 year ago
parent 90118d2e61
commit b67084e674

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

@ -110,19 +110,10 @@ export default {
},
{
title: '内容',
key: 'data',
key: 'data.title',
align: 'left',
'show-overflow-tooltip': true,
minWidth: 200,
formatter: (row, column, cellValue) => {
try {
const data = JSON.parse(cellValue)
return data.title
} catch (err) {
console.error(err)
return ''
}
}
minWidth: 200
}
]
}
@ -202,7 +193,7 @@ export default {
},
handle(row) {
try {
const data = JSON.parse(row.data)
const data = row.data
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] : '')}`
} else if (data.from === 'oa') {

@ -11,9 +11,16 @@
@input="e => $emit('update:isShow',e)"
>
<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
ref="table"
stripe
:loading="tableLoading"
style="margin-top: 10px;"
keep-source
show-overflow
@ -70,6 +77,7 @@ export default {
data() {
return {
loading: false,
tableLoading: false,
select: {
page: 1,
@ -124,9 +132,15 @@ export default {
},
async getUsers() {
const res = await index(this.select)
this.tableData = res.data
this.total = res.total
this.tableLoading = true
try {
const res = await index(this.select)
this.tableData = res.data
this.total = res.total
this.tableLoading = false
} catch (err) {
this.tableLoading = false
}
},
async getRoleUsers() {
@ -148,7 +162,7 @@ export default {
try {
batchUser({
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(() => {

@ -12,6 +12,12 @@
@input="e => $emit('update:isShow',e)"
>
<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
ref="table"
stripe
@ -78,6 +84,7 @@ export default {
return {
zIndex: PopupManager.nextZIndex(),
loading: false,
tableLoading: false,
select: {
page: 1,
@ -135,9 +142,15 @@ export default {
},
async getUsers() {
const res = await index(this.select)
this.tableData = res.data
this.total = res.total
this.tableLoading = true
try {
const res = await index(this.select)
this.tableData = res.data
this.total = res.total
this.tableLoading = false
} catch (err) {
this.tableLoading = false
}
},
async getRoleUsers() {
@ -161,7 +174,7 @@ export default {
batchRoles({
...this.form,
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(() => {

Loading…
Cancel
Save