1.修复获取严重违法市局人员问题
This commit is contained in:
parent
a4d64070ff
commit
0b4c283d9c
|
|
@ -1,9 +1,9 @@
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
var compressing = require('compressing')
|
const compressing = require('compressing')
|
||||||
const axios = require('axios')
|
const axios = require('axios')
|
||||||
const child_process = require('child_process')
|
const child_process = require('child_process')
|
||||||
|
const packageJson = require('../package.json')
|
||||||
function parseTime(time, format = 'yyyy-MM-dd hh:mm:ss') {
|
function parseTime(time, format = 'yyyy-MM-dd hh:mm:ss') {
|
||||||
const date = time instanceof Date ? time : new Date(time)
|
const date = time instanceof Date ? time : new Date(time)
|
||||||
|
|
||||||
|
|
@ -32,17 +32,72 @@ function parseTime(time, format = 'yyyy-MM-dd hh:mm:ss') {
|
||||||
* youfool
|
* youfool
|
||||||
*/
|
*/
|
||||||
class IncrePack {
|
class IncrePack {
|
||||||
constructor(options) {
|
|
||||||
this.options = options
|
|
||||||
}
|
|
||||||
apply(compiler) {
|
apply(compiler) {
|
||||||
|
if (process.env.VUE_APP_WEBPACK_CMD !== 'build') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const date = new Date()
|
||||||
const projectPath = path.join(__dirname, '../')
|
const projectPath = path.join(__dirname, '../')
|
||||||
const distPath = projectPath + 'dist'
|
const distPath = projectPath + 'dist'
|
||||||
compiler.hooks.done.tap('IncrePack', async (compilation, callback) => {
|
const versionPath = `${projectPath}src/version.js`
|
||||||
// 排除开发环境
|
let hash = '000000'
|
||||||
if (process.env.ENV !== 'development') {
|
try {
|
||||||
|
hash = child_process.execSync('git rev-parse HEAD').slice(0, 6)
|
||||||
const increName = `${this.options.name}.zip`
|
} catch (e) {
|
||||||
|
console.log('------------------读取版本Hash失败---------------')
|
||||||
|
console.warn(e)
|
||||||
|
}
|
||||||
|
const codeVersion = `${parseTime(date, 'yyyy-MM-dd hh:mm:ss')} ${hash} ${process.env.VUE_APP_ENVIRONMENT}`
|
||||||
|
compiler.hooks.beforeRun.tapAsync('SetVersion', async(compilation, callback) => {
|
||||||
|
const data = `/** 本文件由打包插件自动生成和修改 */\nexport default '${codeVersion}'\n`
|
||||||
|
fs.writeFileSync(versionPath, data)
|
||||||
|
callback()
|
||||||
|
})
|
||||||
|
compiler.hooks.done.tap('SetVersion', async(compilation) => {
|
||||||
|
const data = `/** 本文件由打包插件自动生成和修改 */\nexport default ''\n`
|
||||||
|
fs.writeFileSync(versionPath, data)
|
||||||
|
})
|
||||||
|
compiler.hooks.done.tap('IncrePack', async(compilation) => {
|
||||||
|
let versionJson = {
|
||||||
|
artifactId: packageJson.name,
|
||||||
|
version: packageJson.version,
|
||||||
|
appId: packageJson.appId,
|
||||||
|
codeId: packageJson.codeId,
|
||||||
|
codeVersion
|
||||||
|
}
|
||||||
|
if (packageJson.increApi) {
|
||||||
|
// 获取版本信息
|
||||||
|
try {
|
||||||
|
console.log('------------------正在写入升级记录---------------')
|
||||||
|
const res = await axios.default({
|
||||||
|
url: packageJson.increApi + '?appId=' + packageJson.appId + '&codeId=' + packageJson.codeId,
|
||||||
|
method: 'get',
|
||||||
|
timeout: 5000
|
||||||
|
})
|
||||||
|
const { code, data } = res.data
|
||||||
|
if (code === 0 && data) {
|
||||||
|
versionJson = {
|
||||||
|
...versionJson,
|
||||||
|
artifactId: packageJson.name,
|
||||||
|
upgradeId: data.upgradeId,
|
||||||
|
version: data.version,
|
||||||
|
releaseTime: data.releaseTime,
|
||||||
|
fromCommit: data.fromCommit,
|
||||||
|
untilCommit: data.untilCommit,
|
||||||
|
newFeatures: data.newFeatures,
|
||||||
|
repair: data.repair,
|
||||||
|
other: data.other
|
||||||
|
}
|
||||||
|
console.log('------------------写入升级记录成功---------------')
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e.message)
|
||||||
|
console.log('------------------提交升级记录到远端失败---------------')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fs.mkdirSync(distPath + '/increpack-config')
|
||||||
|
fs.writeFileSync(distPath + '/increpack-config/version.json', JSON.stringify(versionJson), 'utf8')
|
||||||
|
const increName = `${packageJson.name}-${process.env.VUE_APP_ENVIRONMENT}-${parseTime(date, 'yyyy-MM-dd')}-${hash}.zip`
|
||||||
// 打包压缩
|
// 打包压缩
|
||||||
const tempFile = projectPath + '/' + increName
|
const tempFile = projectPath + '/' + increName
|
||||||
compressing.zip.compressDir(distPath, tempFile, { ignoreBase: true })
|
compressing.zip.compressDir(distPath, tempFile, { ignoreBase: true })
|
||||||
|
|
@ -54,7 +109,6 @@ class IncrePack {
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
})
|
})
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -141,3 +141,24 @@ export function logManage(params) {
|
||||||
params
|
params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过权限查找用户
|
||||||
|
* @param {string} permission 权限标识
|
||||||
|
* @param {string} orgId 机构id 非必填
|
||||||
|
* @param {string} deptId 部门id 非必填
|
||||||
|
* @author lwd
|
||||||
|
* @since 2025年1月5日 09:22:20
|
||||||
|
*/
|
||||||
|
export function getUsersWithPermissionYzwf(permission, orgId, deptId) {
|
||||||
|
return request({
|
||||||
|
// url: '/user/get_users_with_permission',
|
||||||
|
url: '/user/listUserByPermissionAndOrgIdsYzwf',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
permission,
|
||||||
|
orgId,
|
||||||
|
isArea: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -331,7 +331,7 @@
|
||||||
import DetailHead from '@/components/DetailHead'
|
import DetailHead from '@/components/DetailHead'
|
||||||
import { removeAttachementById, listAttachmentByBizseq } from '@/api/attachment'
|
import { removeAttachementById, listAttachmentByBizseq } from '@/api/attachment'
|
||||||
import { cppenaltyInfoGsGetById, listIllegalByBizSeq, nextProcessInclude } from '@/api/illegal'
|
import { cppenaltyInfoGsGetById, listIllegalByBizSeq, nextProcessInclude } from '@/api/illegal'
|
||||||
import { getUsersWithPermission } from '@/api/user'
|
import {getUsersWithPermission, getUsersWithPermissionYzwf} from '@/api/user'
|
||||||
import { taskOpinion } from '@/api/task'
|
import { taskOpinion } from '@/api/task'
|
||||||
import { getConstant } from '@/api/system'
|
import { getConstant } from '@/api/system'
|
||||||
import { getEntBaseByPripid } from '@/api/entBase'
|
import { getEntBaseByPripid } from '@/api/entBase'
|
||||||
|
|
@ -658,7 +658,7 @@ export default {
|
||||||
},
|
},
|
||||||
// 加载市局经办人
|
// 加载市局经办人
|
||||||
loadReviewer() {
|
loadReviewer() {
|
||||||
getUsersWithPermission('acceptSerIllegal', '001').then(res => {
|
getUsersWithPermissionYzwf('acceptSerIllegal', '001').then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.reviewer = res.data
|
this.reviewer = res.data
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue