Browse Source

优化部分业务逻辑

master
李磊 3 years ago
parent
commit
d96b98e731
  1. 2
      src/api/common.js
  2. 10
      src/api/template.js
  3. 340
      src/components/drawerDialog/index.vue
  4. 8
      src/store/modules/user.js
  5. 29
      src/views/bjd/dj_list.vue
  6. 52
      src/views/flow/template.vue
  7. 14
      src/views/monitor/log_info.vue
  8. 11
      src/views/preview/hzd.vue
  9. 13
      src/views/user/permission.vue
  10. 2
      src/views/user/role.vue
  11. 2
      src/views/user/user.vue

2
src/api/common.js

@ -115,7 +115,7 @@ export function cancelRenwuFn(params) {
} }
export function initData(params) { export function initData(params) {
return api({ return api({
url: '/role/listRole', url: '/role/list',
method: 'get', method: 'get',
params: params, params: params,
paramsSerializer: function(data) { paramsSerializer: function(data) {

10
src/api/template.js

@ -13,7 +13,10 @@ export default {
return api({ return api({
url: '/templateSetting', url: '/templateSetting',
method: 'delete', method: 'delete',
params: qs.stringify(params) params,
paramsSerializer: function(params) {
return qs.stringify(params, { indices: false })
}
}) })
}, },
deleteSettingFn: (params) => { deleteSettingFn: (params) => {
@ -21,7 +24,10 @@ export default {
return api({ return api({
url: '/templateSetting', url: '/templateSetting',
method: 'delete', method: 'delete',
params: qs.stringify(params) params,
paramsSerializer: function(params) {
return qs.stringify(params, { indices: false })
}
}) })
} }
} }

340
src/components/drawerDialog/index.vue

@ -4,7 +4,7 @@
title="编辑模板" title="编辑模板"
:visible.sync="drawer" :visible.sync="drawer"
size="90%" size="90%"
show- :before-close="(done) => { $emit('closeTemplateDrawer') }"
@open="open" @open="open"
> >
<div class="root"> <div class="root">
@ -112,6 +112,8 @@
v-model="sbpzLevelStatus" v-model="sbpzLevelStatus"
active-color="#13ce66" active-color="#13ce66"
inactive-color="#ff4949" inactive-color="#ff4949"
active-text="类别品种"
inactive-text="所有品种"
@change="getSbpzList" @change="getSbpzList"
/> />
</el-form-item> </el-form-item>
@ -198,7 +200,7 @@
<el-button type="primary" @click="update"> <el-button type="primary" @click="update">
保存修改 保存修改
</el-button> </el-button>
<el-button @click="drawer = false"> <el-button @click="$emit('closeTemplateDrawer')">
取消 取消
</el-button> </el-button>
</div> </div>
@ -207,7 +209,7 @@
<div class="boxRoot"> <div class="boxRoot">
<div class="left"> <div class="left">
<div class="funbox"> <div class="funbox">
<p>模板详情</p> <span>模板详情</span>
<el-button <el-button
type="primary" type="primary"
icon="el-icon-plus" icon="el-icon-plus"
@ -225,33 +227,60 @@
highlight-current-row highlight-current-row
@current-change="rowClick" @current-change="rowClick"
> >
<el-table-column align="center" label="序号" width="50"> <el-table-column align="center" label="序号" width="50" type="index" />
<el-table-column align="center" label="检验项目索引" prop="sort" />
<el-table-column
align="center"
label="表格索引"
prop="tableIndex"
/>
<el-table-column
align="center"
label="表格模式"
width="150"
prop="tableMode"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span v-text="getIndex(scope.$index)" /> <div>
{{ scope.row.tableMode === 1 ? "DN模式" : "KV模式" }}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
label="检验项目行个数" label="写入模式"
prop="affiliatedTableRowCount" width="150"
prop="writeMode"
>
<template slot-scope="scope">
<div>
{{ scope.row.writeMode && writeModes[scope.row.writeMode - 1] }}
</div>
</template>
</el-table-column>
<el-table-column
align="center"
label="首页检验项目起始页码"
prop="tableStartRow"
width="100" width="100"
/> />
<el-table-column <el-table-column
align="center" align="center"
label="检验项目起始页码" label="首页检验项目行个数"
prop="tableStartRow" prop="tableRowCount"
width="100" width="100"
/> />
<el-table-column <el-table-column
align="center" align="center"
label="检验项目起始行" label="附页检验项目起始行"
prop="affiliatedTableStartRow" prop="affiliatedTableStartRow"
width="100" width="100"
/> />
<el-table-column <el-table-column
align="left" align="center"
label="表格索引" label="附页检验项目行个数"
prop="tableIndex" prop="affiliatedTableRowCount"
width="100"
/> />
<el-table-column <el-table-column
:formatter="fmBglx" :formatter="fmBglx"
@ -262,7 +291,7 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
{{ scope.row.tableType == 1 ? "检验项目" : "目录页" }} {{ scope.row.tableType === 1 ? "检验项目" : "目录页" }}
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -277,19 +306,6 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
align="center"
label="表格模式"
width="150"
prop="tableMode"
>
<template slot-scope="scope">
<div>
{{ scope.row.tableMode == 1 ? "DN模式" : "KV模式" }}
</div>
</template>
</el-table-column>
<el-table-column align="center" label="排序" prop="sort" />
<el-table-column <el-table-column
align="center" align="center"
label="操作" label="操作"
@ -310,7 +326,7 @@
size="mini" size="mini"
icon="el-icon-delete" icon="el-icon-delete"
circle circle
title="编辑" title="删除"
@click="deleteModelFn(scope.row)" @click="deleteModelFn(scope.row)"
/> />
</template> </template>
@ -328,7 +344,7 @@
</div> </div>
<div class="right"> <div class="right">
<div class="funbox"> <div class="funbox">
<p>模板详情</p> <span>模板详情</span>
<el-button <el-button
type="primary" type="primary"
icon="el-icon-plus" icon="el-icon-plus"
@ -399,23 +415,32 @@
</el-tabs> </el-tabs>
</div> </div>
</el-drawer> </el-drawer>
<el-dialog title="新增" :visible.sync="dialogVisible" width="30%"> <el-dialog title="新增" :visible.sync="dialogVisible" width="37%">
<el-form label-width="80px" :model="formLabelAlign"> <el-form ref="templateJyxmForm" label-width="120px" :model="formLabelAlign">
<el-form-item <el-form-item
label="列名称" label="列对应的字段"
:rules="[{ required: true, message: '请输入列名', trigger: 'blur' }]" prop="field"
:rules="[{ required: true, message: '请输入字段名', trigger: 'blur' }]"
> >
<el-input v-model="formLabelAlign.field" /> <el-input v-model="formLabelAlign.field" />
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="排序" label="从右往左数对应的索引"
label-width="170px"
prod="indexFromRight"
:rules="[ :rules="[
{ required: true, message: '请输入排序', trigger: 'blur' }, { required: true, message: '请输入对应索引', trigger: 'blur' },
]" ]"
> >
<el-input-number v-model="formLabelAlign.indexFromRight" :min="1" :max="10" label="索引" /> <el-input-number v-model="formLabelAlign.indexFromRight" :min="1" :max="10" label="索引" />
<el-alert
type="warning"
title="从1开始数"
style="display: inline"
:closable="false"
/>
</el-form-item> </el-form-item>
<el-form-item label="模式"> <el-form-item label="字段模式" prop="fieldMode">
<el-radio-group v-model="formLabelAlign.fieldMode"> <el-radio-group v-model="formLabelAlign.fieldMode">
<el-radio :label="0"> <el-radio :label="0">
普通模式 普通模式
@ -434,97 +459,155 @@
<el-button type="primary" @click="onsubmit"> </el-button> <el-button type="primary" @click="onsubmit"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="新增" :visible.sync="dialogVisible1" width="50%"> <el-dialog title="新增" :visible.sync="dialogVisible1" width="50%" @close="close">
<el-form> <el-form ref="templateSettingForm" :model="form">
<el-form-item label="检验项目索引" prop="sort" label-width="150px">
<el-input-number v-model="form.sort" :min="0" :max="100" />
<el-alert
type="warning"
title="从1开始数"
style="display: inline"
:closable="false"
/>
</el-form-item>
<el-form-item <el-form-item
label="检验项目行个数" label="表格模式"
prop="tableRowCount" prop="tableMode"
label-width="150px"
>
<el-radio-group v-model="form.tableMode" @change="changeTableMode">
<el-radio :label="1">
DN模式
</el-radio>
<el-radio :label="2">
KV模式
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label="写入模式"
prop="writeMode"
label-width="150px"
>
<el-radio-group v-model="form.writeMode" @change="changeWriteMode">
<el-radio v-for="(item, writeModeIndex) in writeModes" :key="writeModeIndex" :label="writeModeIndex + 1" :disabled="form.tableMode === 2">
{{ item }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label="表格索引"
prop="tableIndex"
label-width="150px" label-width="150px"
> >
<el-input-number <el-input-number
v-model="form.affiliatedTableRowCount" v-model="form.tableIndex"
:min="0" :min="0"
:max="100" :max="100"
:disabled="form.tableMode === 2"
/>
<el-alert
type="warning"
title="从1开始数"
style="display: inline"
:closable="false"
/> />
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="检验项目起始行" label="首页检验项目起始行"
prop="affiliatedTableStartRow" prop="tableStartRow"
label-width="150px" label-width="150px"
> >
<el-input-number <el-input-number
v-model="form.affiliatedTableStartRow" v-model="form.tableStartRow"
:min="0" :min="0"
:max="100" :max="100"
:disabled="form.tableMode === 2"
/>
<el-alert
type="warning"
title="从1开始数"
style="display: inline"
:closable="false"
/> />
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="检验项目起始页码" label="首页检验项目行个数"
prop="tableStartRow" prop="tableRowCount"
label-width="150px" label-width="150px"
> >
<el-input-number <el-input-number
v-model="form.tableStartRow" v-model="form.tableRowCount"
:min="0" :min="0"
:max="100" :max="100"
:disabled="form.tableMode === 2"
/> />
<el-alert <el-alert
type="warning" type="warning"
title="建议先尝试如果是第1页则为1!" title="从1开始数"
style="display: inline" style="display: inline"
:closable="false" :closable="false"
/> />
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="表格索引" label="附页检验项目起始行"
prop="tableIndex" prop="affiliatedTableStartRow"
label-width="150px" label-width="150px"
> >
<el-input-number <el-input-number
v-model="form.tableIndex" v-model="form.affiliatedTableStartRow"
:min="0" :min="0"
:max="100" :max="100"
:disabled="form.tableMode === 2"
/>
<el-alert
type="warning"
title="从1开始数"
style="display: inline"
:closable="false"
/> />
</el-form-item> </el-form-item>
<el-form-item label="排序" prop="sort" label-width="150px"> <el-form-item
<el-input-number v-model="form.sort" :min="0" :max="100" /> label="附页检验项目行个数"
prop="affiliatedTableRowCount"
label-width="150px"
>
<el-input-number
v-model="form.affiliatedTableRowCount"
:min="0"
:max="100"
:disabled="form.tableMode === 2"
/>
<el-alert
type="warning"
title="从1开始数"
style="display: inline"
:closable="false"
/>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="表格类型" label="表格类型"
prop="form.tableType" prop="tableType"
label-width="150px" label-width="150px"
> >
<el-radio v-model="form.tableType" label="1"> <el-radio v-model="form.tableType" :label="1">
检验项目 检验项目
</el-radio> </el-radio>
<el-radio v-model="form.tableType" label="2"> <el-radio v-model="form.tableType" :label="2">
目录页 目录页
</el-radio> </el-radio>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="是否是子报告模板" label="是否是子报告模板"
prop="isChild" prop="isChild"
label-width="150px" label-width="150px"
> >
<el-switch <el-switch
v-model="form.showPageStatus" v-model="form.isChild"
active-text="是" active-text="是"
inactive-text="不是" inactive-text="不是"
/> />
</el-form-item> </el-form-item>
<el-form-item
label="表格类型"
prop="form.tableMode"
label-width="150px"
>
<el-radio v-model="form.tableMode" label="1">
DN模式
</el-radio>
<el-radio v-model="form.tableMode" label="2">
KV模式
</el-radio>
</el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible1 = false"> </el-button> <el-button @click="dialogVisible1 = false"> </el-button>
@ -535,7 +618,7 @@
</template> </template>
<script> <script>
import Pagination from '@/components/Pagination' import Pagination from '@/components/Pagination'
import { deleteSettingFn, deleteModuleFn } from '@/api/template.js' import TemplateApi from '@/api/template'
export default { export default {
components: { Pagination }, components: { Pagination },
@ -555,6 +638,10 @@ export default {
templateList: { templateList: {
type: Array, type: Array,
default: () => [] default: () => []
},
parentList: {
type: Array,
default: () => []
} }
}, },
data() { data() {
@ -566,23 +653,23 @@ export default {
dialogVisible1: false, dialogVisible1: false,
formLabelAlign: { formLabelAlign: {
field: '', field: '',
fieldMode: '', fieldMode: '1',
indexFromRight: '', indexFromRight: '',
templateId: '', // id templateId: '', // id
templateSettingId: '' // id templateSettingId: '' // id
}, },
form: { form: {
affiliatedTableRowCount: '',
affiliatedTableStartRow: '',
isChild: '',
sort: '',
tableIndex: '',
tableMode: '',
tableRowCount: '',
tableStartRow: '',
templateId: '', templateId: '',
tableType: '1', writeMode: 1,
writeMode: '1' tableIndex: 1,
tableMode: 1,
tableStartRow: 0,
tableRowCount: 0,
affiliatedTableStartRow: 0,
affiliatedTableRowCount: 0,
sort: 1,
tableType: 1,
isChild: false
}, },
// formTemplate:{}, // formTemplate:{},
dialogVisible: false, dialogVisible: false,
@ -603,7 +690,6 @@ export default {
neibuleibie: [], neibuleibie: [],
nblbList: [], nblbList: [],
dicCodeList: [], dicCodeList: [],
parentList: [],
options: [], options: [],
sbzlList: [], sbzlList: [],
shebeipinzhongdaima: [], shebeipinzhongdaima: [],
@ -612,10 +698,7 @@ export default {
totalCount: 0, totalCount: 0,
listQuery: { listQuery: {
pageNum: 1, // pageNum: 1, //
pageRow: 20, // pageRow: 20 //
searchTemplate: {
neibuleibie: null
}
}, },
list: [], list: [],
gridData: [], gridData: [],
@ -628,11 +711,50 @@ export default {
templateId: '', templateId: '',
templateSettingId: '' templateSettingId: ''
}, },
totalCount1: 0 totalCount1: 0,
writeModes: ['DN模式', 'KV模式', 'CFI模式', 'SA模式']
} }
}, },
mounted() {}, mounted() {},
methods: { methods: {
changeTableMode() {
switch (this.form.tableMode) {
case 1:
this.form.writeMode = 1
break
case 2:
default:
this.form.writeMode = 2
this.form.tableIndex = 0
this.form.tableStartRow = 0
this.form.tableRowCount = 0
this.form.affiliatedTableStartRow = 0
this.form.affiliatedTableRowCount = 0
break
}
},
changeWriteMode() {
switch (this.form.writeMode) {
case 1:
case 3:
case 4:
this.form.tableMode = 1
break
case 2:
this.form.tableMode = 2
this.form.tableIndex = 0
this.form.tableStartRow = 0
this.form.tableRowCount = 0
this.form.affiliatedTableStartRow = 0
this.form.affiliatedTableRowCount = 0
break
default:
break
}
},
close() {
this.$refs.templateSettingForm.resetFields()
},
open() { open() {
console.log(this.id, 'hahahh') console.log(this.id, 'hahahh')
this.listQuery.templateId = this.id this.listQuery.templateId = this.id
@ -652,19 +774,18 @@ export default {
this.dialogVisible1 = true this.dialogVisible1 = true
}, },
editFnTem(row) { editFnTem(row) {
this.dialogVisible1 = true
row.tableType = row.tableType + ''
row.tableMode = row.tableMode + ''
this.form = row this.form = row
this.dialogVisible1 = true
}, },
addtemFn() { addtemFn() {
this.$refs.templateJyxmForm.resetFields()
this.dialogVisible = true this.dialogVisible = true
}, },
changeState() {}, changeState() {},
getList() { getList() {
// //
this.api({ this.api({
url: '/templateSetting/getList', url: '/templateSetting/list',
method: 'get', method: 'get',
params: this.listQuery params: this.listQuery
}).then((data) => { }).then((data) => {
@ -673,15 +794,15 @@ export default {
// }) // })
this.list = data.list this.list = data.list
this.totalCount = data.total * 1 this.totalCount = data.total * 1
if (data.list[0]) {
this.getDemoList(data.list[0].id) this.getDemoList(data.list[0].id)
this.templateSettingId = data.list[0].id this.templateSettingId = data.list[0].id
}
}) })
}, },
deleteModelFn(row) { deleteModelFn(row) {
const arr = [] TemplateApi.deleteModuleFn({
arr.push(row.id) ids: [row.id]
deleteModuleFn({
id: arr
}).then((data) => { }).then((data) => {
this.getList() this.getList()
}) })
@ -689,17 +810,8 @@ export default {
deleteFn(row, index) { deleteFn(row, index) {
const arr = [] const arr = []
arr.push(row.id) arr.push(row.id)
// this.api({ TemplateApi.deleteSettingFn({
// url: '/templateJyxm', ids: arr
// method: 'delete',
// params: {
// id: arr
// }
// }).then((data) => {
// this.getDemoList()
// })
deleteSettingFn({
id: arr
}).then((data) => { }).then((data) => {
this.getDemoList() this.getDemoList()
}) })
@ -713,7 +825,7 @@ export default {
this.jyxmParams.templateSettingId = id this.jyxmParams.templateSettingId = id
this.jyxmParams.templateId = this.id this.jyxmParams.templateId = this.id
this.api({ this.api({
url: '/templateJyxm/getList', url: '/templateJyxm/list',
method: 'get', method: 'get',
params: this.jyxmParams params: this.jyxmParams
}).then((data) => { }).then((data) => {
@ -759,7 +871,7 @@ export default {
onsubmit1() { onsubmit1() {
this.api({ this.api({
url: '/templateSetting', url: '/templateSetting',
method: 'post', method: this.form.id ? 'put' : 'post',
data: this.form data: this.form
}).then((res) => { }).then((res) => {
this.dialogVisible1 = false this.dialogVisible1 = false
@ -939,18 +1051,18 @@ export default {
url: '/template', url: '/template',
method: 'put', method: 'put',
data: this.formTemplate data: this.formTemplate
}).then((data) => { }).then(_ => {
this.drawer = false this.$emit('closeTemplateDrawer')
}) })
}, },
rowClick(row) { rowClick(row) {
console.log(row, '选择') console.log(row, '选择')
if (!row) {
return false
}
this.templateSettingId = row.id this.templateSettingId = row.id
this.$refs.settingList.toggleRowSelection(row) this.$refs.settingList.toggleRowSelection(row)
this.getDemoList(row.id) this.getDemoList(row.id)
},
addFn() {
this.dialogVisible1 = true
} }
} }
} }

8
src/store/modules/user.js

@ -104,7 +104,7 @@ const user = {
}).then(data => { }).then(data => {
// 获取全部用户 // 获取全部用户
api({ api({
url: '/user/getAllUserList', url: '/user/all',
method: 'get' method: 'get'
}).then(data => { }).then(data => {
user.state.allUser = data user.state.allUser = data
@ -113,7 +113,7 @@ const user = {
}) })
// 获取全部设备种类 // 获取全部设备种类
api({ api({
url: '/category/getAllCategory', url: '/category/all',
method: 'get' method: 'get'
}).then(data => { }).then(data => {
user.state.allCategory = data user.state.allCategory = data
@ -199,9 +199,7 @@ const user = {
getNeedRecordList({ // 待审报告列表 getNeedRecordList({ // 待审报告列表
pageNum: 1, // 页码 pageNum: 1, // 页码
pageRow: 20, // 每页条数 pageRow: 20, // 每页条数
searchYsjl: { hasTrial: true,
hasTrial: true
},
hasChild: true, hasChild: true,
hasFinish: false hasFinish: false
}).then((ysjl) => { }).then((ysjl) => {

29
src/views/bjd/dj_list.vue

@ -190,6 +190,8 @@
import Sticky from '@/components/Sticky' import Sticky from '@/components/Sticky'
import Pagination from '@/components/Pagination' import Pagination from '@/components/Pagination'
import store from '../../store' import store from '../../store'
import router from '@/router'
import Vue from 'vue'
// import router from '../../router' // import router from '../../router'
export default { export default {
name: 'ProjectDJList', name: 'ProjectDJList',
@ -449,27 +451,24 @@ export default {
}) })
}) })
}, },
viewHzd(bjdid) { viewHzd(bjdId) {
this.apibjd({ this.preview({
url: '/bjd/printHzd', url: '/print/generatePdfHzd',
method: 'get', method: 'get',
params: { params: {
bjdIds: bjdid bjdId: bjdId
}
}).then(data => {
this.preview({
url: '/print/generatePdfListing',
method: 'post',
data: {
info: data.bjd,
paramList: data.renwu,
viewType: 'HZD'
} }
}).then(data => { }).then(data => {
data = data.replace(/\\/g, '/') data = data.replace(/\\/g, '/')
// router.push({ path: '/preview/1/1/urlPath?src=' + store.getters.prodName + '/static/web/viewer.html?file=' + encodeURIComponent(data) + '&v=' + Math.random() }) if (data) {
window.open(data) router.push({ path: '/preview/hzd?src=' + this.$store.getters.prodName + '/static/web/viewer.html?file=' + encodeURIComponent(data) })
} else {
Vue.prototype.$message({
message: 'PDF预览错误!',
type: 'error',
duration: 3 * 1000
}) })
}
}) })
}, },
errorBjd() { errorBjd() {

52
src/views/flow/template.vue

@ -4,13 +4,13 @@
<el-form> <el-form>
<el-form-item> <el-form-item>
<el-input <el-input
v-model="listQuery.searchTemplate.tempName" v-model="listQuery.tempName"
placeholder="模板名称" placeholder="模板名称"
style="width: 200px" style="width: 200px"
@keyup.enter.native="handleFilter" @keyup.enter.native="handleFilter"
/> />
<el-select <el-select
v-model="listQuery.searchTemplate.jianyanleibie" v-model="listQuery.jianyanleibie"
placeholder="请选择检验类别" placeholder="请选择检验类别"
style="width: 150px" style="width: 150px"
clearable clearable
@ -24,7 +24,7 @@
/> />
</el-select> </el-select>
<el-select <el-select
v-model="listQuery.searchTemplate.shebeizhongleidaima" v-model="listQuery.shebeizhongleidaima"
placeholder="请选择设备种类" placeholder="请选择设备种类"
style="width: 150px" style="width: 150px"
clearable clearable
@ -38,7 +38,7 @@
/> />
</el-select> </el-select>
<el-select <el-select
v-model="listQuery.searchTemplate.neibuleibie" v-model="listQuery.neibuleibie"
placeholder="请选择内部类别" placeholder="请选择内部类别"
style="width: 150px" style="width: 150px"
clearable clearable
@ -51,7 +51,7 @@
/> />
</el-select> </el-select>
<el-select <el-select
v-model="listQuery.searchTemplate.bglx" v-model="listQuery.bglx"
placeholder="请选择类型" placeholder="请选择类型"
style="width: 120px" style="width: 120px"
clearable clearable
@ -235,7 +235,7 @@
</el-button> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<drawerDialog :id="id" :drawer="drawer" :index="templateIndex" :template-list="list" /> <drawerDialog :id="id" :drawer.sync="drawer" :index="templateIndex" :template-list="list" :parent-list="parentList" @closeTemplateDrawer="closeTemplateDrawer" />
</div> </div>
</template> </template>
<script> <script>
@ -251,9 +251,7 @@ export default {
listQuery: { listQuery: {
pageNum: 1, // pageNum: 1, //
pageRow: 20, // pageRow: 20, //
searchTemplate: {
neibuleibie: null neibuleibie: null
}
}, },
drawer: false, drawer: false,
dialogVisible: false, dialogVisible: false,
@ -290,7 +288,7 @@ export default {
dialogStatus: 'create', dialogStatus: 'create',
multipleSelection: [], multipleSelection: [],
shebeipinzhongdaima: [], shebeipinzhongdaima: [],
id: '', id: 0,
checkedId: '', checkedId: '',
neibuleibie: [], neibuleibie: [],
dialogConvertVisible: false, dialogConvertVisible: false,
@ -310,6 +308,9 @@ export default {
this.getTemplateIdentification() this.getTemplateIdentification()
}, },
methods: { methods: {
closeTemplateDrawer() {
this.drawer = false
},
// //
getTemplateIdentification() { getTemplateIdentification() {
this.api({ this.api({
@ -331,7 +332,7 @@ export default {
}).then((data) => { }).then((data) => {
this.list = data.list this.list = data.list
console.log(data, '返回参数') console.log(data, '返回参数')
this.totalCount = data.total * 1 this.totalCount = data.total
}) })
}, },
getSblbList(val) { getSblbList(val) {
@ -412,7 +413,7 @@ export default {
this.getCategoryList('jylb', null, null) this.getCategoryList('jylb', null, null)
}, },
getNblbListBySbzl(val) { getNblbListBySbzl(val) {
const jylb = this.listQuery.searchTemplate.jianyanleibie const jylb = this.listQuery.jianyanleibie
if ( if (
val !== undefined && val !== undefined &&
val !== '' && val !== '' &&
@ -421,11 +422,11 @@ export default {
this.$message.warning('选择内部类别,请先选择检验类别') this.$message.warning('选择内部类别,请先选择检验类别')
return false return false
} }
this.listQuery.searchTemplate.neibuleibie = null this.listQuery.neibuleibie = null
this.getCategoryList('nblb', jylb, val) this.getCategoryList('nblb', jylb, val)
}, },
getNblbListBySearchJylb(val) { getNblbListBySearchJylb(val) {
const sbzl = this.listQuery.searchTemplate.shebeizhongleidaima const sbzl = this.listQuery.shebeizhongleidaima
if ( if (
val !== undefined && val !== undefined &&
val !== '' && val !== '' &&
@ -434,7 +435,7 @@ export default {
this.$message.warning('请选择设备种类') this.$message.warning('请选择设备种类')
return false return false
} }
this.listQuery.searchTemplate.neibuleibie = null this.listQuery.neibuleibie = null
this.getCategoryList('nblb', val, sbzl) this.getCategoryList('nblb', val, sbzl)
}, },
getNblbListByJylb(val) { getNblbListByJylb(val) {
@ -592,7 +593,6 @@ export default {
handleSelectionChange: function(val) { handleSelectionChange: function(val) {
this.multipleSelection = val this.multipleSelection = val
}, },
createTemplate() { createTemplate() {
// //
this.$refs['formTemplate'].validate((valid) => { this.$refs['formTemplate'].validate((valid) => {
@ -638,23 +638,19 @@ export default {
}) })
}, },
deleteTemplate() { deleteTemplate() {
this.id = ''
for (let i = 0; i < this.multipleSelection.length; i++) {
this.id = this.multipleSelection[i].id + ',' + this.id
if (i + 1 === this.multipleSelection.length) {
this.id = this.id.substring(0, this.id.length - 1)
}
}
this.$confirm('确定删除当前选中记录?', '提示', { this.$confirm('确定删除当前选中记录?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
showCancelButton: true, showCancelButton: true,
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.api({ this.api({
url: '/template/delTemplate', url: '/template',
method: 'post', method: 'delete',
data: { params: {
ids: this.id ids: this.$refs.list.selection.map(row => row.id)
},
paramsSerializer: function(params) {
return require('qs').stringify(params, { indices: false })
} }
}).then(() => { }).then(() => {
this.$message({ this.$message({
@ -671,8 +667,8 @@ export default {
editStatus($index) { editStatus($index) {
const template = this.list[$index] const template = this.list[$index]
this.api({ this.api({
url: '/template/update', url: '/template',
method: 'post', method: 'put',
data: template data: template
}).then(() => { }).then(() => {
this.getList() this.getList()

14
src/views/monitor/log_info.vue

@ -6,6 +6,15 @@
<el-input v-model="listQuery.createBy" placeholder="用户名" style="width: 150px" size="small" clearable @keyup.enter.native="handleFilter" /> <el-input v-model="listQuery.createBy" placeholder="用户名" style="width: 150px" size="small" clearable @keyup.enter.native="handleFilter" />
<el-input v-model="listQuery.address" placeholder="IP来源" style="width: 150px" size="small" clearable @keyup.enter.native="handleFilter" /> <el-input v-model="listQuery.address" placeholder="IP来源" style="width: 150px" size="small" clearable @keyup.enter.native="handleFilter" />
<el-input v-model="listQuery.description" placeholder="描述" style="width: 150px" size="small" clearable @keyup.enter.native="handleFilter" /> <el-input v-model="listQuery.description" placeholder="描述" style="width: 150px" size="small" clearable @keyup.enter.native="handleFilter" />
<el-date-picker
v-model="value1"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd HH:mm:ss"
@keyup.enter.native="handleFilter"
/>
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter"> <el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">
查询 查询
</el-button> </el-button>
@ -52,7 +61,8 @@ export default {
pageSize: 20, pageSize: 20,
orderBy: 'id desc', orderBy: 'id desc',
logType: true logType: true
} },
value1: []
} }
}, },
created() { created() {
@ -71,6 +81,8 @@ export default {
}, },
handleFilter() { handleFilter() {
this.listQuery.pageNum = 1 this.listQuery.pageNum = 1
this.listQuery.createTimeStart = this.value1[0]
this.listQuery.createTimeEnd = this.value1[1]
this.getList() this.getList()
}, },
formatterIp(row, column, cellValue) { formatterIp(row, column, cellValue) {

11
src/views/preview/hzd.vue

@ -0,0 +1,11 @@
<template>
<preview />
</template>
<script>
import preview from '@/views/preview/common/index'
export default {
name: 'HzdPreview',
components: { preview }
}
</script>

13
src/views/user/permission.vue

@ -79,7 +79,7 @@
</div> </div>
<el-button slot="reference" size="mini" type="danger" icon="el-icon-delete" /> <el-button slot="reference" size="mini" type="danger" icon="el-icon-delete" />
</el-popover> </el-popover>
<el-button type="primary" size="mini" title="复制" @click="copyMenu(scope.$index)"> <el-button type="primary" size="mini" title="复制" @click="copyMenu(scope.$index, scope.row)">
<svg-icon icon-class="clipboard" /> <svg-icon icon-class="clipboard" />
</el-button> </el-button>
</template> </template>
@ -358,8 +358,9 @@ export default {
this.dialogStatus = 'create' this.dialogStatus = 'create'
this.showTempPermissionForm(true) this.showTempPermissionForm(true)
}, },
copyMenu($index) { copyMenu($index, row) {
this.loadFromData(this.list[$index]) const data = row.pid ? this.list.filter(tempRow => tempRow.id === row.pid)[0].children.filter(tempRow => tempRow.id === row.id)[0] : this.list[$index]
this.loadFromData(data)
this.dialogStatus = 'create' this.dialogStatus = 'create'
this.showTempPermissionForm(false) this.showTempPermissionForm(false)
}, },
@ -411,7 +412,7 @@ export default {
const pid = this.iconUpdate() const pid = this.iconUpdate()
if (pid) { if (pid) {
this.api({ this.api({
url: '/permission/addPermission', url: '/permission',
method: 'post', method: 'post',
data: this.tempPermission data: this.tempPermission
}).then(() => { }).then(() => {
@ -431,8 +432,8 @@ export default {
const pid = this.iconUpdate() const pid = this.iconUpdate()
if (pid) { if (pid) {
this.api({ this.api({
url: '/permission/updatePermission', url: '/permission',
method: 'post', method: 'put',
data: this.tempPermission data: this.tempPermission
}).then(() => { }).then(() => {
this.$message.success('更新成功。') this.$message.success('更新成功。')

2
src/views/user/role.vue

@ -232,7 +232,7 @@ export default {
getList() { getList() {
// //
this.api({ this.api({
url: '/role/listRole', url: '/role/list',
method: 'get', method: 'get',
params: this.listQuery params: this.listQuery
}).then(data => { }).then(data => {

2
src/views/user/user.vue

@ -268,7 +268,7 @@ export default {
methods: { methods: {
getAllRoles() { getAllRoles() {
this.api({ this.api({
url: '/role/getAllRoles', url: '/role/all',
method: 'get' method: 'get'
}).then((data) => { }).then((data) => {
this.roles = data this.roles = data

Loading…
Cancel
Save