Browse Source

Merge branch 'preview' of http://120.46.222.128:10021/elink-star/epmet-oper-pc into preview

preview
mk 8 months ago
parent
commit
b688f8bc2c
  1. 4
      epmet-oper-web/.env.development
  2. 5
      epmet-oper-web/.env.production.sit.project
  3. 2
      epmet-oper-web/.vscode/settings.json
  4. 49
      epmet-oper-web/src/components/ren-process-detail/src/ren-process-detail.vue
  5. 36
      epmet-oper-web/src/js/ajax.js
  6. 4
      epmet-oper-web/src/main.js
  7. 45
      epmet-oper-web/src/mixins/view-module-post.js
  8. 14
      epmet-oper-web/src/mixins/view-module.js
  9. 6
      epmet-oper-web/src/utils/request.js
  10. 41
      epmet-oper-web/src/views/modules/activiti/model.vue
  11. 33
      epmet-oper-web/src/views/modules/activiti/process-deploy.vue
  12. 48
      epmet-oper-web/src/views/modules/activiti/process-initiation.vue
  13. 71
      epmet-oper-web/src/views/modules/activiti/process.vue
  14. 60
      epmet-oper-web/src/views/modules/message/mail-template-add-or-update.vue
  15. 33
      epmet-oper-web/src/views/modules/oss/oss-upload.vue
  16. 63
      epmet-oper-web/src/views/modules/sys/news-add-or-update.vue
  17. 178
      epmet-oper-web/src/views/modules/sys/upgrade-version-history.vue
  18. 54
      epmet-oper-web/src/views/pages/login.vue

4
epmet-oper-web/.env.development

@ -1,7 +1,7 @@
NODE_ENV=development NODE_ENV=development
# VUE_APP_API_SERVER = http://118.190.150.119:41080/api # VUE_APP_API_SERVER = http://118.190.150.119:41080/api
VUE_APP_API_SERVER = http://localhost:8080/api # VUE_APP_API_SERVER = http://localhost:8080/api
# VUE_APP_API_SERVER = http://192.168.1.144/api VUE_APP_API_SERVER = http://192.168.1.144/api
# VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api # VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api
VUE_APP_NODE_ENV=dev VUE_APP_NODE_ENV=dev

5
epmet-oper-web/.env.production.sit.project

@ -0,0 +1,5 @@
NODE_ENV=production
VUE_APP_API_SERVER = http://192.168.1.140/api
# VUE_APP_API_SERVER = http://192.168.1.140/api
VUE_APP_NODE_ENV=prod:sit-project
VUE_APP_PUBLIC_PATH=epmet-oper

2
epmet-oper-web/.vscode/settings.json

@ -31,7 +31,7 @@
} }
}, },
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll.eslint": true "source.fixAll.eslint": "explicit"
}, },
"git.enableSmartCommit": true "git.enableSmartCommit": true
} }

49
epmet-oper-web/src/components/ren-process-detail/src/ren-process-detail.vue

@ -4,39 +4,34 @@
<img :src="getResourceURL()" class="image"> <img :src="getResourceURL()" class="image">
<h4>{{ $t('process.circulation') }}</h4> <h4>{{ $t('process.circulation') }}</h4>
<div class="mod-sys__dict"> <div class="mod-sys__dict">
<el-table <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle"
v-loading="dataListLoading" @sort-change="dataListSortChangeHandle" style="width: 100%;">
:data="dataList" <el-table-column prop="activityName" :label="$t('process.taskName')" header-align="center"
border align="center"></el-table-column>
@selection-change="dataListSelectionChangeHandle" <el-table-column prop="assignee" :label="$t('process.assignee')" header-align="center"
@sort-change="dataListSortChangeHandle" align="center"></el-table-column>
style="width: 100%;"> <el-table-column prop="startTime" :label="$t('task.startTime')" header-align="center"
<el-table-column prop="activityName" :label="$t('process.taskName')" header-align="center" align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="assignee" :label="$t('process.assignee')" header-align="center" align="center"></el-table-column> <el-table-column prop="endTime" :label="$t('task.endTime')" header-align="center"
<el-table-column prop="startTime" :label="$t('task.startTime')" header-align="center" align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="endTime" :label="$t('task.endTime')" header-align="center" align="center"></el-table-column> <el-table-column prop="comment" :label="$t('process.comment')" header-align="center"
<el-table-column prop="comment" :label="$t('process.comment')" header-align="center" align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="durationInSeconds" :label="$t('task.durationInSeconds')" header-align="center" align="center" width="180"></el-table-column> <el-table-column prop="durationInSeconds" :label="$t('task.durationInSeconds')" header-align="center"
align="center" width="180"></el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination v-if="dataForm.pid === '0'" :current-page="page" :page-sizes="[10, 20, 50, 100]" :page-size="limit"
v-if="dataForm.pid === '0'" :total="total" layout="total, sizes, prev, pager, next, jumper" @size-change="pageSizeChangeHandle"
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle"> @current-change="pageCurrentChangeHandle">
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
</template> </template>
<style scoped> <style scoped>
.image { .image {
width: 60%; width: 60%;
display: block; display: block;
margin: 0 auto 30px auto; margin: 0 auto 30px auto;
} }
</style> </style>
<script> <script>
@ -69,7 +64,7 @@ export default {
// (xml/image)url // (xml/image)url
getResourceURL () { getResourceURL () {
var params = qs.stringify({ var params = qs.stringify({
'token': Cookies.get('token'), 'token': Cookies.get('oper_token'),
'processInstanceId': this.dataForm.processInstanceId 'processInstanceId': this.dataForm.processInstanceId
}) })
return `${window.SITE_CONFIG['apiURL']}/activiti/his/getInstImage?${params}` return `${window.SITE_CONFIG['apiURL']}/activiti/his/getInstImage?${params}`

36
epmet-oper-web/src/js/ajax.js

@ -46,8 +46,8 @@ function endLoading () {
axios.interceptors.request.use( axios.interceptors.request.use(
(config) => { (config) => {
config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN' config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN'
config.headers['token'] = Cookies.get('token') || '' config.headers['token'] = Cookies.get('oper_token') || ''
config.headers['Authorization'] = Cookies.get('token') || '' config.headers['Authorization'] = Cookies.get('oper_token') || ''
// 默认参数 // 默认参数
var defaults = {} var defaults = {}
// 防止缓存,GET请求默认带_t参数 // 防止缓存,GET请求默认带_t参数
@ -96,7 +96,7 @@ axios.interceptors.response.use(
// if (userType === 'work'){ // if (userType === 'work'){
// router.replace({ name: 'loginWork' }) // router.replace({ name: 'loginWork' })
// }else { // }else {
router.replace({ name: 'login' }) router.replace({ name: 'login' })
// } // }
return Promise.reject(response.data.msg) return Promise.reject(response.data.msg)
@ -192,11 +192,11 @@ export default {
if (data.code == 0) { if (data.code == 0) {
//业务成功 //业务成功
if (typeof cb_su === 'function') { if (typeof cb_su === 'function') {
cb_su(data.data, data.msg ) cb_su(data.data, data.msg)
} }
} else { } else {
//业务失败 //业务失败
if (typeof cb_err === 'function') cb_err(data.msg , data.data) if (typeof cb_err === 'function') cb_err(data.msg, data.data)
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(res) if (typeof cb_err === 'function') cb_err(res)
@ -260,11 +260,11 @@ export default {
if (data.code == 0) { if (data.code == 0) {
//业务成功 //业务成功
if (typeof cb_su === 'function') { if (typeof cb_su === 'function') {
cb_su(data.data, data.msg ) cb_su(data.data, data.msg)
} }
} else { } else {
//业务失败 //业务失败
if (typeof cb_err === 'function') cb_err(data.msg , data.data) if (typeof cb_err === 'function') cb_err(data.msg, data.data)
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(res) if (typeof cb_err === 'function') cb_err(res)
@ -293,12 +293,12 @@ export default {
if (res) { if (res) {
if (res.status === 200) { if (res.status === 200) {
var data = res.data var data = res.data
cb_su(data, data.msg ) cb_su(data, data.msg)
} else { } else {
if (typeof cb_err === 'function') cb_err(data.msg , data) if (typeof cb_err === 'function') cb_err(data.msg, data)
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(data.msg , data) if (typeof cb_err === 'function') cb_err(data.msg, data)
} }
}) })
.catch((err) => { .catch((err) => {
@ -400,15 +400,15 @@ export default {
var data = res.data //直接返回blob var data = res.data //直接返回blob
// if (data.code == 0) { // if (data.code == 0) {
//业务成功 //业务成功
if (typeof cb_su === 'function') { if (typeof cb_su === 'function') {
cb_su(data) cb_su(data)
} }
else { else {
//业务失败 //业务失败
if (typeof cb_err === 'function') cb_err(errorMsg) if (typeof cb_err === 'function') cb_err(errorMsg)
} }
// } else { // } else {
// if (typeof cb_err === 'function') cb_err(errorMsg) // if (typeof cb_err === 'function') cb_err(errorMsg)
} }
} else { } else {

4
epmet-oper-web/src/main.js

@ -63,8 +63,8 @@ window.SITE_CONFIG['storeState'] = cloneDeep(store.state)
// el-uploader的header配置 // el-uploader的header配置
Vue.prototype.$getElUploadHeaders = () => ({ Vue.prototype.$getElUploadHeaders = () => ({
Authorization: Cookies.get('token') || '' Authorization: Cookies.get('oper_token') || ''
// Authorization: localStorage.getItem('token') || '' // Authorization: localStorage.getItem('token') || ''
}) })
new Vue({ new Vue({

45
epmet-oper-web/src/mixins/view-module-post.js

@ -1,7 +1,7 @@
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
import qs from 'qs' import qs from 'qs'
export default { export default {
data() { data () {
/* eslint-disable */ /* eslint-disable */
return { return {
// 设置属性 // 设置属性
@ -29,19 +29,19 @@ export default {
} }
/* eslint-enable */ /* eslint-enable */
}, },
created() { created () {
if (this.mixinViewModuleOptions.createdIsNeed) { if (this.mixinViewModuleOptions.createdIsNeed) {
this.query() this.query()
} }
}, },
activated() { activated () {
if (this.mixinViewModuleOptions.activatedIsNeed) { if (this.mixinViewModuleOptions.activatedIsNeed) {
this.query() this.query()
} }
}, },
methods: { methods: {
// 获取数据列表 // 获取数据列表
query() { query () {
this.dataListLoading = true this.dataListLoading = true
this.$http this.$http
.post(this.mixinViewModuleOptions.getDataListURL, { .post(this.mixinViewModuleOptions.getDataListURL, {
@ -74,11 +74,11 @@ export default {
}) })
}, },
// 多选 // 多选
dataListSelectionChangeHandle(val) { dataListSelectionChangeHandle (val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// 排序 // 排序
dataListSortChangeHandle(data) { dataListSortChangeHandle (data) {
if (!data.order || !data.prop) { if (!data.order || !data.prop) {
this.order = '' this.order = ''
this.orderField = '' this.orderField = ''
@ -89,13 +89,13 @@ export default {
this.query() this.query()
}, },
// 分页, 每页条数 // 分页, 每页条数
pageSizeChangeHandle(val) { pageSizeChangeHandle (val) {
this.page = 1 this.page = 1
this.limit = val this.limit = val
this.query() this.query()
}, },
// 分页, 当前页 // 分页, 当前页
pageCurrentChangeHandle(val) { pageCurrentChangeHandle (val) {
this.page = val this.page = val
this.query() this.query()
}, },
@ -104,7 +104,7 @@ export default {
this.query() this.query()
}, },
// 新增 / 修改 // 新增 / 修改
addOrUpdateHandle(id) { addOrUpdateHandle (id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.dataForm.id = id this.$refs.addOrUpdate.dataForm.id = id
@ -112,7 +112,7 @@ export default {
}) })
}, },
// 删除 // 删除
deleteHandle(id) { deleteHandle (id) {
if ( if (
this.mixinViewModuleOptions.deleteIsBatch && this.mixinViewModuleOptions.deleteIsBatch &&
!id && !id &&
@ -136,18 +136,17 @@ export default {
.then(() => { .then(() => {
this.$http this.$http
.delete( .delete(
`${this.mixinViewModuleOptions.deleteURL}${ `${this.mixinViewModuleOptions.deleteURL}${this.mixinViewModuleOptions.deleteIsBatch ? '' : '/' + id
this.mixinViewModuleOptions.deleteIsBatch ? '' : '/' + id
}`, }`,
this.mixinViewModuleOptions.deleteIsBatch this.mixinViewModuleOptions.deleteIsBatch
? { ? {
data: id data: id
? [id] ? [id]
: this.dataListSelections.map( : this.dataListSelections.map(
(item) => (item) =>
item[this.mixinViewModuleOptions.deleteIsBatchKey] item[this.mixinViewModuleOptions.deleteIsBatchKey]
) )
} }
: {} : {}
) )
.then(({ data: res }) => { .then(({ data: res }) => {
@ -163,14 +162,14 @@ export default {
} }
}) })
}) })
.catch(() => {}) .catch(() => { })
}) })
.catch(() => {}) .catch(() => { })
}, },
// 导出 // 导出
exportHandle() { exportHandle () {
var params = qs.stringify({ var params = qs.stringify({
token: Cookies.get('token'), token: Cookies.get('oper_token'),
...this.dataForm ...this.dataForm
}) })
window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportURL}?${params}` window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportURL}?${params}`

14
epmet-oper-web/src/mixins/view-module.js

@ -138,11 +138,11 @@ export default {
this.query() this.query()
} }
}) })
}).catch(() => {}) }).catch(() => { })
}).catch(() => {}) }).catch(() => { })
}, },
// 删除 // 删除
async deleteHandlePost (id) { async deleteHandlePost (id) {
@ -152,7 +152,7 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http.post(this.mixinViewModuleOptions.deleteURL, this.$http.post(this.mixinViewModuleOptions.deleteURL,
[id] [id]
).then(({ data: res }) => { ).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
@ -165,13 +165,13 @@ export default {
this.query() this.query()
} }
}) })
}).catch(() => {}) }).catch(() => { })
}).catch(() => {}) }).catch(() => { })
}, },
// 导出 // 导出
exportHandle () { exportHandle () {
var params = qs.stringify({ var params = qs.stringify({
'token': Cookies.get('token'), 'token': Cookies.get('oper_token'),
...this.dataForm ...this.dataForm
}) })
window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportURL}?${params}` window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportURL}?${params}`

6
epmet-oper-web/src/utils/request.js

@ -16,8 +16,8 @@ const http = axios.create({
*/ */
http.interceptors.request.use(config => { http.interceptors.request.use(config => {
config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN' config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN'
config.headers['token'] = Cookies.get('token') || '' config.headers['token'] = Cookies.get('oper_token') || ''
config.headers['Authorization'] = Cookies.get('token') || '' config.headers['Authorization'] = Cookies.get('oper_token') || ''
// 默认参数 // 默认参数
var defaults = {} var defaults = {}
// 防止缓存,GET请求默认带_t参数 // 防止缓存,GET请求默认带_t参数
@ -58,7 +58,7 @@ http.interceptors.response.use(response => {
// if (userType === 'work'){ // if (userType === 'work'){
// router.replace({ name: 'loginWork' }) // router.replace({ name: 'loginWork' })
// }else { // }else {
router.replace({ name: 'login' }) router.replace({ name: 'login' })
// } // }
return Promise.reject(response.data.msg) return Promise.reject(response.data.msg)
} }

41
epmet-oper-web/src/views/modules/activiti/model.vue

@ -18,35 +18,30 @@
<el-button type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> <el-button type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle"
v-loading="dataListLoading" @sort-change="dataListSortChangeHandle" style="width: 100%;">
:data="dataList"
border
@selection-change="dataListSelectionChangeHandle"
@sort-change="dataListSortChangeHandle"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column> <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="name" :label="$t('model.name')" header-align="center" align="center"></el-table-column> <el-table-column prop="name" :label="$t('model.name')" header-align="center" align="center"></el-table-column>
<el-table-column prop="key" :label="$t('model.key')" header-align="center" align="center"></el-table-column> <el-table-column prop="key" :label="$t('model.key')" header-align="center" align="center"></el-table-column>
<el-table-column prop="version" :label="$t('model.version')" header-align="center" align="center"></el-table-column> <el-table-column prop="version" :label="$t('model.version')" header-align="center"
<el-table-column prop="createTime" :label="$t('model.createTime')" header-align="center" align="center" width="180"></el-table-column> align="center"></el-table-column>
<el-table-column prop="lastUpdateTime" :label="$t('model.lastUpdateTime')" header-align="center" align="center" width="180"></el-table-column> <el-table-column prop="createTime" :label="$t('model.createTime')" header-align="center" align="center"
width="180"></el-table-column>
<el-table-column prop="lastUpdateTime" :label="$t('model.lastUpdateTime')" header-align="center" align="center"
width="180"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<a :href="getModelerURL(scope.row.id)" target="_blank" class="el-button el-button--text el-button--small">{{ $t('model.design') }}</a> <a :href="getModelerURL(scope.row.id)" target="_blank" class="el-button el-button--text el-button--small">{{
$t('model.design') }}</a>
<el-button type="text" size="small" @click="deployHandle(scope.row.id)">{{ $t('model.deploy') }}</el-button> <el-button type="text" size="small" @click="deployHandle(scope.row.id)">{{ $t('model.deploy') }}</el-button>
<a :href="getExportURL(scope.row.id)" target="_blank" class="el-button el-button--text el-button--small">{{ $t('export') }}</a> <a :href="getExportURL(scope.row.id)" target="_blank" class="el-button el-button--text el-button--small">{{
$t('export') }}</a>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination :current-page="page" :page-sizes="[10, 20, 50, 100]" :page-size="limit" :total="total"
:current-page="page" layout="total, sizes, prev, pager, next, jumper" @size-change="pageSizeChangeHandle"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle"> @current-change="pageCurrentChangeHandle">
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
@ -83,7 +78,7 @@ export default {
// 线url // 线url
getModelerURL (id) { getModelerURL (id) {
var params = qs.stringify({ var params = qs.stringify({
'token': Cookies.get('token'), 'token': Cookies.get('oper_token'),
'modelId': id 'modelId': id
}) })
return `${window.SITE_CONFIG['apiURL']}/activiti/modeler.html?${params}` return `${window.SITE_CONFIG['apiURL']}/activiti/modeler.html?${params}`
@ -91,7 +86,7 @@ export default {
// url // url
getExportURL (id) { getExportURL (id) {
var params = qs.stringify({ var params = qs.stringify({
'token': Cookies.get('token') 'token': Cookies.get('oper_token')
}) })
return `${window.SITE_CONFIG['apiURL']}/activiti/model/export/${id}?${params}` return `${window.SITE_CONFIG['apiURL']}/activiti/model/export/${id}?${params}`
}, },
@ -114,8 +109,8 @@ export default {
this.getDataList() this.getDataList()
} }
}) })
}).catch(() => {}) }).catch(() => { })
}).catch(() => {}) }).catch(() => { })
} }
} }
} }

33
epmet-oper-web/src/views/modules/activiti/process-deploy.vue

@ -1,20 +1,8 @@
<template> <template>
<el-dialog <el-dialog :visible.sync="visible" :title="$t('process.deployFile')" :close-on-click-modal="false"
:visible.sync="visible" :close-on-press-escape="false">
:title="$t('process.deployFile')" <el-upload :headers="$getElUploadHeaders()" name="processFile" :action="url" :file-list="fileList" drag
:close-on-click-modal="false" :before-upload="beforeUploadHandle" :on-success="successHandle" class="text-center">
:close-on-press-escape="false"
>
<el-upload
:headers="$getElUploadHeaders()"
name="processFile"
:action="url"
:file-list="fileList"
drag
:before-upload="beforeUploadHandle"
:on-success="successHandle"
class="text-center"
>
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text" v-html="$t('upload.text')"></div> <div class="el-upload__text" v-html="$t('upload.text')"></div>
<div class="el-upload__tip" slot="tip"> <div class="el-upload__tip" slot="tip">
@ -27,7 +15,7 @@
<script> <script>
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
export default { export default {
data() { data () {
return { return {
visible: false, visible: false,
url: '', url: '',
@ -35,15 +23,14 @@ export default {
} }
}, },
methods: { methods: {
init() { init () {
this.visible = true this.visible = true
this.url = `${ this.url = `${window.SITE_CONFIG['apiURL']
window.SITE_CONFIG['apiURL'] }/activiti/process/deploy?token=${Cookies.get('oper_token')}`
}/activiti/process/deploy?token=${Cookies.get('token')}`
this.fileList = [] this.fileList = []
}, },
// //
beforeUploadHandle(file) { beforeUploadHandle (file) {
if ( if (
!/.+\.zip$/.test(file.name) && !/.+\.zip$/.test(file.name) &&
!/.+\.xml$/.test(file.name) && !/.+\.xml$/.test(file.name) &&
@ -57,7 +44,7 @@ export default {
} }
}, },
// //
successHandle(res, file, fileList) { successHandle (res, file, fileList) {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }

48
epmet-oper-web/src/views/modules/activiti/process-initiation.vue

@ -12,43 +12,41 @@
<el-button @click="getDataList()">{{ $t('query') }}</el-button> <el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle"
v-loading="dataListLoading" @sort-change="dataListSortChangeHandle" style="width: 100%;">
:data="dataList"
border
@selection-change="dataListSelectionChangeHandle"
@sort-change="dataListSortChangeHandle"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column> <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="id" :label="$t('process.id')" header-align="center" align="center"></el-table-column> <el-table-column prop="id" :label="$t('process.id')" header-align="center" align="center"></el-table-column>
<el-table-column prop="deploymentId" :label="$t('process.deploymentId')" header-align="center" align="center" width="80"></el-table-column> <el-table-column prop="deploymentId" :label="$t('process.deploymentId')" header-align="center" align="center"
width="80"></el-table-column>
<el-table-column prop="name" :label="$t('process.name')" header-align="center" align="center"></el-table-column> <el-table-column prop="name" :label="$t('process.name')" header-align="center" align="center"></el-table-column>
<el-table-column prop="key" :label="$t('process.key')" header-align="center" align="center"></el-table-column> <el-table-column prop="key" :label="$t('process.key')" header-align="center" align="center"></el-table-column>
<el-table-column prop="version" :label="$t('process.version')" header-align="center" align="center"></el-table-column> <el-table-column prop="version" :label="$t('process.version')" header-align="center"
<el-table-column prop="resourceName" :label="$t('process.resourceName')" header-align="center" align="center" :show-overflow-tooltip="true" width="100"> align="center"></el-table-column>
<el-table-column prop="resourceName" :label="$t('process.resourceName')" header-align="center" align="center"
:show-overflow-tooltip="true" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<a :href="getResourceURL(scope.row.deploymentId, scope.row.resourceName)" target="_blank">{{ scope.row.resourceName }}</a> <a :href="getResourceURL(scope.row.deploymentId, scope.row.resourceName)" target="_blank">{{
scope.row.resourceName }}</a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="diagramResourceName" :label="$t('process.diagramResourceName')" header-align="center" align="center" :show-overflow-tooltip="true" width="100"> <el-table-column prop="diagramResourceName" :label="$t('process.diagramResourceName')" header-align="center"
align="center" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<a :href="getResourceURL(scope.row.deploymentId, scope.row.diagramResourceName)" target="_blank">{{ scope.row.diagramResourceName }}</a> <a :href="getResourceURL(scope.row.deploymentId, scope.row.diagramResourceName)" target="_blank">{{
scope.row.diagramResourceName }}</a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="deploymentTime" :label="$t('process.deploymentTime')" header-align="center" align="center" width="180"></el-table-column> <el-table-column prop="deploymentTime" :label="$t('process.deploymentTime')" header-align="center"
align="center" width="180"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="createProcessInstance(scope.row)">{{ $t('process.createInstance') }}</el-button> <el-button type="text" size="small" @click="createProcessInstance(scope.row)">{{
$t('process.createInstance') }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination :current-page="page" :page-sizes="[10, 20, 50, 100]" :page-size="limit" :total="total"
:current-page="page" layout="total, sizes, prev, pager, next, jumper" @size-change="pageSizeChangeHandle"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle"> @current-change="pageCurrentChangeHandle">
</el-pagination> </el-pagination>
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
@ -85,7 +83,7 @@ export default {
// (xml/image)url // (xml/image)url
getResourceURL (id, name) { getResourceURL (id, name) {
var params = qs.stringify({ var params = qs.stringify({
'token': Cookies.get('token'), 'token': Cookies.get('oper_token'),
'deploymentId': id, 'deploymentId': id,
'resourceName': name 'resourceName': name
}) })
@ -101,7 +99,7 @@ export default {
return this.$message.error(this.$t('process.routeError')) return this.$message.error(this.$t('process.routeError'))
} }
this.forwardUrl(res.data, row) this.forwardUrl(res.data, row)
}).catch(() => {}) }).catch(() => { })
}, },
forwardUrl (data, row) { forwardUrl (data, row) {
var routeParams = { var routeParams = {
@ -134,7 +132,7 @@ export default {
this.getDataList() this.getDataList()
} }
}) })
}).catch(() => {}) }).catch(() => { })
} }
} }
} }

71
epmet-oper-web/src/views/modules/activiti/process.vue

@ -18,52 +18,55 @@
<el-button type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> <el-button type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle"
v-loading="dataListLoading" @sort-change="dataListSortChangeHandle" style="width: 100%;">
:data="dataList"
border
@selection-change="dataListSelectionChangeHandle"
@sort-change="dataListSortChangeHandle"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column> <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="id" :label="$t('process.id')" header-align="center" align="center"></el-table-column> <el-table-column prop="id" :label="$t('process.id')" header-align="center" align="center"></el-table-column>
<el-table-column prop="deploymentId" :label="$t('process.deploymentId')" header-align="center" align="center" width="80"></el-table-column> <el-table-column prop="deploymentId" :label="$t('process.deploymentId')" header-align="center" align="center"
width="80"></el-table-column>
<el-table-column prop="name" :label="$t('process.name')" header-align="center" align="center"></el-table-column> <el-table-column prop="name" :label="$t('process.name')" header-align="center" align="center"></el-table-column>
<el-table-column prop="key" :label="$t('process.key')" header-align="center" align="center"></el-table-column> <el-table-column prop="key" :label="$t('process.key')" header-align="center" align="center"></el-table-column>
<el-table-column prop="version" :label="$t('process.version')" header-align="center" align="center"></el-table-column> <el-table-column prop="version" :label="$t('process.version')" header-align="center"
<el-table-column prop="resourceName" :label="$t('process.resourceName')" header-align="center" align="center" :show-overflow-tooltip="true" width="100"> align="center"></el-table-column>
<el-table-column prop="resourceName" :label="$t('process.resourceName')" header-align="center" align="center"
:show-overflow-tooltip="true" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<a :href="getResourceURL(scope.row.deploymentId, scope.row.resourceName)" target="_blank">{{ scope.row.resourceName }}</a> <a :href="getResourceURL(scope.row.deploymentId, scope.row.resourceName)" target="_blank">{{
scope.row.resourceName }}</a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="diagramResourceName" :label="$t('process.diagramResourceName')" header-align="center" align="center" :show-overflow-tooltip="true" width="100"> <el-table-column prop="diagramResourceName" :label="$t('process.diagramResourceName')" header-align="center"
align="center" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<a :href="getResourceURL(scope.row.deploymentId, scope.row.diagramResourceName)" target="_blank">{{ scope.row.diagramResourceName }}</a> <a :href="getResourceURL(scope.row.deploymentId, scope.row.diagramResourceName)" target="_blank">{{
scope.row.diagramResourceName }}</a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="deploymentTime" :label="$t('process.deploymentTime')" header-align="center" align="center" width="180"></el-table-column> <el-table-column prop="deploymentTime" :label="$t('process.deploymentTime')" header-align="center"
align="center" width="180"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="scope.row.suspended" type="text" size="small" @click="activeHandle(scope.row.id)">{{ $t('process.active') }}</el-button> <el-button v-if="scope.row.suspended" type="text" size="small" @click="activeHandle(scope.row.id)">{{
<el-button v-else type="text" size="small" @click="suspendHandle(scope.row.id)">{{ $t('process.suspend') }}</el-button> $t('process.active') }}</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.deploymentId)">{{ $t('delete') }}</el-button> <el-button v-else type="text" size="small" @click="suspendHandle(scope.row.id)">{{ $t('process.suspend')
<el-button type="text" size="small" @click="convertToModelHandle(scope.row.id)">{{ $t('process.convertToModel') }}</el-button> }}</el-button>
<el-button type="text" size="small" @click="setBizRoute(scope.row)">{{ $t('process.bizRouteSet') }}</el-button> <el-button type="text" size="small" @click="deleteHandle(scope.row.deploymentId)">{{ $t('delete')
}}</el-button>
<el-button type="text" size="small" @click="convertToModelHandle(scope.row.id)">{{
$t('process.convertToModel') }}</el-button>
<el-button type="text" size="small" @click="setBizRoute(scope.row)">{{ $t('process.bizRouteSet')
}}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination :current-page="page" :page-sizes="[10, 20, 50, 100]" :page-size="limit" :total="total"
:current-page="page" layout="total, sizes, prev, pager, next, jumper" @size-change="pageSizeChangeHandle"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle"> @current-change="pageCurrentChangeHandle">
</el-pagination> </el-pagination>
<!-- 弹窗, 部署流程文件 --> <!-- 弹窗, 部署流程文件 -->
<deploy v-if="deployVisible" ref="deploy" @refreshDataList="getDataList"></deploy> <deploy v-if="deployVisible" ref="deploy" @refreshDataList="getDataList"></deploy>
<process-biz-route v-if="setBizRouteVisible" ref="processBizRoute" @refreshDataList="getDataList"></process-biz-route> <process-biz-route v-if="setBizRouteVisible" ref="processBizRoute"
@refreshDataList="getDataList"></process-biz-route>
</div> </div>
</el-card> </el-card>
</template> </template>
@ -101,7 +104,7 @@ export default {
// (xml/image)url // (xml/image)url
getResourceURL (id, name) { getResourceURL (id, name) {
var params = qs.stringify({ var params = qs.stringify({
'token': Cookies.get('token'), 'token': Cookies.get('oper_token'),
'deploymentId': id, 'deploymentId': id,
'resourceName': name 'resourceName': name
}) })
@ -142,8 +145,8 @@ export default {
this.getDataList() this.getDataList()
} }
}) })
}).catch(() => {}) }).catch(() => { })
}).catch(() => {}) }).catch(() => { })
}, },
// //
suspendHandle (id) { suspendHandle (id) {
@ -164,8 +167,8 @@ export default {
this.getDataList() this.getDataList()
} }
}) })
}).catch(() => {}) }).catch(() => { })
}).catch(() => {}) }).catch(() => { })
}, },
// //
convertToModelHandle (id) { convertToModelHandle (id) {
@ -186,8 +189,8 @@ export default {
this.getDataList() this.getDataList()
} }
}) })
}).catch(() => {}) }).catch(() => { })
}).catch(() => {}) }).catch(() => { })
} }
} }
} }

60
epmet-oper-web/src/views/modules/message/mail-template-add-or-update.vue

@ -1,41 +1,20 @@
<template> <template>
<el-dialog <el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false"
:visible.sync="visible" :close-on-press-escape="false">
:title="!dataForm.id ? $t('add') : $t('update')" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()"
:close-on-click-modal="false" label-width="120px">
:close-on-press-escape="false"
>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmitHandle()"
label-width="120px"
>
<el-form-item prop="name" :label="$t('mail.name')"> <el-form-item prop="name" :label="$t('mail.name')">
<el-input <el-input v-model="dataForm.name" :placeholder="$t('mail.name')"></el-input>
v-model="dataForm.name"
:placeholder="$t('mail.name')"
></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="subject" :label="$t('mail.subject')"> <el-form-item prop="subject" :label="$t('mail.subject')">
<el-input <el-input v-model="dataForm.subject" :placeholder="$t('mail.subject')"></el-input>
v-model="dataForm.subject"
:placeholder="$t('mail.subject')"
></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="content" :label="$t('mail.content')"> <el-form-item prop="content" :label="$t('mail.content')">
<!-- 富文本编辑器, 容器 --> <!-- 富文本编辑器, 容器 -->
<div id="J_quillEditor"></div> <div id="J_quillEditor"></div>
<!-- 自定义上传图片功能 (使用element upload组件) --> <!-- 自定义上传图片功能 (使用element upload组件) -->
<el-upload <el-upload :headers="$getElUploadHeaders()" :action="uploadUrl" :show-file-list="false"
:headers="$getElUploadHeaders()" :before-upload="uploadBeforeUploadHandle" :on-success="uploadSuccessHandle" style="display: none">
:action="uploadUrl"
:show-file-list="false"
:before-upload="uploadBeforeUploadHandle"
:on-success="uploadSuccessHandle"
style="display: none"
>
<el-button ref="uploadBtn" type="primary" size="small">{{ <el-button ref="uploadBtn" type="primary" size="small">{{
$t('upload.button') $t('upload.button')
}}</el-button> }}</el-button>
@ -57,7 +36,7 @@ import debounce from 'lodash/debounce'
import 'quill/dist/quill.snow.css' import 'quill/dist/quill.snow.css'
import Quill from 'quill' import Quill from 'quill'
export default { export default {
data() { data () {
return { return {
visible: false, visible: false,
quillEditor: null, quillEditor: null,
@ -86,7 +65,7 @@ export default {
} }
}, },
computed: { computed: {
dataRule() { dataRule () {
var validateContent = (rule, value, callback) => { var validateContent = (rule, value, callback) => {
if (this.quillEditor.getLength() <= 1) { if (this.quillEditor.getLength() <= 1) {
return callback(new Error(this.$t('validate.required'))) return callback(new Error(this.$t('validate.required')))
@ -120,7 +99,7 @@ export default {
} }
}, },
methods: { methods: {
init() { init () {
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
if (this.quillEditor) { if (this.quillEditor) {
@ -135,7 +114,7 @@ export default {
}) })
}, },
// //
quillEditorHandle() { quillEditorHandle () {
this.quillEditor = new Quill('#J_quillEditor', { this.quillEditor = new Quill('#J_quillEditor', {
modules: { modules: {
toolbar: this.quillEditorToolbarOptions toolbar: this.quillEditorToolbarOptions
@ -143,9 +122,8 @@ export default {
theme: 'snow' theme: 'snow'
}) })
// (使element upload) // (使element upload)
this.uploadUrl = `${ this.uploadUrl = `${window.SITE_CONFIG['apiURL']
window.SITE_CONFIG['apiURL'] }/oss/file/upload?token=${Cookies.get('oper_token')}`
}/oss/file/upload?token=${Cookies.get('token')}`
this.quillEditor.getModule('toolbar').addHandler('image', () => { this.quillEditor.getModule('toolbar').addHandler('image', () => {
this.$refs.uploadBtn.$el.click() this.$refs.uploadBtn.$el.click()
}) })
@ -155,7 +133,7 @@ export default {
}) })
}, },
// //
uploadBeforeUploadHandle(file) { uploadBeforeUploadHandle (file) {
if ( if (
file.type !== 'image/jpg' && file.type !== 'image/jpg' &&
file.type !== 'image/jpeg' && file.type !== 'image/jpeg' &&
@ -167,7 +145,7 @@ export default {
} }
}, },
// //
uploadSuccessHandle(res, file, fileList) { uploadSuccessHandle (res, file, fileList) {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
@ -178,7 +156,7 @@ export default {
) )
}, },
// //
getInfo() { getInfo () {
this.$http this.$http
.get(`/message/mailtemplate/${this.dataForm.id}`) .get(`/message/mailtemplate/${this.dataForm.id}`)
.then(({ data: res }) => { .then(({ data: res }) => {
@ -188,7 +166,7 @@ export default {
this.dataForm = res.data this.dataForm = res.data
this.quillEditor.root.innerHTML = this.dataForm.content this.quillEditor.root.innerHTML = this.dataForm.content
}) })
.catch(() => {}) .catch(() => { })
}, },
// //
dataFormSubmitHandle: debounce( dataFormSubmitHandle: debounce(
@ -216,7 +194,7 @@ export default {
} }
}) })
}) })
.catch(() => {}) .catch(() => { })
}) })
}, },
1000, 1000,

33
epmet-oper-web/src/views/modules/oss/oss-upload.vue

@ -1,20 +1,8 @@
<template> <template>
<el-dialog <el-dialog :visible.sync="visible" :title="$t('oss.upload')" :close-on-click-modal="false"
:visible.sync="visible" :close-on-press-escape="false">
:title="$t('oss.upload')" <el-upload :headers="$getElUploadHeaders()" :action="url" :file-list="fileList" drag multiple
:close-on-click-modal="false" :before-upload="beforeUploadHandle" :on-success="successHandle" class="text-center">
:close-on-press-escape="false"
>
<el-upload
:headers="$getElUploadHeaders()"
:action="url"
:file-list="fileList"
drag
multiple
:before-upload="beforeUploadHandle"
:on-success="successHandle"
class="text-center"
>
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text" v-html="$t('upload.text')"></div> <div class="el-upload__text" v-html="$t('upload.text')"></div>
<div class="el-upload__tip" slot="tip"> <div class="el-upload__tip" slot="tip">
@ -27,7 +15,7 @@
<script> <script>
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
export default { export default {
data() { data () {
return { return {
visible: false, visible: false,
url: '', url: '',
@ -36,16 +24,15 @@ export default {
} }
}, },
methods: { methods: {
init() { init () {
this.visible = true this.visible = true
this.url = `${ this.url = `${window.SITE_CONFIG['apiURL']
window.SITE_CONFIG['apiURL'] }/oss/file/upload?token=${Cookies.get('oper_token')}`
}/oss/file/upload?token=${Cookies.get('token')}`
this.num = 0 this.num = 0
this.fileList = [] this.fileList = []
}, },
// //
beforeUploadHandle(file) { beforeUploadHandle (file) {
if ( if (
file.type !== 'image/jpg' && file.type !== 'image/jpg' &&
file.type !== 'image/jpeg' && file.type !== 'image/jpeg' &&
@ -58,7 +45,7 @@ export default {
this.num++ this.num++
}, },
// //
successHandle(res, file, fileList) { successHandle (res, file, fileList) {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }

63
epmet-oper-web/src/views/modules/sys/news-add-or-update.vue

@ -1,47 +1,25 @@
<template> <template>
<el-dialog <el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false"
:visible.sync="visible" :close-on-press-escape="false">
:title="!dataForm.id ? $t('add') : $t('update')" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()"
:close-on-click-modal="false" label-width="120px">
:close-on-press-escape="false"
>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmitHandle()"
label-width="120px"
>
<el-form-item prop="title" :label="$t('news.title')"> <el-form-item prop="title" :label="$t('news.title')">
<el-input <el-input v-model="dataForm.title" :placeholder="$t('news.title')"></el-input>
v-model="dataForm.title"
:placeholder="$t('news.title')"
></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="content" :label="$t('news.content')"> <el-form-item prop="content" :label="$t('news.content')">
<!-- 富文本编辑器, 容器 --> <!-- 富文本编辑器, 容器 -->
<div id="J_quillEditor"></div> <div id="J_quillEditor"></div>
<!-- 自定义上传图片功能 (使用element upload组件) --> <!-- 自定义上传图片功能 (使用element upload组件) -->
<el-upload <el-upload :headers="$getElUploadHeaders()" :action="uploadUrl" :show-file-list="false"
:headers="$getElUploadHeaders()" :before-upload="uploadBeforeUploadHandle" :on-success="uploadSuccessHandle" style="display: none">
:action="uploadUrl"
:show-file-list="false"
:before-upload="uploadBeforeUploadHandle"
:on-success="uploadSuccessHandle"
style="display: none"
>
<el-button ref="uploadBtn" type="primary" size="small">{{ <el-button ref="uploadBtn" type="primary" size="small">{{
$t('upload.button') $t('upload.button')
}}</el-button> }}</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item prop="pubDate" :label="$t('news.pubDate')"> <el-form-item prop="pubDate" :label="$t('news.pubDate')">
<el-date-picker <el-date-picker v-model="dataForm.pubDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
v-model="dataForm.pubDate" :placeholder="$t('news.pubDate')"></el-date-picker>
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
:placeholder="$t('news.pubDate')"
></el-date-picker>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template slot="footer"> <template slot="footer">
@ -59,7 +37,7 @@ import debounce from 'lodash/debounce'
import 'quill/dist/quill.snow.css' import 'quill/dist/quill.snow.css'
import Quill from 'quill' import Quill from 'quill'
export default { export default {
data() { data () {
return { return {
visible: false, visible: false,
quillEditor: null, quillEditor: null,
@ -88,7 +66,7 @@ export default {
} }
}, },
computed: { computed: {
dataRule() { dataRule () {
var validateContent = (rule, value, callback) => { var validateContent = (rule, value, callback) => {
if (this.quillEditor.getLength() <= 1) { if (this.quillEditor.getLength() <= 1) {
return callback(new Error(this.$t('validate.required'))) return callback(new Error(this.$t('validate.required')))
@ -122,7 +100,7 @@ export default {
} }
}, },
methods: { methods: {
init() { init () {
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
if (this.quillEditor) { if (this.quillEditor) {
@ -137,7 +115,7 @@ export default {
}) })
}, },
// //
quillEditorHandle() { quillEditorHandle () {
this.quillEditor = new Quill('#J_quillEditor', { this.quillEditor = new Quill('#J_quillEditor', {
modules: { modules: {
toolbar: this.quillEditorToolbarOptions toolbar: this.quillEditorToolbarOptions
@ -145,9 +123,8 @@ export default {
theme: 'snow' theme: 'snow'
}) })
// (使element upload) // (使element upload)
this.uploadUrl = `${ this.uploadUrl = `${window.SITE_CONFIG['apiURL']
window.SITE_CONFIG['apiURL'] }/sys/oss/upload?token=${Cookies.get('oper_token')}`
}/sys/oss/upload?token=${Cookies.get('token')}`
this.quillEditor.getModule('toolbar').addHandler('image', () => { this.quillEditor.getModule('toolbar').addHandler('image', () => {
this.$refs.uploadBtn.$el.click() this.$refs.uploadBtn.$el.click()
}) })
@ -157,7 +134,7 @@ export default {
}) })
}, },
// //
uploadBeforeUploadHandle(file) { uploadBeforeUploadHandle (file) {
if ( if (
file.type !== 'image/jpg' && file.type !== 'image/jpg' &&
file.type !== 'image/jpeg' && file.type !== 'image/jpeg' &&
@ -169,7 +146,7 @@ export default {
} }
}, },
// //
uploadSuccessHandle(res, file, fileList) { uploadSuccessHandle (res, file, fileList) {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
@ -180,7 +157,7 @@ export default {
) )
}, },
// //
getInfo() { getInfo () {
this.$http this.$http
.get(`/sys/news/${this.dataForm.id}`) .get(`/sys/news/${this.dataForm.id}`)
.then(({ data: res }) => { .then(({ data: res }) => {
@ -190,7 +167,7 @@ export default {
this.dataForm = res.data this.dataForm = res.data
this.quillEditor.root.innerHTML = this.dataForm.content this.quillEditor.root.innerHTML = this.dataForm.content
}) })
.catch(() => {}) .catch(() => { })
}, },
// //
dataFormSubmitHandle: debounce( dataFormSubmitHandle: debounce(
@ -218,7 +195,7 @@ export default {
} }
}) })
}) })
.catch(() => {}) .catch(() => { })
}) })
}, },
1000, 1000,

178
epmet-oper-web/src/views/modules/sys/upgrade-version-history.vue

@ -1,7 +1,6 @@
<template> <template>
<div> <div>
<el-card shadow="never" <el-card shadow="never" class="aui-card--fill">
class="aui-card--fill">
<!-- 按钮 --> <!-- 按钮 -->
<div class="btn-group"> <div class="btn-group">
@ -12,9 +11,7 @@
<!-- 数据列表 --> <!-- 数据列表 -->
<div> <div>
<el-table :data="histories" border style="width: 100%"> <el-table :data="histories" border style="width: 100%">
<el-table-column <el-table-column prop="versionNo" label="版本">
prop="versionNo"
label="版本">
</el-table-column> </el-table-column>
<el-table-column label="操作" :width="250"> <el-table-column label="操作" :width="250">
<template slot-scope="scope"> <template slot-scope="scope">
@ -26,13 +23,8 @@
</div> </div>
<!-- 分页条--> <!-- 分页条-->
<el-pagination <el-pagination background layout="prev, pager, next" @current-change="onCurrentPageChanged"
background :current-page="this.pageArgs.pageNo" :page-size="this.pageArgs.pageSize" :total="this.pageArgs.total">
layout="prev, pager, next"
@current-change="onCurrentPageChanged"
:current-page="this.pageArgs.pageNo"
:page-size="this.pageArgs.pageSize"
:total="this.pageArgs.total">
</el-pagination> </el-pagination>
<!-- <Tinymce <!-- <Tinymce
@ -43,11 +35,8 @@
</el-card> </el-card>
<!-- 新增/修改 --> <!-- 新增/修改 -->
<el-dialog :visible.sync="publishVersionUpgradeShow" <el-dialog :visible.sync="publishVersionUpgradeShow" v-if="publishVersionUpgradeShow" :close-on-click-modal="false"
v-if="publishVersionUpgradeShow" :close-on-press-escape="false" :title="this.operation === 'create' ? '发布新版本' : '修改'">
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="this.operation === 'create' ? '发布新版本' : '修改'">
<el-form :model="createOrUpdateForm" ref="createOrUpdateForm"> <el-form :model="createOrUpdateForm" ref="createOrUpdateForm">
<el-form-item prop="versionNo" label="版本"> <el-form-item prop="versionNo" label="版本">
<el-input v-model="createOrUpdateForm.versionNo"> <el-input v-model="createOrUpdateForm.versionNo">
@ -56,23 +45,17 @@
<el-form-item prop="richContent" label="内容"> <el-form-item prop="richContent" label="内容">
<!-- <el-input v-model="createOrUpdateForm.richContent"> --> <!-- <el-input v-model="createOrUpdateForm.richContent"> -->
<!-- <Tinymce v-model="createOrUpdateForm.richContent" :height="300" placeholder="在这里输入文字" /> --> <!-- <Tinymce v-model="createOrUpdateForm.richContent" :height="300" placeholder="在这里输入文字" /> -->
<!-- :customerId="customerId" --> <!-- :customerId="customerId" -->
<div id="J_quillEditor"></div> <div id="J_quillEditor"></div>
<!-- 自定义上传图片功能 (使用element upload组件) --> <!-- 自定义上传图片功能 (使用element upload组件) -->
<el-upload <el-upload :headers="$getElUploadHeaders()" :action="uploadUrl" :show-file-list="false"
:headers="$getElUploadHeaders()" :before-upload="uploadBeforeUploadHandle" :on-success="uploadSuccessHandle" style="display: none">
:action="uploadUrl" <el-button ref="uploadBtn" type="primary" size="small">{{
:show-file-list="false" $t('upload.button')
:before-upload="uploadBeforeUploadHandle" }}</el-button>
:on-success="uploadSuccessHandle" </el-upload>
style="display: none"
>
<el-button ref="uploadBtn" type="primary" size="small">{{
$t('upload.button')
}}</el-button>
</el-upload>
<!-- </el-input> --> <!-- </el-input> -->
</el-form-item> </el-form-item>
<el-button @click="onSubmitBtnClick" type="primary">提交</el-button> <el-button @click="onSubmitBtnClick" type="primary">提交</el-button>
@ -91,13 +74,13 @@ export default {
components: {}, components: {},
activated() { activated () {
this.loadVersionUpgradeHistories(); this.loadVersionUpgradeHistories();
}, },
mounted(){ mounted () {
}, },
data() { data () {
return { return {
quillEditor: null, quillEditor: null,
quillEditorToolbarOptions: [ quillEditorToolbarOptions: [
@ -135,7 +118,7 @@ export default {
methods: { methods: {
// //
uploadBeforeUploadHandle(file) { uploadBeforeUploadHandle (file) {
if ( if (
file.type !== 'image/jpg' && file.type !== 'image/jpg' &&
file.type !== 'image/jpeg' && file.type !== 'image/jpeg' &&
@ -147,7 +130,7 @@ export default {
} }
}, },
// //
uploadSuccessHandle(res, file, fileList) { uploadSuccessHandle (res, file, fileList) {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
@ -158,7 +141,7 @@ export default {
) )
}, },
// //
initQuill() { initQuill () {
console.log(document.getElementById('J_quillEditor')); console.log(document.getElementById('J_quillEditor'));
this.quillEditor = new Quill('#J_quillEditor', { this.quillEditor = new Quill('#J_quillEditor', {
modules: { modules: {
@ -167,9 +150,8 @@ export default {
theme: 'snow' theme: 'snow'
}) })
// (使element upload) // (使element upload)
this.uploadUrl = `${ this.uploadUrl = `${window.SITE_CONFIG['apiURL']
window.SITE_CONFIG['apiURL'] }/oss/file/upload?token=${Cookies.get('oper_token')}`
}/oss/file/upload?token=${Cookies.get('token')}`
this.quillEditor.getModule('toolbar').addHandler('image', () => { this.quillEditor.getModule('toolbar').addHandler('image', () => {
this.$refs.uploadBtn.$el.click() this.$refs.uploadBtn.$el.click()
}) })
@ -181,31 +163,31 @@ export default {
/** /**
* 加载版本更新历史 * 加载版本更新历史
*/ */
loadVersionUpgradeHistories() { loadVersionUpgradeHistories () {
this.$http.get(`/sys/sysVersionUpgrade/page?pageNo=${this.pageArgs.pageNo}&pageSize=${this.pageArgs.pageSize}`) this.$http.get(`/sys/sysVersionUpgrade/page?pageNo=${this.pageArgs.pageNo}&pageSize=${this.pageArgs.pageSize}`)
.then(({data: result, status: httpStatus}) => { .then(({ data: result, status: httpStatus }) => {
if (result.code === 0) { if (result.code === 0) {
this.histories = result.data.list this.histories = result.data.list
this.pageArgs.total = result.data.total this.pageArgs.total = result.data.total
} else { } else {
this.$message({ this.$message({
type: 'error', type: 'error',
message: result.msg message: result.msg
}) })
} }
}) })
}, },
// //
onAddBtnClick() { onAddBtnClick () {
this.publishVersionUpgradeShow = true; this.publishVersionUpgradeShow = true;
this.operation = 'create'; this.operation = 'create';
this.$nextTick(()=>{ this.$nextTick(() => {
this.initQuill() this.initQuill()
}) })
}, },
// //
async onEditBtnClick(id) { async onEditBtnClick (id) {
this.publishVersionUpgradeShow = true; this.publishVersionUpgradeShow = true;
this.operation = 'edit'; this.operation = 'edit';
await this.getDetail(id); await this.getDetail(id);
@ -213,7 +195,7 @@ export default {
}, },
onCancelBtnClick() { onCancelBtnClick () {
this.$refs['createOrUpdateForm'].resetFields(); this.$refs['createOrUpdateForm'].resetFields();
this.publishVersionUpgradeShow = false; this.publishVersionUpgradeShow = false;
this.operation = null; this.operation = null;
@ -223,7 +205,7 @@ export default {
/** /**
* 翻页 * 翻页
*/ */
onCurrentPageChanged(pageNo) { onCurrentPageChanged (pageNo) {
this.pageArgs.pageNo = pageNo this.pageArgs.pageNo = pageNo
this.loadVersionUpgradeHistories() this.loadVersionUpgradeHistories()
}, },
@ -231,63 +213,63 @@ export default {
/** /**
* 提交 * 提交
*/ */
onSubmitBtnClick() { onSubmitBtnClick () {
let url = this.operation === 'create' ? `/sys/sysVersionUpgrade/publish` : '/sys/sysVersionUpgrade/update'; let url = this.operation === 'create' ? `/sys/sysVersionUpgrade/publish` : '/sys/sysVersionUpgrade/update';
this.$http.post(url, this.$data.createOrUpdateForm) this.$http.post(url, this.$data.createOrUpdateForm)
.then(({data: rst, status: httpStatus}) => { .then(({ data: rst, status: httpStatus }) => {
if (httpStatus !== 200) { if (httpStatus !== 200) {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '请求失败' message: '请求失败'
}) })
} else if (rst.code !== 0) { } else if (rst.code !== 0) {
this.$message({ this.$message({
type: 'error', type: 'error',
message: rst.msg message: rst.msg
}); });
} else { } else {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '提交成功' message: '提交成功'
}); });
this.$refs['createOrUpdateForm'].resetFields(); this.$refs['createOrUpdateForm'].resetFields();
this.publishVersionUpgradeShow = false; this.publishVersionUpgradeShow = false;
this.loadVersionUpgradeHistories(); this.loadVersionUpgradeHistories();
} }
}) })
}, },
/** /**
* 加载详情 * 加载详情
* @param id * @param id
*/ */
getDetail(id) { getDetail (id) {
this.$http.get(`/sys/sysVersionUpgrade/detail/${id}`) this.$http.get(`/sys/sysVersionUpgrade/detail/${id}`)
.then(({status: httpStatus, data: epmetRst}) => { .then(({ status: httpStatus, data: epmetRst }) => {
if (httpStatus !== 200) { if (httpStatus !== 200) {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '请求失败' message: '请求失败'
}) })
} else if (epmetRst.code != 0) { } else if (epmetRst.code != 0) {
this.$message({ this.$message({
type: 'error', type: 'error',
message: epmetRst.msg message: epmetRst.msg
}) })
} else { } else {
this.createOrUpdateForm = epmetRst.data; this.createOrUpdateForm = epmetRst.data;
this.quillEditor.root.innerHTML = this.createOrUpdateForm.richContent this.quillEditor.root.innerHTML = this.createOrUpdateForm.richContent
} }
}) })
} }
} }
} }
</script> </script>
<style scoped lang="css"> <style scoped lang="css">
::v-deep .ql-toolbar{ ::v-deep .ql-toolbar {
margin-top: 36px; margin-top: 36px;
} }
</style> </style>

54
epmet-oper-web/src/views/pages/login.vue

@ -7,13 +7,8 @@
</div> </div>
<div class="login-body"> <div class="login-body">
<h3 class="login-title">{{ $t('login.title') }}</h3> <h3 class="login-title">{{ $t('login.title') }}</h3>
<el-form <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()"
:model="dataForm" status-icon>
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmitHandle()"
status-icon
>
<!-- <el-form-item> <!-- <el-form-item>
<el-select v-model="$i18n.locale" <el-select v-model="$i18n.locale"
class="w-percent-100"> class="w-percent-100">
@ -33,11 +28,7 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
<el-input <el-input v-model="dataForm.password" type="password" :placeholder="$t('login.password')">
v-model="dataForm.password"
type="password"
:placeholder="$t('login.password')"
>
<span slot="prefix" class="el-input__icon"> <span slot="prefix" class="el-input__icon">
<svg class="icon-svg" aria-hidden="true"> <svg class="icon-svg" aria-hidden="true">
<use xlink:href="#icon-lock"></use> <use xlink:href="#icon-lock"></use>
@ -48,10 +39,7 @@
<el-form-item prop="captcha"> <el-form-item prop="captcha">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="14"> <el-col :span="14">
<el-input <el-input v-model="dataForm.captcha" :placeholder="$t('login.captcha')">
v-model="dataForm.captcha"
:placeholder="$t('login.captcha')"
>
<span slot="prefix" class="el-input__icon"> <span slot="prefix" class="el-input__icon">
<svg class="icon-svg" aria-hidden="true"> <svg class="icon-svg" aria-hidden="true">
<use xlink:href="#icon-safetycertificate"></use> <use xlink:href="#icon-safetycertificate"></use>
@ -65,22 +53,14 @@
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" @click="dataFormSubmitHandle()" class="w-percent-100">{{ $t('login.title')
type="primary" }}</el-button>
@click="dataFormSubmitHandle()"
class="w-percent-100"
>{{ $t('login.title') }}</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div class="login-footer"> <div class="login-footer">
<p> <p>
<a <a href="https://demo.cloud.renren.io/renren-cloud" target="_blank">{{ $t('login.demo') }}</a>
href="https://demo.cloud.renren.io/renren-cloud"
target="_blank"
>{{ $t('login.demo') }}</a
>
</p> </p>
<!-- 2020 © renren.io --> <!-- 2020 © renren.io -->
<p> <p>
@ -100,7 +80,7 @@ import debounce from 'lodash/debounce'
import { messages } from '@/i18n' import { messages } from '@/i18n'
import { getUUID, encryptedData } from '@/utils' import { getUUID, encryptedData } from '@/utils'
export default { export default {
data() { data () {
return { return {
i18nMessages: messages, i18nMessages: messages,
captchaPath: '', captchaPath: '',
@ -117,7 +97,7 @@ export default {
} }
}, },
computed: { computed: {
dataRule() { dataRule () {
return { return {
phone: [{ required: true, message: '手机号不能为空', trigger: 'blur' }], phone: [{ required: true, message: '手机号不能为空', trigger: 'blur' }],
password: [ password: [
@ -129,7 +109,7 @@ export default {
} }
} }
}, },
created() { created () {
this.getCaptcha() this.getCaptcha()
// //
@ -137,13 +117,13 @@ export default {
}, },
methods: { methods: {
// //
getCaptcha() { getCaptcha () {
this.dataForm.uuid = getUUID() this.dataForm.uuid = getUUID()
this.captchaPath = `${window.SITE_CONFIG['apiURL']}/auth/login/captcha?uuid=${this.dataForm.uuid}` this.captchaPath = `${window.SITE_CONFIG['apiURL']}/auth/login/captcha?uuid=${this.dataForm.uuid}`
}, },
// //
getPubKey() { getPubKey () {
this.$http this.$http
.post('/auth/govweb/getKey') .post('/auth/govweb/getKey')
.then(({ data: res }) => { .then(({ data: res }) => {
@ -153,7 +133,7 @@ export default {
this.pubKey = res.data // ; this.pubKey = res.data // ;
}) })
.catch(() => {}) .catch(() => { })
}, },
// //
@ -177,11 +157,11 @@ export default {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
localStorage.setItem('userType', 'oper') localStorage.setItem('userType', 'oper')
localStorage.setItem('token', res.data.token) localStorage.setItem('oper_token', res.data.token)
Cookies.set('token', res.data.token) Cookies.set('oper_token', res.data.token)
this.$router.replace({ name: 'home' }).catch(() => {}) this.$router.replace({ name: 'home' }).catch(() => { })
}) })
.catch(() => {}) .catch(() => { })
}) })
}, },
1000, 1000,

Loading…
Cancel
Save