mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-13 07:04:21 +08:00
添加隐患图片展示
This commit is contained in:
parent
4105503024
commit
33762ffb8e
BIN
src/assets/images/1.png
Normal file
BIN
src/assets/images/1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
BIN
src/assets/images/2.png
Normal file
BIN
src/assets/images/2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
BIN
src/assets/images/3.png
Normal file
BIN
src/assets/images/3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
@ -10,14 +10,14 @@
|
|||||||
>
|
>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-link>
|
<el-link @click="jumpReform">
|
||||||
<i class="el-icon-help" />
|
<i class="el-icon-help" />
|
||||||
待整改
|
待整改
|
||||||
<span>({{ 11 }})</span>
|
<span>({{ 11 }})</span>
|
||||||
</el-link>
|
</el-link>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-link>
|
<el-link @click="jumpReview">
|
||||||
<i class="el-icon-s-help" />
|
<i class="el-icon-s-help" />
|
||||||
待验收
|
待验收
|
||||||
<span>({{ 22 }})</span>
|
<span>({{ 22 }})</span>
|
||||||
@ -83,6 +83,12 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
jumpReform() {
|
||||||
|
this.$router.push({ path: '/hidden_danger/hidden_reform', query: { isBacklog: true }})
|
||||||
|
},
|
||||||
|
jumpReview() {
|
||||||
|
this.$router.push({ path: '/hidden_danger/hidden_review', query: { isBacklog: true }})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,364 +1,367 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-card>
|
<el-card>
|
||||||
<el-tree :data="treeData" default-expand-all :props="defaultProps" highlight-current="true" expand-on-click-node="false" @node-click="handleNodeClick" />
|
<el-tree :data="treeData" default-expand-all :props="defaultProps" highlight-current="true" expand-on-click-node="false" @node-click="handleNodeClick" />
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="18">
|
<el-col :span="18">
|
||||||
<el-card>
|
<el-card>
|
||||||
<el-table
|
<el-table
|
||||||
ref="deptTable"
|
ref="deptTable"
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
:data="data"
|
:data="data"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
@cell-dblclick="cellDblclick"
|
@cell-dblclick="cellDblclick"
|
||||||
>
|
>
|
||||||
<template v-for="(d,i) in tableHeader">
|
<template v-for="(d,i) in tableHeader">
|
||||||
<el-table-column v-if="d.type && d.type === 'selection'" :key="i" :type="d.type" :fixed="d.fixed" />
|
<el-table-column v-if="d.type && d.type === 'selection'" :key="i" :type="d.type" :fixed="d.fixed" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-else
|
v-else
|
||||||
:key="i"
|
:key="i"
|
||||||
:prop="d.prop"
|
:prop="d.prop"
|
||||||
:label="d.label"
|
:label="d.label"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-if="d.label==='是否注销'">
|
<div v-if="d.label==='是否注销'">
|
||||||
{{
|
{{
|
||||||
scope.row.sys_dept__is_novalid == 0 ? '否' : '是'
|
scope.row.sys_dept__is_novalid == 0 ? '否' : '是'
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="d.label === '操作'">
|
<div v-else-if="d.label === '操作'">
|
||||||
<el-button icon="el-icon-view" type="text" title="编辑" @click="edit(scope.row)" />
|
<el-button icon="el-icon-view" type="text" title="编辑" @click="edit(scope.row)" />
|
||||||
<el-button v-if="scope.row.status !== 'NULLIFY'" icon="el-icon-delete" style="color:#F56C6C" type="text" title="删除" @click="Delete(scope.row)" />
|
<el-button v-if="scope.row.status !== 'NULLIFY'" icon="el-icon-delete" style="color:#F56C6C" type="text" title="删除" @click="Delete(scope.row)" />
|
||||||
</div>
|
</div>
|
||||||
<div v-else>{{ scope.row[d.prop] }}</div>
|
<div v-else>{{ scope.row[d.prop] }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</template>
|
</template>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
:current-page="pager.pageNo"
|
:current-page="pager.pageNo"
|
||||||
:page-sizes="[10, 30, 50, 100, 500]"
|
:page-sizes="[10, 30, 50, 100, 500]"
|
||||||
:page-size="pager.pageSize"
|
:page-size="pager.pageSize"
|
||||||
:total="pager.total"
|
:total="pager.total"
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
@size-change="sizeChange"
|
@size-change="sizeChange"
|
||||||
@current-change="pageChange"
|
@current-change="pageChange"
|
||||||
/>
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import api from './api'
|
import api from './api'
|
||||||
export default {
|
export default {
|
||||||
name: 'SelDept',
|
name: 'SelDept',
|
||||||
props: {
|
props: {
|
||||||
selective: {
|
selective: {
|
||||||
type: String,
|
type: String,
|
||||||
default: null
|
default: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
data: [],
|
data: [],
|
||||||
deptTree: [],
|
deptTree: [],
|
||||||
ids: [],
|
ids: [],
|
||||||
levels: [],
|
levels: [],
|
||||||
pager: {
|
pager: {
|
||||||
pageNo: 0,
|
pageNo: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0
|
total: 0
|
||||||
},
|
},
|
||||||
tableHeader: [
|
tableHeader: [
|
||||||
{
|
{
|
||||||
prop: 'selection',
|
prop: 'selection',
|
||||||
type: 'selection',
|
type: 'selection',
|
||||||
fixed: 'left'
|
fixed: 'left'
|
||||||
}, {
|
}, {
|
||||||
prop: 'sys_dept__dept_code',
|
prop: 'sys_dept__dept_code',
|
||||||
label: '组织编码'
|
label: '组织编码'
|
||||||
}, {
|
}, {
|
||||||
prop: 'sys_dept__dept_name',
|
prop: 'sys_dept__dept_name',
|
||||||
label: '组织名称'
|
label: '组织名称'
|
||||||
}, {
|
}, {
|
||||||
prop: 'sys_dept__memo',
|
prop: 'sys_dept__memo',
|
||||||
label: '备注'
|
label: '备注'
|
||||||
}],
|
}],
|
||||||
value: '',
|
value: '',
|
||||||
dept_id: '',
|
dept_id: '',
|
||||||
level: '',
|
level: '',
|
||||||
id: '',
|
id: '',
|
||||||
parent_id: '',
|
parent_id: '',
|
||||||
form: {
|
form: {
|
||||||
dept_name: '',
|
dept_name: '',
|
||||||
dept_code: '',
|
dept_code: '',
|
||||||
memo: ''
|
memo: ''
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
dept_code: [
|
dept_code: [
|
||||||
{ required: true, message: '请输入部门编码', trigger: 'blur' }
|
{ required: true, message: '请输入部门编码', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
dept_name: [
|
dept_name: [
|
||||||
{ required: true, message: '请输入部门名称', trigger: 'blur' }
|
{ required: true, message: '请输入部门名称', trigger: 'blur' }
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
dialogFormVisible: false,
|
dialogFormVisible: false,
|
||||||
dialogEditVisible: false,
|
dialogEditVisible: false,
|
||||||
formLabelWidth: '120px',
|
formLabelWidth: '120px',
|
||||||
auditForm: {},
|
auditForm: {},
|
||||||
saveFrom: {},
|
saveFrom: {},
|
||||||
treeData: [],
|
treeData: [],
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'sys_dept__dept_name'
|
label: 'sys_dept__dept_name'
|
||||||
},
|
},
|
||||||
treeList: [],
|
treeList: [],
|
||||||
whereSql: false,
|
whereSql: false,
|
||||||
whereValue: '',
|
whereValue: '',
|
||||||
Dpets: ''
|
Dpets: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList()
|
this.getList()
|
||||||
this.transitionTree()
|
this.transitionTree()
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
let pageNo = this.pager.pageNo * this.pager.pageSize - this.pager.pageSize
|
let pageNo = this.pager.pageNo * this.pager.pageSize - this.pager.pageSize
|
||||||
if (pageNo < 0) {
|
if (pageNo < 0) {
|
||||||
pageNo = 0
|
pageNo = 0
|
||||||
}
|
}
|
||||||
api.getDept(
|
api.getDept(
|
||||||
this.pager.pageSize,
|
this.pager.pageSize,
|
||||||
pageNo,
|
pageNo,
|
||||||
this.whereSql,
|
this.whereSql,
|
||||||
this.whereValue
|
this.whereValue
|
||||||
).then(data => {
|
).then(data => {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
this.data = data.data.root
|
this.data = data.data.root
|
||||||
this.pager.total = data.data.total
|
this.pager.total = data.data.total
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}, 200)
|
}, 200)
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(data.message)
|
this.$message.error(data.message)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async transitionTree() {
|
async transitionTree() {
|
||||||
await api.getDeptTree().then(data => {
|
await api.getDeptTree().then(data => {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
this.deptTree = data.data.root
|
this.deptTree = data.data.root
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(data.message)
|
this.$message.error(data.message)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.treeData = []
|
this.treeData = []
|
||||||
let data = []
|
let data = []
|
||||||
data = this.deptTree.sort((a, b) => {
|
data = this.deptTree.sort((a, b) => {
|
||||||
return a.sys_dept__dept_id - b.sys_dept__dept_id
|
return a.sys_dept__dept_id - b.sys_dept__dept_id
|
||||||
})
|
})
|
||||||
const oneTreeList = data.filter(d => {
|
const oneTreeList = data.filter(d => {
|
||||||
return d.sys_dept__dept_level === '1'
|
return d.sys_dept__dept_level === '1'
|
||||||
})
|
})
|
||||||
for (let i = 0; i < oneTreeList.length; i++) {
|
for (let i = 0; i < oneTreeList.length; i++) {
|
||||||
const treeList = data.filter(d => {
|
const treeList = data.filter(d => {
|
||||||
return d.sys_dept__dept_id.substring(0, 4).indexOf(oneTreeList[i].sys_dept__dept_id) > -1
|
return d.sys_dept__dept_id.substring(0, 4).indexOf(oneTreeList[i].sys_dept__dept_id) > -1
|
||||||
})
|
})
|
||||||
treeList.forEach(d => {
|
treeList.forEach(d => {
|
||||||
d.children = []
|
d.children = []
|
||||||
if (d.sys_dept__dept_level === '1') {
|
if (d.sys_dept__dept_level === '1') {
|
||||||
this.treeData.push(d)
|
this.treeData.push(d)
|
||||||
} else if (d.sys_dept__dept_level === '2') {
|
} else if (d.sys_dept__dept_level === '2') {
|
||||||
this.treeData[i].children.push(d)
|
this.treeData[i].children.push(d)
|
||||||
} else if (d.sys_dept__dept_level === '3') {
|
} else if (d.sys_dept__dept_level === '3') {
|
||||||
this.treeData[i].children.forEach((threeVal, three) => {
|
this.treeData[i].children.forEach((threeVal, three) => {
|
||||||
if (d.sys_dept__dept_id.substring(0, 8).indexOf(threeVal.sys_dept__dept_id) > -1) {
|
if (d.sys_dept__dept_id.substring(0, 8).indexOf(threeVal.sys_dept__dept_id) > -1) {
|
||||||
this.treeData[i].children[three].children.push(d)
|
this.treeData[i].children[three].children.push(d)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else if (d.sys_dept__dept_level === '4') {
|
} else if (d.sys_dept__dept_level === '4') {
|
||||||
this.treeData[i].children.forEach((threeVal, three) => {
|
this.treeData[i].children.forEach((threeVal, three) => {
|
||||||
threeVal.children.forEach((fourVal, four) => {
|
threeVal.children.forEach((fourVal, four) => {
|
||||||
if (d.sys_dept__dept_id.substring(0, 12).indexOf(fourVal.sys_dept__dept_id) > -1) {
|
if (d.sys_dept__dept_id.substring(0, 12).indexOf(fourVal.sys_dept__dept_id) > -1) {
|
||||||
this.treeData[i].children[three].children[four].children.push(d)
|
this.treeData[i].children[three].children[four].children.push(d)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else if (d.sys_dept__dept_level === '5') {
|
} else if (d.sys_dept__dept_level === '5') {
|
||||||
this.treeData[i].children.forEach((threeVal, three) => {
|
this.treeData[i].children.forEach((threeVal, three) => {
|
||||||
threeVal.children.forEach((fourVal, four) => {
|
threeVal.children.forEach((fourVal, four) => {
|
||||||
fourVal.children.forEach((fiveVal, five) => {
|
fourVal.children.forEach((fiveVal, five) => {
|
||||||
if (d.sys_dept__dept_id.substring(0, 16).indexOf(fiveVal.sys_dept__dept_id) > -1) {
|
if (d.sys_dept__dept_id.substring(0, 16).indexOf(fiveVal.sys_dept__dept_id) > -1) {
|
||||||
this.treeData[i].children[three].children[four].children[five].children.push(d)
|
this.treeData[i].children[three].children[four].children[five].children.push(d)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else if (d.sys_dept__dept_level === '6') {
|
} else if (d.sys_dept__dept_level === '6') {
|
||||||
this.treeData[i].children.forEach((threeVal, three) => {
|
this.treeData[i].children.forEach((threeVal, three) => {
|
||||||
threeVal.children.forEach((fourVal, four) => {
|
threeVal.children.forEach((fourVal, four) => {
|
||||||
fourVal.children.forEach((fiveVal, five) => {
|
fourVal.children.forEach((fiveVal, five) => {
|
||||||
fiveVal.children.forEach((sixVal, six) => {
|
fiveVal.children.forEach((sixVal, six) => {
|
||||||
if (d.sys_dept__dept_id.substring(0, 20).indexOf(sixVal.sys_dept__dept_id) > -1) {
|
if (d.sys_dept__dept_id.substring(0, 20).indexOf(sixVal.sys_dept__dept_id) > -1) {
|
||||||
this.treeData[i].children[three].children[four].children[five].children[six].children.push(d)
|
this.treeData[i].children[three].children[four].children[five].children[six].children.push(d)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(this.treeData, 'this.treeData')
|
console.log(this.treeData, 'this.treeData')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
editCreate() {
|
editCreate() {
|
||||||
if (this.ids === null) {
|
if (this.ids === null) {
|
||||||
this.$message.warning('请选择一个组织再添加下属组织')
|
this.$message.warning('请选择一个组织再添加下属组织')
|
||||||
} else if (this.ids.length !== 1) {
|
} else if (this.ids.length !== 1) {
|
||||||
this.$message.warning('请选择一个组织再添加下属组织')
|
this.$message.warning('请选择一个组织再添加下属组织')
|
||||||
} else {
|
} else {
|
||||||
this.dialogFormVisible = true
|
this.dialogFormVisible = true
|
||||||
this.dept_id = this.ids[0]
|
this.dept_id = this.ids[0]
|
||||||
this.level = this.levels[0]
|
this.level = this.levels[0]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
create() {
|
create() {
|
||||||
this.$refs['form'].validate((valid) => {
|
this.$refs['form'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const data = `funid=sys_dept&parentId=${this.dept_id}&levelCol=sys_dept.dept_level&keyid=&pagetype=editgrid&eventcode=save_eg&sys_dept__dept_code=${this.form.dept_code}&sys_dept__dept_name=${this.form.dept_name}&sys_dept__memo=${this.form.memo}&sys_dept__is_novalid=0&sys_dept__dept_id=&sys_dept__dept_level=${Number(this.level) + 1}&user_id=administrator&dataType= json`
|
const data = `funid=sys_dept&parentId=${this.dept_id}&levelCol=sys_dept.dept_level&keyid=&pagetype=editgrid&eventcode=save_eg&sys_dept__dept_code=${this.form.dept_code}&sys_dept__dept_name=${this.form.dept_name}&sys_dept__memo=${this.form.memo}&sys_dept__is_novalid=0&sys_dept__dept_id=&sys_dept__dept_level=${Number(this.level) + 1}&user_id=administrator&dataType= json`
|
||||||
api.Crerte(data).then(data => {
|
api.Crerte(data).then(data => {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
this.getList()
|
this.getList()
|
||||||
this.transitionTree()
|
this.transitionTree()
|
||||||
this.dialogFormVisible = false
|
this.dialogFormVisible = false
|
||||||
this.$refs['form'].resetFields()
|
this.$refs['form'].resetFields()
|
||||||
this.form.dept_name = ''
|
this.form.dept_name = ''
|
||||||
this.form.dept_code = ''
|
this.form.dept_code = ''
|
||||||
this.$message.success('新增成功!')
|
this.$message.success('新增成功!')
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(data.message)
|
this.$message.error(data.message)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
Delete(row) {
|
Delete(row) {
|
||||||
this.ids = []
|
this.ids = []
|
||||||
this.ids.push(row.sys_dept__dept_id)
|
this.ids.push(row.sys_dept__dept_id)
|
||||||
this.editDelete()
|
this.editDelete()
|
||||||
},
|
},
|
||||||
editDelete() {
|
editDelete() {
|
||||||
if (this.ids && this.ids.length > 0) {
|
if (this.ids && this.ids.length > 0) {
|
||||||
this.$confirm('确认删除部门?').then(() => {
|
this.$confirm('确认删除部门?').then(() => {
|
||||||
api.Delete(this.ids).then(data => {
|
api.Delete(this.ids).then(data => {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
this.getList()
|
this.getList()
|
||||||
this.$message.success('删除成功!')
|
this.$message.success('删除成功!')
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(data.message)
|
this.$message.error(data.message)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning('请选择数据进行删除')
|
this.$message.warning('请选择数据进行删除')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
editSave() {
|
editSave() {
|
||||||
console.log('editSave')
|
console.log('editSave')
|
||||||
},
|
},
|
||||||
upload() {
|
upload() {
|
||||||
console.log('upload')
|
console.log('upload')
|
||||||
},
|
},
|
||||||
edit(row) {
|
edit(row) {
|
||||||
this.id = row.sys_dept__dept_id
|
this.id = row.sys_dept__dept_id
|
||||||
this.parent_id = this.id.substring(0, this.id.length - 4)
|
this.parent_id = this.id.substring(0, this.id.length - 4)
|
||||||
console.log(this.parent_id, this.id)
|
console.log(this.parent_id, this.id)
|
||||||
this.auditForm = row
|
this.auditForm = row
|
||||||
this.dialogEditVisible = true
|
this.dialogEditVisible = true
|
||||||
},
|
},
|
||||||
auditFormChange(form) {
|
auditFormChange(form) {
|
||||||
this.saveFrom = form
|
this.saveFrom = form
|
||||||
},
|
},
|
||||||
save() {
|
save() {
|
||||||
console.log(this.saveFrom, 'this.saveFrom')
|
console.log(this.saveFrom, 'this.saveFrom')
|
||||||
console.log(this.auditForm, 'this.auditForm')
|
console.log(this.auditForm, 'this.auditForm')
|
||||||
if (Object.keys(this.saveFrom).length === 0) {
|
if (Object.keys(this.saveFrom).length === 0) {
|
||||||
this.saveFrom = this.auditForm
|
this.saveFrom = this.auditForm
|
||||||
}
|
}
|
||||||
this.$refs.auditForm.$refs.auditForm.validate(valid => {
|
this.$refs.auditForm.$refs.auditForm.validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const _form = `funid=sys_dept&parentId=&levelCol=sys_dept.dept_level&keyid=${this.id}&pagetype=editgrid&eventcode=save_eg&sys_dept__dept_code=${this.saveFrom.sys_dept__dept_code}&sys_dept__dept_name=${this.saveFrom.sys_dept__dept_name}&sys_dept__memo=${this.saveFrom.sys_dept__memo}&sys_dept__is_novalid=${this.saveFrom.sys_dept__is_novalid}&sys_dept__dept_id=${this.id}&sys_dept__dept_level=${this.saveFrom.sys_dept__dept_level}&user_id=administrator&dataType=json`
|
const _form = `funid=sys_dept&parentId=&levelCol=sys_dept.dept_level&keyid=${this.id}&pagetype=editgrid&eventcode=save_eg&sys_dept__dept_code=${this.saveFrom.sys_dept__dept_code}&sys_dept__dept_name=${this.saveFrom.sys_dept__dept_name}&sys_dept__memo=${this.saveFrom.sys_dept__memo}&sys_dept__is_novalid=${this.saveFrom.sys_dept__is_novalid}&sys_dept__dept_id=${this.id}&sys_dept__dept_level=${this.saveFrom.sys_dept__dept_level}&user_id=administrator&dataType=json`
|
||||||
api.auditSave(_form).then(data => {
|
api.auditSave(_form).then(data => {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
this.whereSql = false
|
this.whereSql = false
|
||||||
this.whereValue = ''
|
this.whereValue = ''
|
||||||
this.getList()
|
this.getList()
|
||||||
this.$message.success('保存成功!')
|
this.$message.success('保存成功!')
|
||||||
this.dialogEditVisible = false
|
this.dialogEditVisible = false
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(data.message)
|
this.$message.error(data.message)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
cellDblclick(row) {
|
cellDblclick(row) {
|
||||||
this.$emit('updateDept', row)
|
this.$emit('updateDept', row)
|
||||||
},
|
},
|
||||||
sizeChange(size) {
|
sizeChange(size) {
|
||||||
this.pager.pageSize = size
|
this.pager.pageSize = size
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
pageChange(page) {
|
pageChange(page) {
|
||||||
this.pager.pageNo = page
|
this.pager.pageNo = page
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleSelectionChange(row) {
|
handleSelectionChange(row) {
|
||||||
if (this.selective) {
|
if (this.selective) {
|
||||||
this.$emit('updateDepts', row)
|
this.$emit('updateDepts', row)
|
||||||
} else {
|
} else {
|
||||||
this.Dpets = row
|
this.Dpets = row
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
closeDialog() {
|
closeDialog() {
|
||||||
this.dialogFormVisible = false
|
this.dialogFormVisible = false
|
||||||
this.$refs['form'].resetFields()
|
this.$refs['form'].resetFields()
|
||||||
this.form.dept_name = ''
|
this.form.dept_name = ''
|
||||||
this.form.dept_code = ''
|
this.form.dept_code = ''
|
||||||
},
|
},
|
||||||
handleNodeClick(data) {
|
handleNodeClick(data) {
|
||||||
this.pager.pageNo = 0
|
this.pager.pageNo = 0
|
||||||
this.pager.pageSize = 10
|
this.pager.pageSize = 10
|
||||||
this.pager.total = 0
|
this.pager.total = 0
|
||||||
this.whereValue = encodeURI(`${data.sys_dept__dept_id}\%`)
|
this.whereValue = encodeURI(`${data.sys_dept__dept_id}\%`)
|
||||||
this.whereSql = true
|
this.whereSql = true
|
||||||
this.getList()
|
this.getList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.el-card {
|
.el-card {
|
||||||
margin-top: 0px;
|
margin-top: 0px;
|
||||||
}
|
::v-deep.el-table__row{
|
||||||
.app-container{
|
font-size: 14px;
|
||||||
padding: 0px;
|
}
|
||||||
}
|
}
|
||||||
.el-tree{
|
.app-container{
|
||||||
height: 500px;
|
padding: 0px;
|
||||||
overflow-x:auto;
|
}
|
||||||
overflow-y:auto;
|
.el-tree{
|
||||||
}
|
height: 500px;
|
||||||
</style>
|
overflow-x:auto;
|
||||||
|
overflow-y:auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
40
src/components/show_images/api/index.js
Normal file
40
src/components/show_images/api/index.js
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
import store from '@/store/modules/user'
|
||||||
|
|
||||||
|
var roles = store.state.roles.replace(/;/g, '')
|
||||||
|
|
||||||
|
export default {
|
||||||
|
getDate(pageSize, pageNo, data_id, table_name) {
|
||||||
|
return request({
|
||||||
|
url: `/commonAction.do?eventcode=query_data&funid=queryevent&pagetype=editgrid&query_funid=sys_attach&user_id=${roles}`,
|
||||||
|
method: 'post',
|
||||||
|
data: `start=${pageNo}&limit=${pageSize}&where_sql=sys_attach.data_id = ? and sys_attach.table_name = ?&where_type=string;string&where_value=${data_id};${table_name}`
|
||||||
|
}).then(response => response.data)
|
||||||
|
},
|
||||||
|
Delete(ids) {
|
||||||
|
let keys = ''
|
||||||
|
ids.forEach(d => {
|
||||||
|
keys += 'keyid=' + d + '&'
|
||||||
|
})
|
||||||
|
return request({
|
||||||
|
url: `/commonAction.do`,
|
||||||
|
method: 'post',
|
||||||
|
data: `funid=sys_attach&${keys}pagetype=editgrid&eventcode=delete&user_id=${roles}&dataType=json`
|
||||||
|
}).then(response => response.data)
|
||||||
|
},
|
||||||
|
getFormDate(id) {
|
||||||
|
return request({
|
||||||
|
url: `/commonAction.do?eventcode=query_data&funid=queryevent&pagetype=grid&query_funid=safe_insp&user_id=${roles}`,
|
||||||
|
method: 'post',
|
||||||
|
data: `start=0&limit=10&where_sql=safe_insp.safe_insp_id = ?&where_value=${id}&where_type=string&is_query=1&query_type=0`
|
||||||
|
}).then(response => response.data)
|
||||||
|
},
|
||||||
|
downLoad(keys) {
|
||||||
|
const timestamp = new Date().getTime()
|
||||||
|
return request({
|
||||||
|
url: `fileAction.do?funid=sys_attach&keyid=${keys}&pagetype=editgrid&eventcode=down&user_id=${roles}&dataType=byte&_dc=${timestamp}`,
|
||||||
|
method: 'get'
|
||||||
|
// data: `funid=sys_attach&keyid=${keys}&pagetype=editgrid&eventcode=down&user_id=${roles}&dataType=byte&_dc=${timestamp}`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
262
src/components/show_images/index.vue
Normal file
262
src/components/show_images/index.vue
Normal file
@ -0,0 +1,262 @@
|
|||||||
|
<template>
|
||||||
|
<el-card>
|
||||||
|
<div v-for="(item , i) in imgList" :key="i" class="img">
|
||||||
|
<el-image :preview-src-list="imgPathList" :src="baseUrl +'?funid=sys_attach&pagetype=editgrid&eventcode=down&nousercheck=1&dataType=byte&keyid='+ item.sys_attach__attach_id +'&is_highimage=1'" />
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import api from './api'
|
||||||
|
import store from '@/store/modules/user'
|
||||||
|
|
||||||
|
var roles = store.state.roles.replace(/;/g, '')
|
||||||
|
export default {
|
||||||
|
name: 'SafeIdsp',
|
||||||
|
components: {
|
||||||
|
// buttons
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
dataId: {
|
||||||
|
type: String,
|
||||||
|
default: null
|
||||||
|
},
|
||||||
|
tableName: {
|
||||||
|
type: String,
|
||||||
|
default: null
|
||||||
|
},
|
||||||
|
funId: {
|
||||||
|
type: String,
|
||||||
|
default: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
data: [],
|
||||||
|
deptTree: [],
|
||||||
|
ids: [],
|
||||||
|
levels: [],
|
||||||
|
pager: {
|
||||||
|
pageNo: 0,
|
||||||
|
pageSize: 100,
|
||||||
|
total: 0
|
||||||
|
},
|
||||||
|
value: '',
|
||||||
|
dept_id: '',
|
||||||
|
level: '',
|
||||||
|
id: '',
|
||||||
|
parent_id: '',
|
||||||
|
form: {
|
||||||
|
dept_name: '',
|
||||||
|
dept_code: '',
|
||||||
|
memo: ''
|
||||||
|
},
|
||||||
|
dialogFormVisible: false,
|
||||||
|
dialogEditVisible: false,
|
||||||
|
formLabelWidth: '120px',
|
||||||
|
auditForm: {},
|
||||||
|
saveFrom: {},
|
||||||
|
treeData: [],
|
||||||
|
defaultProps: {
|
||||||
|
children: 'children',
|
||||||
|
label: 'sys_dept__dept_name'
|
||||||
|
},
|
||||||
|
treeList: [],
|
||||||
|
whereSql: false,
|
||||||
|
whereValue: '',
|
||||||
|
formData: {},
|
||||||
|
attach_path: null,
|
||||||
|
baseUrl: window.location.origin + '/bwhse/fileAction.do',
|
||||||
|
href: '',
|
||||||
|
imgList: [],
|
||||||
|
imgPathList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList()
|
||||||
|
this.initFormData()
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
this.loading = true
|
||||||
|
let pageNo = this.pager.pageNo * this.pager.pageSize - this.pager.pageSize
|
||||||
|
if (pageNo < 0) {
|
||||||
|
pageNo = 0
|
||||||
|
}
|
||||||
|
api.getDate(
|
||||||
|
this.pager.pageSize,
|
||||||
|
pageNo,
|
||||||
|
this.dataId,
|
||||||
|
this.tableName
|
||||||
|
).then(data => {
|
||||||
|
if (data.success) {
|
||||||
|
this.data = data.data.root
|
||||||
|
|
||||||
|
this.imgList = this.data.filter(d => {
|
||||||
|
return d.sys_attach__content_type === 'image/png'
|
||||||
|
})
|
||||||
|
this.imgPathList = this.imgList.map(d => {
|
||||||
|
return `${this.baseUrl}?funid=sys_attach&pagetype=editgrid&eventcode=down&nousercheck=1&dataType=byte&keyid=${d.sys_attach__attach_id}&is_highimage=1`
|
||||||
|
})
|
||||||
|
console.log(this.imgList, 'this.imgList')
|
||||||
|
this.pager.total = data.data.total
|
||||||
|
setTimeout(() => {
|
||||||
|
this.loading = false
|
||||||
|
}, 200)
|
||||||
|
} else {
|
||||||
|
this.$message.error(data.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
initFormData() {
|
||||||
|
this.formData.attach_path = ''
|
||||||
|
this.formData.funid = 'sys_attach'
|
||||||
|
this.formData.eventcode = 'create'
|
||||||
|
this.formData.nousercheck = '1'
|
||||||
|
this.formData.table_name = this.tableName
|
||||||
|
this.formData.datafunid = this.funId
|
||||||
|
this.formData.user_id = 'administrator'
|
||||||
|
this.formData.dataid = this.dataId[0]
|
||||||
|
},
|
||||||
|
create() {
|
||||||
|
this.$refs['form'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const data = `funid=sys_dept&parentId=${this.dept_id}&levelCol=sys_dept.dept_level&keyid=&pagetype=editgrid&eventcode=save_eg&sys_dept__dept_code=${this.form.dept_code}&sys_dept__dept_name=${this.form.dept_name}&sys_dept__memo=${this.form.memo}&sys_dept__is_novalid=0&sys_dept__dept_id=&sys_dept__dept_level=${Number(this.level) + 1}&user_id=administrator&dataType= json`
|
||||||
|
api.Crerte(data).then(data => {
|
||||||
|
if (data.success) {
|
||||||
|
this.getList()
|
||||||
|
this.dialogFormVisible = false
|
||||||
|
this.$refs['form'].resetFields()
|
||||||
|
this.form.dept_name = ''
|
||||||
|
this.form.dept_code = ''
|
||||||
|
this.$message.success('新增成功!')
|
||||||
|
} else {
|
||||||
|
this.$message.error(data.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
Delete(row) {
|
||||||
|
this.ids = []
|
||||||
|
this.ids.push(row.sys_attach__attach_id)
|
||||||
|
this.editDelete()
|
||||||
|
},
|
||||||
|
editDelete() {
|
||||||
|
if (this.ids && this.ids.length > 0) {
|
||||||
|
this.$confirm('确认删除附件?').then(() => {
|
||||||
|
api.Delete(this.ids).then(data => {
|
||||||
|
if (data.success) {
|
||||||
|
this.getList()
|
||||||
|
this.$message.success('删除成功!')
|
||||||
|
} else {
|
||||||
|
this.$message.error(data.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).catch(() => {})
|
||||||
|
} else {
|
||||||
|
this.$message.warning('请选择数据进行删除')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
editSave() {
|
||||||
|
console.log('editSave')
|
||||||
|
},
|
||||||
|
upload() {
|
||||||
|
console.log('upload')
|
||||||
|
},
|
||||||
|
edit(row) {
|
||||||
|
this.id = row.attach_id
|
||||||
|
this.parent_id = this.id.substring(0, this.id.length - 4)
|
||||||
|
console.log(this.parent_id, this.id)
|
||||||
|
this.auditForm = row
|
||||||
|
this.dialogEditVisible = true
|
||||||
|
},
|
||||||
|
auditFormChange(form) {
|
||||||
|
this.saveFrom = form
|
||||||
|
},
|
||||||
|
cellDblclick(row) {
|
||||||
|
},
|
||||||
|
sizeChange(size) {
|
||||||
|
this.pager.pageSize = size
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
pageChange(page) {
|
||||||
|
this.pager.pageNo = page
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
handleSelectionChange(val) {
|
||||||
|
console.log(val)
|
||||||
|
this.ids = val.map(d => d.sys_attach__attach_id)
|
||||||
|
},
|
||||||
|
async downLoadAttach(row) {
|
||||||
|
const timestamp = new Date().getTime()
|
||||||
|
this.href = `${this.baseUrl}?funid=sys_attach&keyid=${row.sys_attach__attach_id}&pagetype=editgrid&eventcode=down&user_id=${roles}&dataType=byte&_dc=${timestamp}`
|
||||||
|
// await api.downLoad(row.sys_attach__attach_id)
|
||||||
|
},
|
||||||
|
handleRemove(file, fileList) {
|
||||||
|
console.log(file, fileList)
|
||||||
|
},
|
||||||
|
handlePreview(file) {
|
||||||
|
console.log(file)
|
||||||
|
},
|
||||||
|
handleExceed(files, fileList) {
|
||||||
|
this.$message.warning(`当前限制选择 9 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
|
||||||
|
},
|
||||||
|
beforeRemove(file, fileList) {
|
||||||
|
return this.$confirm(`确定移除 ${file.name}?`)
|
||||||
|
},
|
||||||
|
onChange(file) {
|
||||||
|
this.formData.attach_path = file.raw
|
||||||
|
},
|
||||||
|
onSuccess() {
|
||||||
|
this.$message.success('上传成功!')
|
||||||
|
this.getList()
|
||||||
|
this.$refs.upload.clearFiles()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.el-card {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
.el-table__row {
|
||||||
|
a {
|
||||||
|
color: blue;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.buttons{
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.el-button--primary {
|
||||||
|
height: 26.8px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
.pagination{
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
.img{
|
||||||
|
display: inline-block;
|
||||||
|
width: 188px;
|
||||||
|
height: 108px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 58px;
|
||||||
|
border-radius: 4px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #fff;
|
||||||
|
position: relative;
|
||||||
|
box-shadow: 2px 2px 5px;
|
||||||
|
margin-right: 4px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 10px;
|
||||||
|
margin: 20px;
|
||||||
|
.el-image{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,15 +1,19 @@
|
|||||||
const getters = {
|
const getters = {
|
||||||
sidebar: state => state.app.sidebar,
|
sidebar: state => state.app.sidebar,
|
||||||
size: state => state.app.size,
|
size: state => state.app.size,
|
||||||
device: state => state.app.device,
|
device: state => state.app.device,
|
||||||
visitedViews: state => state.tagsView.visitedViews,
|
visitedViews: state => state.tagsView.visitedViews,
|
||||||
cachedViews: state => state.tagsView.cachedViews,
|
cachedViews: state => state.tagsView.cachedViews,
|
||||||
token: state => state.user.token,
|
token: state => state.user.token,
|
||||||
avatar: state => state.user.avatar,
|
userName: state => state.user.userName,
|
||||||
name: state => state.user.name,
|
userId: state => state.user.userId,
|
||||||
introduction: state => state.user.introduction,
|
deptName: state => state.user.deptName,
|
||||||
roles: state => state.user.roles,
|
deptId: state => state.user.deptId,
|
||||||
permission_routes: state => state.permission.routes,
|
avatar: state => state.user.avatar,
|
||||||
errorLogs: state => state.errorLog.logs
|
name: state => state.user.name,
|
||||||
}
|
introduction: state => state.user.introduction,
|
||||||
export default getters
|
roles: state => state.user.roles,
|
||||||
|
permission_routes: state => state.permission.routes,
|
||||||
|
errorLogs: state => state.errorLog.logs
|
||||||
|
}
|
||||||
|
export default getters
|
||||||
|
@ -8,7 +8,11 @@ const state = {
|
|||||||
name: '',
|
name: '',
|
||||||
avatar: '',
|
avatar: '',
|
||||||
introduction: '',
|
introduction: '',
|
||||||
roles: []
|
roles: [],
|
||||||
|
userName: '',
|
||||||
|
userId: '',
|
||||||
|
deptName: '',
|
||||||
|
deptId: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
const mutations = {
|
const mutations = {
|
||||||
@ -26,6 +30,18 @@ const mutations = {
|
|||||||
},
|
},
|
||||||
SET_ROLES: (state, roles) => {
|
SET_ROLES: (state, roles) => {
|
||||||
state.roles = roles
|
state.roles = roles
|
||||||
|
},
|
||||||
|
USER_NAME: (state, userName) => {
|
||||||
|
state.userName = userName
|
||||||
|
},
|
||||||
|
USER_ID: (state, userId) => {
|
||||||
|
state.userId = userId
|
||||||
|
},
|
||||||
|
DEPT_NAME: (state, deptName) => {
|
||||||
|
state.deptName = deptName
|
||||||
|
},
|
||||||
|
DEPT_ID: (state, deptId) => {
|
||||||
|
state.deptId = deptId
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,8 +55,16 @@ const actions = {
|
|||||||
commit('SET_ROLES', res.data.data.role_id)
|
commit('SET_ROLES', res.data.data.role_id)
|
||||||
// const { data } = res.data
|
// const { data } = res.data
|
||||||
commit('SET_TOKEN', 'bwhse')
|
commit('SET_TOKEN', 'bwhse')
|
||||||
|
commit('USER_NAME', res.data.data.user_name)
|
||||||
|
commit('USER_ID', res.data.data.user_id)
|
||||||
|
commit('DEPT_NAME', res.data.data.dept_name)
|
||||||
|
commit('DEPT_ID', res.data.data.dept_id)
|
||||||
setToken('bwhse')
|
setToken('bwhse')
|
||||||
sessionStorage.setItem('ROLES', res.data.data.role_id)
|
sessionStorage.setItem('ROLES', res.data.data.role_id)
|
||||||
|
sessionStorage.setItem('USER_NAME', res.data.data.user_name)
|
||||||
|
sessionStorage.setItem('USER_ID', res.data.data.user_id)
|
||||||
|
sessionStorage.setItem('DEPT_NAME', res.data.data.dept_name)
|
||||||
|
sessionStorage.setItem('DEPT_ID', res.data.data.dept_id)
|
||||||
resolve()
|
resolve()
|
||||||
} else {
|
} else {
|
||||||
Vue.prototype.$message.error(res.data.message)
|
Vue.prototype.$message.error(res.data.message)
|
||||||
@ -85,6 +109,10 @@ const actions = {
|
|||||||
// logout(state.token).then(() => {
|
// logout(state.token).then(() => {
|
||||||
commit('SET_TOKEN', '')
|
commit('SET_TOKEN', '')
|
||||||
commit('SET_ROLES', [])
|
commit('SET_ROLES', [])
|
||||||
|
commit('USER_NAME', '')
|
||||||
|
commit('USER_ID', '')
|
||||||
|
commit('DEPT_NAME', '')
|
||||||
|
commit('DEPT_ID', '')
|
||||||
sessionStorage.clear
|
sessionStorage.clear
|
||||||
removeToken()
|
removeToken()
|
||||||
resetRouter()
|
resetRouter()
|
||||||
@ -104,6 +132,10 @@ const actions = {
|
|||||||
getRoles({ commit }, roles) {
|
getRoles({ commit }, roles) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
commit('SET_ROLES', roles)
|
commit('SET_ROLES', roles)
|
||||||
|
commit('USER_NAME', sessionStorage.getItem('USER_NAME'))
|
||||||
|
commit('USER_ID', sessionStorage.getItem('USER_ID'))
|
||||||
|
commit('DEPT_NAME', sessionStorage.getItem('DEPT_NAME'))
|
||||||
|
commit('DEPT_ID', sessionStorage.getItem('DEPT_ID'))
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -158,3 +158,38 @@
|
|||||||
// .el-input--medium .el-input__icon {
|
// .el-input--medium .el-input__icon {
|
||||||
// line-height: 26.8px;
|
// line-height: 26.8px;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
.el-tree .el-tree-node__expand-icon.expanded {
|
||||||
|
-webkit-transform: rotate(0deg);
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
//有子节点 且未展开
|
||||||
|
.el-tree .el-icon-caret-right:before {
|
||||||
|
background: url("../assets/images/1.png") no-repeat;
|
||||||
|
content: "";
|
||||||
|
display: block;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
font-size: 16px;
|
||||||
|
background-size: 16px;
|
||||||
|
}
|
||||||
|
//有子节点 且已展开
|
||||||
|
.el-tree .el-tree-node__expand-icon.expanded.el-icon-caret-right:before {
|
||||||
|
background: url("../assets/images/2.png") no-repeat 0 3px;
|
||||||
|
content: "";
|
||||||
|
display: block;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
font-size: 16px;
|
||||||
|
background-size: 16px;
|
||||||
|
}
|
||||||
|
//没有子节点
|
||||||
|
.el-tree .el-tree-node__expand-icon.is-leaf::before {
|
||||||
|
background: url("../assets/images/3.png") no-repeat;
|
||||||
|
content: "";
|
||||||
|
display: block;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
font-size: 16px;
|
||||||
|
background-size: 16px;
|
||||||
|
}
|
||||||
|
@ -1,400 +1,400 @@
|
|||||||
/**
|
/**
|
||||||
* Created by PanJiaChen on 16/11/18.
|
* Created by PanJiaChen on 16/11/18.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse the time to string
|
* Parse the time to string
|
||||||
* @param {(Object|string|number)} time
|
* @param {(Object|string|number)} time
|
||||||
* @param {string} cFormat
|
* @param {string} cFormat
|
||||||
* @returns {string | null}
|
* @returns {string | null}
|
||||||
*/
|
*/
|
||||||
export function parseTime(time, cFormat) {
|
export function parseTime(time, cFormat) {
|
||||||
if (arguments.length === 0 || !time) {
|
if (arguments.length === 0 || !time) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
|
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
|
||||||
let date
|
let date
|
||||||
if (typeof time === 'object') {
|
if (typeof time === 'object') {
|
||||||
date = time
|
date = time
|
||||||
} else {
|
} else {
|
||||||
if ((typeof time === 'string')) {
|
if ((typeof time === 'string')) {
|
||||||
if ((/^[0-9]+$/.test(time))) {
|
if ((/^[0-9]+$/.test(time))) {
|
||||||
// support "1548221490638"
|
// support "1548221490638"
|
||||||
time = parseInt(time)
|
time = parseInt(time)
|
||||||
} else {
|
} else {
|
||||||
// support safari
|
// support safari
|
||||||
// https://stackoverflow.com/questions/4310953/invalid-date-in-safari
|
// https://stackoverflow.com/questions/4310953/invalid-date-in-safari
|
||||||
time = time.replace(new RegExp(/-/gm), '/')
|
time = time.replace(new RegExp(/-/gm), '/')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
||||||
time = time * 1000
|
time = time * 1000
|
||||||
}
|
}
|
||||||
date = new Date(time)
|
date = new Date(time)
|
||||||
}
|
}
|
||||||
const formatObj = {
|
const formatObj = {
|
||||||
y: date.getFullYear(),
|
y: date.getFullYear(),
|
||||||
m: date.getMonth() + 1,
|
m: date.getMonth() + 1,
|
||||||
d: date.getDate(),
|
d: date.getDate(),
|
||||||
h: date.getHours(),
|
h: date.getHours(),
|
||||||
i: date.getMinutes(),
|
i: date.getMinutes(),
|
||||||
s: date.getSeconds(),
|
s: date.getSeconds(),
|
||||||
a: date.getDay()
|
a: date.getDay()
|
||||||
}
|
}
|
||||||
const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
|
const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
|
||||||
const value = formatObj[key]
|
const value = formatObj[key]
|
||||||
// Note: getDay() returns 0 on Sunday
|
// Note: getDay() returns 0 on Sunday
|
||||||
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] }
|
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] }
|
||||||
return value.toString().padStart(2, '0')
|
return value.toString().padStart(2, '0')
|
||||||
})
|
})
|
||||||
return time_str
|
return time_str
|
||||||
}
|
}
|
||||||
|
|
||||||
export function parseDay(time, cFormat) {
|
export function parseDay(time, cFormat) {
|
||||||
if (arguments.length === 0 || !time) {
|
if (arguments.length === 0 || !time) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
const format = cFormat || '{y}-{m}-{d}'
|
const format = cFormat || '{y}-{m}-{d}'
|
||||||
let date
|
let date
|
||||||
if (typeof time === 'object') {
|
if (typeof time === 'object') {
|
||||||
date = time
|
date = time
|
||||||
} else {
|
} else {
|
||||||
if ((typeof time === 'string')) {
|
if ((typeof time === 'string')) {
|
||||||
if ((/^[0-9]+$/.test(time))) {
|
if ((/^[0-9]+$/.test(time))) {
|
||||||
// support "1548221490638"
|
// support "1548221490638"
|
||||||
time = parseInt(time)
|
time = parseInt(time)
|
||||||
} else {
|
} else {
|
||||||
// support safari
|
// support safari
|
||||||
// https://stackoverflow.com/questions/4310953/invalid-date-in-safari
|
// https://stackoverflow.com/questions/4310953/invalid-date-in-safari
|
||||||
time = time.replace(new RegExp(/-/gm), '/')
|
time = time.replace(new RegExp(/-/gm), '/')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
||||||
time = time * 1000
|
time = time * 1000
|
||||||
}
|
}
|
||||||
date = new Date(time)
|
date = new Date(time)
|
||||||
}
|
}
|
||||||
const formatObj = {
|
const formatObj = {
|
||||||
y: date.getFullYear(),
|
y: date.getFullYear(),
|
||||||
m: date.getMonth() + 2,
|
m: date.getMonth() + 1,
|
||||||
d: date.getDate(),
|
d: date.getDate(),
|
||||||
h: date.getHours(),
|
h: date.getHours(),
|
||||||
i: date.getMinutes(),
|
i: date.getMinutes(),
|
||||||
s: date.getSeconds(),
|
s: date.getSeconds(),
|
||||||
a: date.getDay()
|
a: date.getDay()
|
||||||
}
|
}
|
||||||
const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
|
const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
|
||||||
const value = formatObj[key]
|
const value = formatObj[key]
|
||||||
// Note: getDay() returns 0 on Sunday
|
// Note: getDay() returns 0 on Sunday
|
||||||
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] }
|
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] }
|
||||||
return value.toString().padStart(2, '0')
|
return value.toString().padStart(2, '0')
|
||||||
})
|
})
|
||||||
return time_str
|
return time_str
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {number} time
|
* @param {number} time
|
||||||
* @param {string} option
|
* @param {string} option
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
export function formatTime(time, option) {
|
export function formatTime(time, option) {
|
||||||
if (('' + time).length === 10) {
|
if (('' + time).length === 10) {
|
||||||
time = parseInt(time) * 1000
|
time = parseInt(time) * 1000
|
||||||
} else {
|
} else {
|
||||||
time = +time
|
time = +time
|
||||||
}
|
}
|
||||||
const d = new Date(time)
|
const d = new Date(time)
|
||||||
const now = Date.now()
|
const now = Date.now()
|
||||||
|
|
||||||
const diff = (now - d) / 1000
|
const diff = (now - d) / 1000
|
||||||
|
|
||||||
if (diff < 30) {
|
if (diff < 30) {
|
||||||
return '刚刚'
|
return '刚刚'
|
||||||
} else if (diff < 3600) {
|
} else if (diff < 3600) {
|
||||||
// less 1 hour
|
// less 1 hour
|
||||||
return Math.ceil(diff / 60) + '分钟前'
|
return Math.ceil(diff / 60) + '分钟前'
|
||||||
} else if (diff < 3600 * 24) {
|
} else if (diff < 3600 * 24) {
|
||||||
return Math.ceil(diff / 3600) + '小时前'
|
return Math.ceil(diff / 3600) + '小时前'
|
||||||
} else if (diff < 3600 * 24 * 2) {
|
} else if (diff < 3600 * 24 * 2) {
|
||||||
return '1天前'
|
return '1天前'
|
||||||
}
|
}
|
||||||
if (option) {
|
if (option) {
|
||||||
return parseTime(time, option)
|
return parseTime(time, option)
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
d.getMonth() +
|
d.getMonth() +
|
||||||
1 +
|
1 +
|
||||||
'月' +
|
'月' +
|
||||||
d.getDate() +
|
d.getDate() +
|
||||||
'日' +
|
'日' +
|
||||||
d.getHours() +
|
d.getHours() +
|
||||||
'时' +
|
'时' +
|
||||||
d.getMinutes() +
|
d.getMinutes() +
|
||||||
'分'
|
'分'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} url
|
* @param {string} url
|
||||||
* @returns {Object}
|
* @returns {Object}
|
||||||
*/
|
*/
|
||||||
export function getQueryObject(url) {
|
export function getQueryObject(url) {
|
||||||
url = url == null ? window.location.href : url
|
url = url == null ? window.location.href : url
|
||||||
const search = url.substring(url.lastIndexOf('?') + 1)
|
const search = url.substring(url.lastIndexOf('?') + 1)
|
||||||
const obj = {}
|
const obj = {}
|
||||||
const reg = /([^?&=]+)=([^?&=]*)/g
|
const reg = /([^?&=]+)=([^?&=]*)/g
|
||||||
search.replace(reg, (rs, $1, $2) => {
|
search.replace(reg, (rs, $1, $2) => {
|
||||||
const name = decodeURIComponent($1)
|
const name = decodeURIComponent($1)
|
||||||
let val = decodeURIComponent($2)
|
let val = decodeURIComponent($2)
|
||||||
val = String(val)
|
val = String(val)
|
||||||
obj[name] = val
|
obj[name] = val
|
||||||
return rs
|
return rs
|
||||||
})
|
})
|
||||||
return obj
|
return obj
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} input value
|
* @param {string} input value
|
||||||
* @returns {number} output value
|
* @returns {number} output value
|
||||||
*/
|
*/
|
||||||
export function byteLength(str) {
|
export function byteLength(str) {
|
||||||
// returns the byte length of an utf8 string
|
// returns the byte length of an utf8 string
|
||||||
let s = str.length
|
let s = str.length
|
||||||
for (var i = str.length - 1; i >= 0; i--) {
|
for (var i = str.length - 1; i >= 0; i--) {
|
||||||
const code = str.charCodeAt(i)
|
const code = str.charCodeAt(i)
|
||||||
if (code > 0x7f && code <= 0x7ff) s++
|
if (code > 0x7f && code <= 0x7ff) s++
|
||||||
else if (code > 0x7ff && code <= 0xffff) s += 2
|
else if (code > 0x7ff && code <= 0xffff) s += 2
|
||||||
if (code >= 0xDC00 && code <= 0xDFFF) i--
|
if (code >= 0xDC00 && code <= 0xDFFF) i--
|
||||||
}
|
}
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array} actual
|
* @param {Array} actual
|
||||||
* @returns {Array}
|
* @returns {Array}
|
||||||
*/
|
*/
|
||||||
export function cleanArray(actual) {
|
export function cleanArray(actual) {
|
||||||
const newArray = []
|
const newArray = []
|
||||||
for (let i = 0; i < actual.length; i++) {
|
for (let i = 0; i < actual.length; i++) {
|
||||||
if (actual[i]) {
|
if (actual[i]) {
|
||||||
newArray.push(actual[i])
|
newArray.push(actual[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return newArray
|
return newArray
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Object} json
|
* @param {Object} json
|
||||||
* @returns {Array}
|
* @returns {Array}
|
||||||
*/
|
*/
|
||||||
export function param(json) {
|
export function param(json) {
|
||||||
if (!json) return ''
|
if (!json) return ''
|
||||||
return cleanArray(
|
return cleanArray(
|
||||||
Object.keys(json).map(key => {
|
Object.keys(json).map(key => {
|
||||||
if (json[key] === undefined) return ''
|
if (json[key] === undefined) return ''
|
||||||
return encodeURIComponent(key) + '=' + encodeURIComponent(json[key])
|
return encodeURIComponent(key) + '=' + encodeURIComponent(json[key])
|
||||||
})
|
})
|
||||||
).join('&')
|
).join('&')
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} url
|
* @param {string} url
|
||||||
* @returns {Object}
|
* @returns {Object}
|
||||||
*/
|
*/
|
||||||
export function param2Obj(url) {
|
export function param2Obj(url) {
|
||||||
const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ')
|
const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ')
|
||||||
if (!search) {
|
if (!search) {
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
const obj = {}
|
const obj = {}
|
||||||
const searchArr = search.split('&')
|
const searchArr = search.split('&')
|
||||||
searchArr.forEach(v => {
|
searchArr.forEach(v => {
|
||||||
const index = v.indexOf('=')
|
const index = v.indexOf('=')
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
const name = v.substring(0, index)
|
const name = v.substring(0, index)
|
||||||
const val = v.substring(index + 1, v.length)
|
const val = v.substring(index + 1, v.length)
|
||||||
obj[name] = val
|
obj[name] = val
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return obj
|
return obj
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} val
|
* @param {string} val
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
export function html2Text(val) {
|
export function html2Text(val) {
|
||||||
const div = document.createElement('div')
|
const div = document.createElement('div')
|
||||||
div.innerHTML = val
|
div.innerHTML = val
|
||||||
return div.textContent || div.innerText
|
return div.textContent || div.innerText
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Merges two objects, giving the last one precedence
|
* Merges two objects, giving the last one precedence
|
||||||
* @param {Object} target
|
* @param {Object} target
|
||||||
* @param {(Object|Array)} source
|
* @param {(Object|Array)} source
|
||||||
* @returns {Object}
|
* @returns {Object}
|
||||||
*/
|
*/
|
||||||
export function objectMerge(target, source) {
|
export function objectMerge(target, source) {
|
||||||
if (typeof target !== 'object') {
|
if (typeof target !== 'object') {
|
||||||
target = {}
|
target = {}
|
||||||
}
|
}
|
||||||
if (Array.isArray(source)) {
|
if (Array.isArray(source)) {
|
||||||
return source.slice()
|
return source.slice()
|
||||||
}
|
}
|
||||||
Object.keys(source).forEach(property => {
|
Object.keys(source).forEach(property => {
|
||||||
const sourceProperty = source[property]
|
const sourceProperty = source[property]
|
||||||
if (typeof sourceProperty === 'object') {
|
if (typeof sourceProperty === 'object') {
|
||||||
target[property] = objectMerge(target[property], sourceProperty)
|
target[property] = objectMerge(target[property], sourceProperty)
|
||||||
} else {
|
} else {
|
||||||
target[property] = sourceProperty
|
target[property] = sourceProperty
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return target
|
return target
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {HTMLElement} element
|
* @param {HTMLElement} element
|
||||||
* @param {string} className
|
* @param {string} className
|
||||||
*/
|
*/
|
||||||
export function toggleClass(element, className) {
|
export function toggleClass(element, className) {
|
||||||
if (!element || !className) {
|
if (!element || !className) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let classString = element.className
|
let classString = element.className
|
||||||
const nameIndex = classString.indexOf(className)
|
const nameIndex = classString.indexOf(className)
|
||||||
if (nameIndex === -1) {
|
if (nameIndex === -1) {
|
||||||
classString += '' + className
|
classString += '' + className
|
||||||
} else {
|
} else {
|
||||||
classString =
|
classString =
|
||||||
classString.substr(0, nameIndex) +
|
classString.substr(0, nameIndex) +
|
||||||
classString.substr(nameIndex + className.length)
|
classString.substr(nameIndex + className.length)
|
||||||
}
|
}
|
||||||
element.className = classString
|
element.className = classString
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} type
|
* @param {string} type
|
||||||
* @returns {Date}
|
* @returns {Date}
|
||||||
*/
|
*/
|
||||||
export function getTime(type) {
|
export function getTime(type) {
|
||||||
if (type === 'start') {
|
if (type === 'start') {
|
||||||
return new Date().getTime() - 3600 * 1000 * 24 * 90
|
return new Date().getTime() - 3600 * 1000 * 24 * 90
|
||||||
} else {
|
} else {
|
||||||
return new Date(new Date().toDateString())
|
return new Date(new Date().toDateString())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Function} func
|
* @param {Function} func
|
||||||
* @param {number} wait
|
* @param {number} wait
|
||||||
* @param {boolean} immediate
|
* @param {boolean} immediate
|
||||||
* @return {*}
|
* @return {*}
|
||||||
*/
|
*/
|
||||||
export function debounce(func, wait, immediate) {
|
export function debounce(func, wait, immediate) {
|
||||||
let timeout, args, context, timestamp, result
|
let timeout, args, context, timestamp, result
|
||||||
|
|
||||||
const later = function() {
|
const later = function() {
|
||||||
// 据上一次触发时间间隔
|
// 据上一次触发时间间隔
|
||||||
const last = +new Date() - timestamp
|
const last = +new Date() - timestamp
|
||||||
|
|
||||||
// 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait
|
// 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait
|
||||||
if (last < wait && last > 0) {
|
if (last < wait && last > 0) {
|
||||||
timeout = setTimeout(later, wait - last)
|
timeout = setTimeout(later, wait - last)
|
||||||
} else {
|
} else {
|
||||||
timeout = null
|
timeout = null
|
||||||
// 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
|
// 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
|
||||||
if (!immediate) {
|
if (!immediate) {
|
||||||
result = func.apply(context, args)
|
result = func.apply(context, args)
|
||||||
if (!timeout) context = args = null
|
if (!timeout) context = args = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return function(...args) {
|
return function(...args) {
|
||||||
context = this
|
context = this
|
||||||
timestamp = +new Date()
|
timestamp = +new Date()
|
||||||
const callNow = immediate && !timeout
|
const callNow = immediate && !timeout
|
||||||
// 如果延时不存在,重新设定延时
|
// 如果延时不存在,重新设定延时
|
||||||
if (!timeout) timeout = setTimeout(later, wait)
|
if (!timeout) timeout = setTimeout(later, wait)
|
||||||
if (callNow) {
|
if (callNow) {
|
||||||
result = func.apply(context, args)
|
result = func.apply(context, args)
|
||||||
context = args = null
|
context = args = null
|
||||||
}
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is just a simple version of deep copy
|
* This is just a simple version of deep copy
|
||||||
* Has a lot of edge cases bug
|
* Has a lot of edge cases bug
|
||||||
* If you want to use a perfect deep copy, use lodash's _.cloneDeep
|
* If you want to use a perfect deep copy, use lodash's _.cloneDeep
|
||||||
* @param {Object} source
|
* @param {Object} source
|
||||||
* @returns {Object}
|
* @returns {Object}
|
||||||
*/
|
*/
|
||||||
export function deepClone(source) {
|
export function deepClone(source) {
|
||||||
if (!source && typeof source !== 'object') {
|
if (!source && typeof source !== 'object') {
|
||||||
throw new Error('error arguments', 'deepClone')
|
throw new Error('error arguments', 'deepClone')
|
||||||
}
|
}
|
||||||
const targetObj = source.constructor === Array ? [] : {}
|
const targetObj = source.constructor === Array ? [] : {}
|
||||||
Object.keys(source).forEach(keys => {
|
Object.keys(source).forEach(keys => {
|
||||||
if (source[keys] && typeof source[keys] === 'object') {
|
if (source[keys] && typeof source[keys] === 'object') {
|
||||||
targetObj[keys] = deepClone(source[keys])
|
targetObj[keys] = deepClone(source[keys])
|
||||||
} else {
|
} else {
|
||||||
targetObj[keys] = source[keys]
|
targetObj[keys] = source[keys]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return targetObj
|
return targetObj
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array} arr
|
* @param {Array} arr
|
||||||
* @returns {Array}
|
* @returns {Array}
|
||||||
*/
|
*/
|
||||||
export function uniqueArr(arr) {
|
export function uniqueArr(arr) {
|
||||||
return Array.from(new Set(arr))
|
return Array.from(new Set(arr))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
export function createUniqueString() {
|
export function createUniqueString() {
|
||||||
const timestamp = +new Date() + ''
|
const timestamp = +new Date() + ''
|
||||||
const randomNum = parseInt((1 + Math.random()) * 65536) + ''
|
const randomNum = parseInt((1 + Math.random()) * 65536) + ''
|
||||||
return (+(randomNum + timestamp)).toString(32)
|
return (+(randomNum + timestamp)).toString(32)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if an element has a class
|
* Check if an element has a class
|
||||||
* @param {HTMLElement} elm
|
* @param {HTMLElement} elm
|
||||||
* @param {string} cls
|
* @param {string} cls
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
export function hasClass(ele, cls) {
|
export function hasClass(ele, cls) {
|
||||||
return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'))
|
return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add class to element
|
* Add class to element
|
||||||
* @param {HTMLElement} elm
|
* @param {HTMLElement} elm
|
||||||
* @param {string} cls
|
* @param {string} cls
|
||||||
*/
|
*/
|
||||||
export function addClass(ele, cls) {
|
export function addClass(ele, cls) {
|
||||||
if (!hasClass(ele, cls)) ele.className += ' ' + cls
|
if (!hasClass(ele, cls)) ele.className += ' ' + cls
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove class from element
|
* Remove class from element
|
||||||
* @param {HTMLElement} elm
|
* @param {HTMLElement} elm
|
||||||
* @param {string} cls
|
* @param {string} cls
|
||||||
*/
|
*/
|
||||||
export function removeClass(ele, cls) {
|
export function removeClass(ele, cls) {
|
||||||
if (hasClass(ele, cls)) {
|
if (hasClass(ele, cls)) {
|
||||||
const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)')
|
const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)')
|
||||||
ele.className = ele.className.replace(reg, ' ')
|
ele.className = ele.className.replace(reg, ' ')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,119 +1,119 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="dashboard-editor-container">
|
<div class="dashboard-editor-container">
|
||||||
|
|
||||||
<panel-group @handleSetLineChartData="handleSetLineChartData" />
|
<panel-group @handleSetLineChartData="handleSetLineChartData" />
|
||||||
|
|
||||||
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
|
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
|
||||||
<line-chart :chart-data="lineChartData" />
|
<line-chart :chart-data="lineChartData" />
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row :gutter="32">
|
<el-row :gutter="32">
|
||||||
<el-col :xs="24" :sm="24" :lg="8">
|
<el-col :xs="24" :sm="24" :lg="8">
|
||||||
<div class="chart-wrapper">
|
<div class="chart-wrapper">
|
||||||
<raddar-chart />
|
<raddar-chart />
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="24" :lg="8">
|
<el-col :xs="24" :sm="24" :lg="8">
|
||||||
<div class="chart-wrapper">
|
<div class="chart-wrapper">
|
||||||
<pie-chart />
|
<pie-chart />
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="24" :lg="8">
|
<el-col :xs="24" :sm="24" :lg="8">
|
||||||
<div class="chart-wrapper">
|
<div class="chart-wrapper">
|
||||||
<bar-chart />
|
<bar-chart />
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row :gutter="8">
|
<el-row :gutter="8">
|
||||||
<el-col :xs="{span: 24}" :sm="{span: 24}" :md="{span: 24}" :lg="{span: 12}" :xl="{span: 12}" style="padding-right:8px;margin-bottom:30px;">
|
<el-col :xs="{span: 24}" :sm="{span: 24}" :md="{span: 24}" :lg="{span: 12}" :xl="{span: 12}" style="padding-right:8px;margin-bottom:30px;">
|
||||||
<!-- <transaction-table /> -->
|
<!-- <transaction-table /> -->
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="{span: 24}" :sm="{span: 12}" :md="{span: 12}" :lg="{span: 6}" :xl="{span: 6}" style="margin-bottom:30px;">
|
<el-col :xs="{span: 24}" :sm="{span: 12}" :md="{span: 12}" :lg="{span: 6}" :xl="{span: 6}" style="margin-bottom:30px;">
|
||||||
<todo-list />
|
<todo-list />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="{span: 24}" :sm="{span: 12}" :md="{span: 12}" :lg="{span: 6}" :xl="{span: 6}" style="margin-bottom:30px;">
|
<el-col :xs="{span: 24}" :sm="{span: 12}" :md="{span: 12}" :lg="{span: 6}" :xl="{span: 6}" style="margin-bottom:30px;">
|
||||||
<box-card />
|
<box-card />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import PanelGroup from './components/PanelGroup'
|
import PanelGroup from './components/PanelGroup'
|
||||||
import LineChart from './components/LineChart'
|
import LineChart from './components/LineChart'
|
||||||
import RaddarChart from './components/RaddarChart'
|
import RaddarChart from './components/RaddarChart'
|
||||||
import PieChart from './components/PieChart'
|
import PieChart from './components/PieChart'
|
||||||
import BarChart from './components/BarChart'
|
import BarChart from './components/BarChart'
|
||||||
import TodoList from './components/TodoList'
|
import TodoList from './components/TodoList'
|
||||||
import BoxCard from './components/BoxCard'
|
import BoxCard from './components/BoxCard'
|
||||||
|
|
||||||
const lineChartData = {
|
const lineChartData = {
|
||||||
newVisitis: {
|
newVisitis: {
|
||||||
expectedData: [100, 120, 161, 134, 105, 160, 165],
|
expectedData: [100, 120, 161, 134, 105, 160, 165],
|
||||||
actualData: [120, 82, 91, 154, 162, 140, 145]
|
actualData: [120, 82, 91, 154, 162, 140, 145]
|
||||||
},
|
},
|
||||||
messages: {
|
messages: {
|
||||||
expectedData: [200, 192, 120, 144, 160, 130, 140],
|
expectedData: [200, 192, 120, 144, 160, 130, 140],
|
||||||
actualData: [180, 160, 151, 106, 145, 150, 130]
|
actualData: [180, 160, 151, 106, 145, 150, 130]
|
||||||
},
|
},
|
||||||
purchases: {
|
purchases: {
|
||||||
expectedData: [80, 100, 121, 104, 105, 90, 100],
|
expectedData: [80, 100, 121, 104, 105, 90, 100],
|
||||||
actualData: [120, 90, 100, 138, 142, 130, 130]
|
actualData: [120, 90, 100, 138, 142, 130, 130]
|
||||||
},
|
},
|
||||||
shoppings: {
|
shoppings: {
|
||||||
expectedData: [130, 140, 141, 142, 145, 150, 160],
|
expectedData: [130, 140, 141, 142, 145, 150, 160],
|
||||||
actualData: [120, 82, 91, 154, 162, 140, 130]
|
actualData: [120, 82, 91, 154, 162, 140, 130]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DashboardAdmin',
|
name: 'DashboardAdmin',
|
||||||
components: {
|
components: {
|
||||||
PanelGroup,
|
PanelGroup,
|
||||||
LineChart,
|
LineChart,
|
||||||
RaddarChart,
|
RaddarChart,
|
||||||
PieChart,
|
PieChart,
|
||||||
BarChart,
|
BarChart,
|
||||||
TodoList,
|
TodoList,
|
||||||
BoxCard
|
BoxCard
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
lineChartData: lineChartData.newVisitis
|
lineChartData: lineChartData.newVisitis
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSetLineChartData(type) {
|
handleSetLineChartData(type) {
|
||||||
this.lineChartData = lineChartData[type]
|
this.lineChartData = lineChartData[type]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.dashboard-editor-container {
|
.dashboard-editor-container {
|
||||||
padding: 32px;
|
padding: 32px;
|
||||||
background-color: rgb(240, 242, 245);
|
background-color: rgb(240, 242, 245);
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.github-corner {
|
.github-corner {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0px;
|
top: 0px;
|
||||||
border: 0;
|
border: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chart-wrapper {
|
.chart-wrapper {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 16px 16px 0;
|
padding: 16px 16px 0;
|
||||||
margin-bottom: 32px;
|
margin-bottom: 32px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width:1024px) {
|
@media (max-width:1024px) {
|
||||||
.chart-wrapper {
|
.chart-wrapper {
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -54,19 +54,19 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item label="检查地点">
|
<el-form-item label="检查地点">
|
||||||
<el-input v-model="form.hidden_danger__check_location" />
|
<el-input v-model="form.hidden_danger__check_location" maxlength="250" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item label="检查内容">
|
<el-form-item label="检查内容">
|
||||||
<el-input v-model="form.hidden_danger__check_content" type="textarea" />
|
<el-input v-model="form.hidden_danger__check_content" type="textarea" maxlength="500" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item label="隐患描述" prop="hidden_danger__check_problem">
|
<el-form-item label="隐患描述" prop="hidden_danger__check_problem">
|
||||||
<el-input v-model="form.hidden_danger__check_problem" type="textarea" />
|
<el-input v-model="form.hidden_danger__check_problem" type="textarea" maxlength="500" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -148,7 +148,7 @@
|
|||||||
>
|
>
|
||||||
<SelDept ref="ReformDept" @updateDept="getReformDept" />
|
<SelDept ref="ReformDept" @updateDept="getReformDept" />
|
||||||
<span>
|
<span>
|
||||||
<el-button @click="reformDeptVisible = false">取 消</el-button>
|
<!-- <el-button @click="reformDeptVisible = false">取 消</el-button> -->
|
||||||
<el-button type="primary" @click="selReformDept">确 定</el-button>
|
<el-button type="primary" @click="selReformDept">确 定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@ -161,6 +161,7 @@ import publicApi from '@/api/public'
|
|||||||
import buttons from '@/components/formBtn'
|
import buttons from '@/components/formBtn'
|
||||||
import SelUser from '@/components/selUser'
|
import SelUser from '@/components/selUser'
|
||||||
import SelDept from '@/components/selDept'
|
import SelDept from '@/components/selDept'
|
||||||
|
import { parseDay } from '@/utils/index'
|
||||||
export default {
|
export default {
|
||||||
name: 'HiddenCheckCreateForm',
|
name: 'HiddenCheckCreateForm',
|
||||||
components: {
|
components: {
|
||||||
@ -177,9 +178,9 @@ export default {
|
|||||||
form: {
|
form: {
|
||||||
hidden_danger__hidden_code: '',
|
hidden_danger__hidden_code: '',
|
||||||
hidden_danger__hidden_state: '1',
|
hidden_danger__hidden_state: '1',
|
||||||
hidden_danger__check_man: '',
|
hidden_danger__check_man: this.$store.state.user.userName,
|
||||||
hidden_danger__check_dept: '',
|
hidden_danger__check_dept: this.$store.state.user.deptName,
|
||||||
hidden_danger__check_date: '',
|
hidden_danger__check_date: parseDay(new Date()),
|
||||||
hidden_danger__check_location: '',
|
hidden_danger__check_location: '',
|
||||||
hidden_danger__check_content: '',
|
hidden_danger__check_content: '',
|
||||||
hidden_danger__check_problem: '',
|
hidden_danger__check_problem: '',
|
||||||
@ -195,8 +196,8 @@ export default {
|
|||||||
hidden_danger__insp_det_id: '',
|
hidden_danger__insp_det_id: '',
|
||||||
hidden_danger__hidden_danger_id: '',
|
hidden_danger__hidden_danger_id: '',
|
||||||
hidden_danger__dept_id: '',
|
hidden_danger__dept_id: '',
|
||||||
hidden_danger__check_man_id: '',
|
hidden_danger__check_man_id: this.$store.state.user.userId,
|
||||||
hidden_danger__check_dept_id: ''
|
hidden_danger__check_dept_id: this.$store.state.user.deptId
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
hidden_danger__check_man: [
|
hidden_danger__check_man: [
|
||||||
@ -230,6 +231,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
console.log(this.$store)
|
||||||
|
console.log(this.form)
|
||||||
this.getHiddenState()
|
this.getHiddenState()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -54,19 +54,19 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item label="检查地点">
|
<el-form-item label="检查地点">
|
||||||
<el-input v-model="form.hidden_danger__check_location" />
|
<el-input v-model="form.hidden_danger__check_location" maxlength="250" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item label="检查内容">
|
<el-form-item label="检查内容">
|
||||||
<el-input v-model="form.hidden_danger__check_content" type="textarea" />
|
<el-input v-model="form.hidden_danger__check_content" type="textarea" maxlength="500" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item label="隐患描述" prop="hidden_danger__check_problem">
|
<el-form-item label="隐患描述" prop="hidden_danger__check_problem">
|
||||||
<el-input v-model="form.hidden_danger__check_problem" type="textarea" />
|
<el-input v-model="form.hidden_danger__check_problem" type="textarea" maxlength="500" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -100,6 +100,16 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
<el-row>
|
||||||
|
<el-col class="img" :span="12">
|
||||||
|
<span class="img-title">隐患排查图片</span>
|
||||||
|
<ShowImages :data-id="id" table-name="hidden_danger" fun-id="hidden_check" />
|
||||||
|
</el-col>
|
||||||
|
<el-col class="img" :span="12">
|
||||||
|
<span class="img-title">隐患整改图片</span>
|
||||||
|
<ShowImages :data-id="id" table-name="hidden_danger" fun-id="hidden_check" />
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-if="checkManVisible"
|
v-if="checkManVisible"
|
||||||
title="选择人员"
|
title="选择人员"
|
||||||
@ -161,12 +171,14 @@ import publicApi from '@/api/public'
|
|||||||
import buttons from '@/components/formBtn'
|
import buttons from '@/components/formBtn'
|
||||||
import SelUser from '@/components/selUser'
|
import SelUser from '@/components/selUser'
|
||||||
import SelDept from '@/components/selDept'
|
import SelDept from '@/components/selDept'
|
||||||
|
import ShowImages from '@/components/show_images'
|
||||||
export default {
|
export default {
|
||||||
name: 'HiddenCheckAuditForm',
|
name: 'HiddenCheckAuditForm',
|
||||||
components: {
|
components: {
|
||||||
buttons,
|
buttons,
|
||||||
SelUser,
|
SelUser,
|
||||||
SelDept
|
SelDept,
|
||||||
|
ShowImages
|
||||||
},
|
},
|
||||||
// props: {
|
// props: {
|
||||||
// id: { type: String, default: () => '' }
|
// id: { type: String, default: () => '' }
|
||||||
@ -356,9 +368,6 @@ export default {
|
|||||||
-webkit-box-sizing: border-box;
|
-webkit-box-sizing: border-box;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
.el-col{
|
|
||||||
margin-left: 2%;
|
|
||||||
}
|
|
||||||
.buttons {
|
.buttons {
|
||||||
display: flex;
|
display: flex;
|
||||||
.el-button--primary {
|
.el-button--primary {
|
||||||
@ -366,4 +375,11 @@ export default {
|
|||||||
height: 26.8px;
|
height: 26.8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.img{
|
||||||
|
margin-top: 10px;
|
||||||
|
text-align: center;
|
||||||
|
span{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -6,6 +6,9 @@
|
|||||||
<el-button type="primary" @click="back">返回列表</el-button>
|
<el-button type="primary" @click="back">返回列表</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
|
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
|
||||||
|
<div class="classify">
|
||||||
|
<div class="classify-title">| <span>隐患排查</span></div>
|
||||||
|
</div>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item label="隐患编号">
|
<el-form-item label="隐患编号">
|
||||||
@ -100,6 +103,11 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<div class="classify">
|
||||||
|
<div class="classify-title">
|
||||||
|
| <span>隐患整改</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item label="整改时间" prop="hidden_danger__reform_date">
|
<el-form-item label="整改时间" prop="hidden_danger__reform_date">
|
||||||
@ -120,7 +128,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item label="整改情况">
|
<el-form-item label="整改情况">
|
||||||
<el-input v-model="form.hidden_danger__reform_desc" placeholder="请输入整改情况" class="input-with-select" type="textarea" clearable />
|
<el-input v-model="form.hidden_danger__reform_desc" placeholder="请输入整改情况" class="input-with-select" type="textarea" clearable maxlength="500" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -382,4 +390,14 @@ export default {
|
|||||||
height: 26.8px;
|
height: 26.8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.classify{
|
||||||
|
width: 100%;
|
||||||
|
// display: inline-block;
|
||||||
|
padding: 10px 0;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #1890ff;
|
||||||
|
span{
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -94,6 +94,7 @@ export default {
|
|||||||
data: [],
|
data: [],
|
||||||
deptTree: [],
|
deptTree: [],
|
||||||
ids: [],
|
ids: [],
|
||||||
|
isBacklog: this.$route.query.isBacklog || false,
|
||||||
levels: [],
|
levels: [],
|
||||||
pager: {
|
pager: {
|
||||||
pageNo: 0,
|
pageNo: 0,
|
||||||
@ -198,6 +199,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
if (this.isBacklog) {
|
||||||
|
this.whereSql = ''
|
||||||
|
}
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -6,6 +6,9 @@
|
|||||||
<el-button type="primary" @click="back">返回列表</el-button>
|
<el-button type="primary" @click="back">返回列表</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
|
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
|
||||||
|
<div class="classify">
|
||||||
|
<div class="classify-title">| <span>隐患排查</span></div>
|
||||||
|
</div>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item label="隐患编号">
|
<el-form-item label="隐患编号">
|
||||||
@ -100,6 +103,9 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<div class="classify">
|
||||||
|
<div class="classify-title">| <span>隐患整改</span></div>
|
||||||
|
</div>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item label="整改时间" prop="hidden_danger__reform_date">
|
<el-form-item label="整改时间" prop="hidden_danger__reform_date">
|
||||||
@ -125,6 +131,9 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<div class="classify">
|
||||||
|
<div class="classify-title">| <span>隐患验收</span></div>
|
||||||
|
</div>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item label="验收时间" prop="hidden_danger__review_date">
|
<el-form-item label="验收时间" prop="hidden_danger__review_date">
|
||||||
@ -147,7 +156,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item label="验收情况">
|
<el-form-item label="验收情况">
|
||||||
<el-input v-model="form.hidden_danger__review_desc" placeholder="请输入整改情况" class="input-with-select" type="textarea" clearable />
|
<el-input v-model="form.hidden_danger__review_desc" placeholder="请输入整改情况" class="input-with-select" type="textarea" clearable maxlength="500" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -436,4 +445,16 @@ export default {
|
|||||||
height: 26.8px;
|
height: 26.8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.classify{
|
||||||
|
width: 100%;
|
||||||
|
// display: inline-block;
|
||||||
|
padding: 10px 0;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #1890ff;
|
||||||
|
span{
|
||||||
|
height: 100%;
|
||||||
|
line-height: 18.4px;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -90,6 +90,7 @@ export default {
|
|||||||
data: [],
|
data: [],
|
||||||
deptTree: [],
|
deptTree: [],
|
||||||
ids: [],
|
ids: [],
|
||||||
|
isBacklog: this.$route.query.isBacklog || false,
|
||||||
levels: [],
|
levels: [],
|
||||||
pager: {
|
pager: {
|
||||||
pageNo: 0,
|
pageNo: 0,
|
||||||
@ -174,6 +175,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
if (this.isBacklog) {
|
||||||
|
this.whereSql = ''
|
||||||
|
}
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -188,8 +192,7 @@ export default {
|
|||||||
api.getDate(
|
api.getDate(
|
||||||
this.pager.pageSize,
|
this.pager.pageSize,
|
||||||
pageNo,
|
pageNo,
|
||||||
this.whereSql,
|
this.whereSql
|
||||||
this.whereValue
|
|
||||||
).then(data => {
|
).then(data => {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
this.data = data.data.root
|
this.data = data.data.root
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item label="巡检名称">
|
<el-form-item label="巡检名称">
|
||||||
<el-input v-model="form.safe_insp__insp_name" />
|
<el-input v-model="form.safe_insp__insp_name" maxlength="250" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -52,7 +52,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item label="备注">
|
<el-form-item label="备注">
|
||||||
<el-input v-model="form.safe_insp__insp_memo" />
|
<el-input v-model="form.safe_insp__insp_memo" maxlength="500" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item label="巡检单编号">
|
<el-form-item label="巡检单编号">
|
||||||
<el-input v-model="form.safe_insp__insp_code" />
|
<el-input v-model="form.safe_insp__insp_code" maxlength="250" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
@ -27,7 +27,7 @@
|
|||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item ref="safe_insp__insp_name" label="巡检名称" prop="safe_insp__insp_name">
|
<el-form-item ref="safe_insp__insp_name" label="巡检名称" prop="safe_insp__insp_name">
|
||||||
<el-input v-model="form.safe_insp__insp_name" placeholder="请选择巡检名称" class="input-with-select" clearable>
|
<el-input v-model="form.safe_insp__insp_name" placeholder="请选择巡检名称" class="input-with-select" clearable>
|
||||||
<el-button slot="append" icon="el-icon-search" @click="inspNameVisible = !inspNameVisible" />
|
<el-button slot="append" icon="el-icon-search" maxlength="250" @click="inspNameVisible = !inspNameVisible" />
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -54,7 +54,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item label="备注">
|
<el-form-item label="备注">
|
||||||
<el-input v-model="form.safe_insp__insp_memo" />
|
<el-input v-model="form.safe_insp__insp_memo" maxlength="500" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item label="备注">
|
<el-form-item label="备注">
|
||||||
<el-input v-model="form.safe_insp__insp_memo" />
|
<el-input v-model="form.safe_insp__insp_memo" maxlength="500" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -199,6 +199,7 @@ export default {
|
|||||||
console.log(this.id)
|
console.log(this.id)
|
||||||
this.getList()
|
this.getList()
|
||||||
this.getTypeSel()
|
this.getTypeSel()
|
||||||
|
this.getInsptimes()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getList() {
|
getList() {
|
||||||
@ -215,7 +216,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
async getTypeSel() {
|
async getTypeSel() {
|
||||||
await publicApi.getTypeSel('insptimes').then(data => {
|
await publicApi.getTypeSel('inspstate').then(data => {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
this.options = data.data.root
|
this.options = data.data.root
|
||||||
} else {
|
} else {
|
||||||
@ -227,6 +228,7 @@ export default {
|
|||||||
await publicApi.getTypeSel('insptimes').then(data => {
|
await publicApi.getTypeSel('insptimes').then(data => {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
this.insptimes = data.data.root
|
this.insptimes = data.data.root
|
||||||
|
console.log(this.insptimes, 'this.insptimes')
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(data.message)
|
this.$message.error(data.message)
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,15 @@
|
|||||||
|
|
||||||
<el-dialog v-if="dialogFormVisible" :title="title" :visible.sync="dialogFormVisible" @close="closeDialog">
|
<el-dialog v-if="dialogFormVisible" :title="title" :visible.sync="dialogFormVisible" @close="closeDialog">
|
||||||
<el-form ref="form" :model="form" :rules="rules">
|
<el-form ref="form" :model="form" :rules="rules">
|
||||||
|
<el-form-item label="巡检项目" :label-width="formLabelWidth" prop="det_desc">
|
||||||
|
<el-input v-model="form.insp_det__det_name" type="text" disabled="false" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="巡检标准" :label-width="formLabelWidth" prop="det_desc">
|
||||||
|
<el-input v-model="form.insp_det__det_std" type="text" disabled="false" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="巡检方法" :label-width="formLabelWidth" prop="det_desc">
|
||||||
|
<el-input v-model="form.insp_det__det_way" type="text" disabled="false" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="巡检结果" :label-width="formLabelWidth" prop="insp_det__det_result">
|
<el-form-item label="巡检结果" :label-width="formLabelWidth" prop="insp_det__det_result">
|
||||||
<el-select v-model="form.insp_det__det_result" placeholder="请选择">
|
<el-select v-model="form.insp_det__det_result" placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
@ -67,7 +76,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="不符合描述" :label-width="formLabelWidth" prop="det_desc">
|
<el-form-item label="不符合描述" :label-width="formLabelWidth" prop="det_desc">
|
||||||
<el-input v-model="form.insp_det__det_desc" type="textarea" />
|
<el-input v-model="form.insp_det__det_desc" type="textarea" maxlength="500" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
|
@ -1,92 +1,92 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-card>
|
<el-card>
|
||||||
<el-form ref="auditForm" :model="form" :rules="rules">
|
<el-form ref="auditForm" :model="form" :rules="rules">
|
||||||
<el-form-item label="所属部门" :label-width="formLabelWidth">
|
<el-form-item label="所属部门" :label-width="formLabelWidth">
|
||||||
<el-select v-model="id" placeholder="请选择" disabled>
|
<el-select v-model="id" placeholder="请选择" disabled>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in data"
|
v-for="item in data"
|
||||||
:key="item.sys_dept__dept_id"
|
:key="item.sys_dept__dept_id"
|
||||||
:label="item.sys_dept__dept_name"
|
:label="item.sys_dept__dept_name"
|
||||||
:value="item.sys_dept__dept_id"
|
:value="item.sys_dept__dept_id"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="部门编码" :label-width="formLabelWidth" prop="sys_dept__dept_code">
|
<el-form-item label="部门编码" :label-width="formLabelWidth" prop="sys_dept__dept_code">
|
||||||
<el-input v-model="form.sys_dept__dept_code" @change="change" />
|
<el-input v-model="form.sys_dept__dept_code" maxlength="40" @change="change" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="部门名称" :label-width="formLabelWidth" prop="sys_dept__dept_name">
|
<el-form-item label="部门名称" :label-width="formLabelWidth" prop="sys_dept__dept_name">
|
||||||
<el-input v-model="form.sys_dept__dept_name" @change="change" />
|
<el-input v-model="form.sys_dept__dept_name" @change="change" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" :label-width="formLabelWidth" prop="sys_dept__memo">
|
<el-form-item label="备注" :label-width="formLabelWidth" prop="sys_dept__memo">
|
||||||
<el-input v-model="form.sys_dept__memo" @change="change" />
|
<el-input v-model="form.sys_dept__memo" maxlength="100" @change="change" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否注销" :label-width="formLabelWidth">
|
<el-form-item label="是否注销" :label-width="formLabelWidth">
|
||||||
<el-select v-model="form.sys_dept__is_novalid" placeholder="请选择" @change="change">
|
<el-select v-model="form.sys_dept__is_novalid" placeholder="请选择" @change="change">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in novalid"
|
v-for="item in novalid"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
id: {
|
id: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => []
|
||||||
},
|
},
|
||||||
auditForm: {
|
auditForm: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {}
|
default: () => {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
novalid: [
|
novalid: [
|
||||||
{
|
{
|
||||||
value: '0',
|
value: '0',
|
||||||
label: '否'
|
label: '否'
|
||||||
}, {
|
}, {
|
||||||
value: '1',
|
value: '1',
|
||||||
label: '是'
|
label: '是'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
sys_dept__dept_code: [
|
sys_dept__dept_code: [
|
||||||
{ required: true, message: '请输入部门编码', trigger: 'blur' }
|
{ required: true, message: '请输入部门编码', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
sys_dept__dept_name: [
|
sys_dept__dept_name: [
|
||||||
{ required: true, message: '请输入部门名称', trigger: 'blur' }
|
{ required: true, message: '请输入部门名称', trigger: 'blur' }
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
formLabelWidth: '120px',
|
formLabelWidth: '120px',
|
||||||
form: {}
|
form: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.form = JSON.parse(JSON.stringify(this.auditForm))
|
this.form = JSON.parse(JSON.stringify(this.auditForm))
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
change() {
|
change() {
|
||||||
this.$emit('change', this.form)
|
this.$emit('change', this.form)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-else-if="d.label === '操作'">
|
<div v-else-if="d.label === '操作'">
|
||||||
<el-button icon="el-icon-view" type="text" title="编辑" @click="edit(scope.row)" />
|
<el-button icon="el-icon-view" type="text" title="编辑" @click="edit(scope.row)" />
|
||||||
<el-button v-if="scope.row.status !== 'NULLIFY'" icon="el-icon-delete" style="color:#F56C6C" type="text" title="删除" @click="Delete(scope.row)" />
|
<!-- <el-button v-if="scope.row.status !== 'NULLIFY'" icon="el-icon-delete" style="color:#F56C6C" type="text" title="删除" @click="Delete(scope.row)" /> -->
|
||||||
</div>
|
</div>
|
||||||
<div v-else>{{ scope.row[d.prop] }}</div>
|
<div v-else>{{ scope.row[d.prop] }}</div>
|
||||||
</template>
|
</template>
|
||||||
@ -416,4 +416,9 @@ export default {
|
|||||||
.el-card {
|
.el-card {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
.el-tree{
|
||||||
|
height: 500px;
|
||||||
|
overflow-x:auto;
|
||||||
|
overflow-y:auto;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,211 +1,219 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-card>
|
<el-card>
|
||||||
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
|
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="姓名" prop="sys_user__user_name">
|
<el-form-item label="姓名" prop="sys_user__user_name">
|
||||||
<el-input v-model="form.sys_user__user_name" clearable @change="change" />
|
<el-input v-model="form.sys_user__user_name" clearable @change="change" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="工号" prop="sys_user__user_code">
|
<el-form-item label="工号" prop="sys_user__user_code">
|
||||||
<el-input v-model="form.sys_user__user_code" clearable @change="change" />
|
<el-input v-model="form.sys_user__user_code" clearable @change="change" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="部门名称" prop="sys_dept__dept_name">
|
<el-form-item ref="sys_dept__dept_name" label="部门名称" prop="sys_dept__dept_name">
|
||||||
<el-input v-model="form.sys_dept__dept_name" placeholder="请选择部门" class="input-with-select" clearable>
|
<el-input v-model="form.sys_dept__dept_name" placeholder="请选择部门" class="input-with-select" clearable>
|
||||||
<el-button slot="append" icon="el-icon-search" @click="selDeptVisible = !selDeptVisible" />
|
<el-button slot="append" icon="el-icon-search" @click="selDeptVisible = !selDeptVisible" />
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="部门负责人?">
|
<el-form-item label="部门负责人?">
|
||||||
<el-select v-model="form.sys_user__is_leader" placeholder="请选择" clearable @change="change">
|
<el-select v-model="form.sys_user__is_leader" placeholder="请选择" clearable @change="change">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in yesno"
|
v-for="item in yesno"
|
||||||
:key="item.funall_control__value_data"
|
:key="item.funall_control__value_data"
|
||||||
:label="item.funall_control__display_data"
|
:label="item.funall_control__display_data"
|
||||||
:value="item.funall_control__value_data"
|
:value="item.funall_control__value_data"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="职务">
|
<el-form-item label="职务">
|
||||||
<el-input v-model="form.sys_user__duty" clearable @change="change" />
|
<el-input v-model="form.sys_user__duty" clearable @change="change" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="固定电话">
|
<el-form-item label="固定电话">
|
||||||
<el-input v-model="form.sys_user__phone_code" clearable @change="change" />
|
<el-input v-model="form.sys_user__phone_code" clearable @change="change" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="手机号码">
|
<el-form-item label="手机号码">
|
||||||
<el-input v-model="form.sys_user__mob_code" clearable @change="change" />
|
<el-input v-model="form.sys_user__mob_code" clearable @change="change" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="性别">
|
<el-form-item label="性别">
|
||||||
<el-select v-model="form.sys_user__sex" placeholder="请选择" clearable @change="change">
|
<el-select v-model="form.sys_user__sex" placeholder="请选择" clearable @change="change">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in usersex"
|
v-for="item in usersex"
|
||||||
:key="item.funall_control__value_data"
|
:key="item.funall_control__value_data"
|
||||||
:label="item.funall_control__display_data"
|
:label="item.funall_control__display_data"
|
||||||
:value="item.funall_control__value_data"
|
:value="item.funall_control__value_data"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="邮箱">
|
<el-form-item label="邮箱">
|
||||||
<el-input v-model="form.sys_user__email" clearable @change="change" />
|
<el-input v-model="form.sys_user__email" clearable @change="change" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="是否注销">
|
<el-form-item label="是否注销">
|
||||||
<el-select v-model="form.sys_user__is_novalid" placeholder="请选择" clearable @change="change">
|
<el-select v-model="form.sys_user__is_novalid" placeholder="请选择" clearable @change="change">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in yesno"
|
v-for="item in yesno"
|
||||||
:key="item.funall_control__value_data"
|
:key="item.funall_control__value_data"
|
||||||
:label="item.funall_control__display_data"
|
:label="item.funall_control__display_data"
|
||||||
:value="item.funall_control__value_data"
|
:value="item.funall_control__value_data"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<el-form-item label="备注">
|
<el-form-item label="备注">
|
||||||
<el-input v-model="form.sys_user__memo" @change="change" />
|
<el-input v-model="form.sys_user__memo" maxlength="100" @change="change" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-if="selDeptVisible"
|
v-if="selDeptVisible"
|
||||||
class="selDept"
|
class="selDept"
|
||||||
title="选择部门"
|
title="选择部门"
|
||||||
:visible.sync="selDeptVisible"
|
:visible.sync="selDeptVisible"
|
||||||
width="60%"
|
width="60%"
|
||||||
:modal="false"
|
:modal="false"
|
||||||
>
|
>
|
||||||
<SelDept ref="seLDept" selective="single" @updateDept="updateDept" @updateDepts="updateDepts" />
|
<SelDept ref="seLDept" selective="single" @updateDept="updateDept" @updateDepts="updateDepts" />
|
||||||
<span>
|
<span>
|
||||||
<el-button @click="selDeptVisible = false">取 消</el-button>
|
<el-button @click="reformDeptVisible = false">取 消</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import api from '../api'
|
import api from '../api'
|
||||||
import SelDept from '@/components/selDept'
|
import SelDept from '@/components/selDept'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
SelDept
|
SelDept
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
id: {
|
id: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => []
|
||||||
},
|
},
|
||||||
auditForm: {
|
auditForm: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {}
|
default: () => {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
novalid: [
|
novalid: [
|
||||||
{
|
{
|
||||||
value: '0',
|
value: '0',
|
||||||
label: '否'
|
label: '否'
|
||||||
}, {
|
}, {
|
||||||
value: '1',
|
value: '1',
|
||||||
label: '是'
|
label: '是'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
sys_user__user_code: [
|
sys_user__user_code: [
|
||||||
{ required: true, message: '请输入工号', trigger: 'blur' }
|
{ required: true, message: '请输入工号', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
sys_user__user_name: [
|
sys_user__user_name: [
|
||||||
{ required: true, message: '请输入用户名称', trigger: 'blur' }
|
{ required: true, message: '请输入用户名称', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
sys_dept__dept_name: [
|
sys_dept__dept_name: [
|
||||||
{ required: true, message: '请选择部门名称', trigger: 'blur' }
|
{ required: true, message: '请选择部门名称', trigger: 'blur' }
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
formLabelWidth: '120px',
|
formLabelWidth: '120px',
|
||||||
form: {},
|
form: {},
|
||||||
yesno: [],
|
yesno: [],
|
||||||
usersex: [],
|
usersex: [],
|
||||||
selDeptVisible: false
|
selDeptVisible: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async created() {
|
watch: {
|
||||||
await this.getYesNo()
|
'form.sys_dept__dept_name': {
|
||||||
await this.getSex()
|
handler(val, oldVal) {
|
||||||
await this.init()
|
this.$refs['sys_dept__dept_name'].clearValidate()
|
||||||
},
|
},
|
||||||
methods: {
|
deep: true
|
||||||
init() {
|
}
|
||||||
this.form = JSON.parse(JSON.stringify(this.auditForm))
|
},
|
||||||
},
|
async created() {
|
||||||
change() {
|
await this.getYesNo()
|
||||||
console.log(this.form, 'this.form')
|
await this.getSex()
|
||||||
this.$emit('change', this.form)
|
await this.init()
|
||||||
},
|
},
|
||||||
getYesNo() {
|
methods: {
|
||||||
api.getSelect('yesno').then(data => {
|
init() {
|
||||||
if (data.success) {
|
this.form = JSON.parse(JSON.stringify(this.auditForm))
|
||||||
this.yesno = data.data.root
|
},
|
||||||
} else {
|
change() {
|
||||||
this.$message.error(data.message)
|
console.log(this.form, 'this.form')
|
||||||
}
|
this.$emit('change', this.form)
|
||||||
})
|
},
|
||||||
},
|
getYesNo() {
|
||||||
getSex() {
|
api.getSelect('yesno').then(data => {
|
||||||
api.getSelect('usersex').then(data => {
|
if (data.success) {
|
||||||
if (data.success) {
|
this.yesno = data.data.root
|
||||||
this.usersex = data.data.root
|
} else {
|
||||||
} else {
|
this.$message.error(data.message)
|
||||||
this.$message.error(data.message)
|
}
|
||||||
}
|
})
|
||||||
})
|
},
|
||||||
},
|
getSex() {
|
||||||
updateDept(data) {
|
api.getSelect('usersex').then(data => {
|
||||||
this.form.sys_dept__dept_name = data.sys_dept__dept_name
|
if (data.success) {
|
||||||
this.form.sys_user__dept_id = data.sys_dept__dept_id
|
this.usersex = data.data.root
|
||||||
this.selDeptVisible = false
|
} else {
|
||||||
this.change()
|
this.$message.error(data.message)
|
||||||
},
|
}
|
||||||
updateDepts(data) {
|
})
|
||||||
this.form.sys_dept__dept_name = data.map(d => { return d.sys_dept__dept_name }).join(';')
|
},
|
||||||
this.form.sys_user__dept_id = data.map(d => { return d.sys_dept__dept_id }).join(';')
|
updateDept(data) {
|
||||||
this.change()
|
this.form.sys_dept__dept_name = data.sys_dept__dept_name
|
||||||
this.selDeptVisible = false
|
this.form.sys_user__dept_id = data.sys_dept__dept_id
|
||||||
}
|
this.selDeptVisible = false
|
||||||
}
|
this.change()
|
||||||
}
|
},
|
||||||
</script>
|
updateDepts(data) {
|
||||||
|
this.form.sys_dept__dept_name = data.map(d => { return d.sys_dept__dept_name }).join(';')
|
||||||
<style lang="scss" scoped>
|
this.form.sys_user__dept_id = data.map(d => { return d.sys_dept__dept_id }).join(';')
|
||||||
.selDept{
|
this.change()
|
||||||
margin-top: -10vh;
|
this.selDeptVisible = false
|
||||||
}
|
}
|
||||||
</style>
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.selDept{
|
||||||
|
margin-top: -10vh;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-else-if="d.label === '操作'">
|
<div v-else-if="d.label === '操作'">
|
||||||
<el-button icon="el-icon-view" type="text" title="编辑" @click="edit(scope.row)" />
|
<el-button icon="el-icon-view" type="text" title="编辑" @click="edit(scope.row)" />
|
||||||
<el-button v-if="scope.row.status !== 'NULLIFY'" icon="el-icon-delete" style="color:#F56C6C" type="text" title="删除" @click="Delete(scope.row)" />
|
<!-- <el-button v-if="scope.row.status !== 'NULLIFY'" icon="el-icon-delete" style="color:#F56C6C" type="text" title="删除" @click="Delete(scope.row)" /> -->
|
||||||
</div>
|
</div>
|
||||||
<div v-else>{{ scope.row[d.prop] }}</div>
|
<div v-else>{{ scope.row[d.prop] }}</div>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user