Commit 07e43ca0 authored by 高宇's avatar 高宇

通用上传接口

parent 9d596a7e
...@@ -66,3 +66,28 @@ export function exportSysUnit(query) { ...@@ -66,3 +66,28 @@ export function exportSysUnit(query) {
responseType: 'blob' responseType: 'blob'
}) })
} }
// 7.查询所有用户信息
export function listUserAll(query) {
return request({
url: '/sysunit/querySysUsers',
method: 'get',
params: query
})
}
// 8.查询所有单位信息
export function listUnitAll(query) {
return request({
url: '/sysunit/querySysUnits',
method: 'get',
params: query
})
}
// 9.查询所有课程信息
export function listCourseAll(query) {
return request({
url: '/blesson/teaLess',
method: 'get',
params: query
})
}
...@@ -247,7 +247,7 @@ export default { ...@@ -247,7 +247,7 @@ export default {
_this.bussid = [] _this.bussid = []
res.rows.forEach(item => { res.rows.forEach(item => {
item.srclist = [] item.srclist = []
item.srclist.push(item.path) item.srclist.push(this.imagePath + item.path)
}) })
_this.tableData = res.rows _this.tableData = res.rows
_this.fullscreenLoading = false _this.fullscreenLoading = false
......
...@@ -233,7 +233,7 @@ export default { ...@@ -233,7 +233,7 @@ export default {
], ],
fileUpload: '/dev-api/common/fileUpload?file=' + this.file + '&temp=' + 'competitionSupport', fileUpload: '/dev-api/common/fileUpload?file=' + this.file + '&temp=' + 'competitionSupport',
// imagePath: 'http://49.232.167.247:20020/eduServer/', // imagePath: 'http://49.232.167.247:20020/eduServer/',
imagePath: 'http://192.168.1.12:8888/eduServer/', imagePath: 'http://49.232.167.247:20020/teaServer/',
imageUrl: '', imageUrl: '',
// 日期范围 // 日期范围
dateRange: [], dateRange: [],
...@@ -287,8 +287,6 @@ export default { ...@@ -287,8 +287,6 @@ export default {
this.form.contestPicture = res.data.businessId this.form.contestPicture = res.data.businessId
// this.imageUrl = this.imagePath + res.data.path // this.imageUrl = this.imagePath + res.data.path
this.form.url = res.data.url this.form.url = res.data.url
console.log('this.form.contestPicture', this.form.contestPicture)
}) })
}, },
/** 查询列表 */ /** 查询列表 */
......
...@@ -92,8 +92,8 @@ ...@@ -92,8 +92,8 @@
<div :id="step(scope.$index)"> <div :id="step(scope.$index)">
<el-image <el-image
style="width:100%;height:100%;" style="width:100%;height:100%;"
:src="scope.row.url" :src="imagePath+scope.row.url"
:preview-src-list="[scope.row.url]" :preview-src-list="[imagePath+scope.row.url]"
@click="handleClickStop(scope.$index)" @click="handleClickStop(scope.$index)"
@mouseover="justEnter($event)" @mouseover="justEnter($event)"
@mouseout="justOut($event)" @mouseout="justOut($event)"
...@@ -246,6 +246,7 @@ export default { ...@@ -246,6 +246,7 @@ export default {
data() { data() {
return { return {
imageUrl: '', imageUrl: '',
imagePath: 'http://49.232.167.247:20020/teaServer/',
dialogImageUrl: '', dialogImageUrl: '',
dialogVisible: false, dialogVisible: false,
disabled: false, disabled: false,
...@@ -400,7 +401,6 @@ export default { ...@@ -400,7 +401,6 @@ export default {
this.cmsDevelopmentList = response.rows this.cmsDevelopmentList = response.rows
this.total = response.total this.total = response.total
this.loading = false this.loading = false
this.imagUrl = this.cmsDevelopmentList.img
} }
) )
}, },
...@@ -455,7 +455,7 @@ export default { ...@@ -455,7 +455,7 @@ export default {
const id = row.businessId const id = row.businessId
getCmsDevelopment(id).then(response => { getCmsDevelopment(id).then(response => {
this.form = response.data this.form = response.data
this.imagUrl = response.data.url form.url = this.imagePath + response.data.url
this.open = true this.open = true
this.title = '修改发展历程' this.title = '修改发展历程'
}) })
......
...@@ -318,7 +318,7 @@ export default { ...@@ -318,7 +318,7 @@ export default {
_this.bussid = [] _this.bussid = []
res.rows.forEach(item => { res.rows.forEach(item => {
item.srclist = [] item.srclist = []
item.srclist.push(item.pictureId) item.srclist.push(this.imagePath + item.pictureId)
}) })
_this.tableData = res.rows _this.tableData = res.rows
_this.fullscreenLoading = false _this.fullscreenLoading = false
......
...@@ -231,7 +231,7 @@ export default { ...@@ -231,7 +231,7 @@ export default {
formData.append('temp', 'newInformation') formData.append('temp', 'newInformation')
uploadPublic(formData).then(res => { uploadPublic(formData).then(res => {
this.form.pictureId = res.data.businessId this.form.pictureId = res.data.businessId
this.imageUrl = res.data.path this.imageUrl = res.data.url
}) })
}, },
handleImageAdded: function(file, Editor, cursorLocation, reseter) { handleImageAdded: function(file, Editor, cursorLocation, reseter) {
......
...@@ -52,8 +52,8 @@ ...@@ -52,8 +52,8 @@
</el-form-item> </el-form-item>
<el-form-item label="结束日期" prop="endTime"> <el-form-item label="结束日期" prop="endTime">
<el-date-picker <el-date-picker
value-format="yyyy-MM-dd"
v-model="queryParams.endDate" v-model="queryParams.endDate"
value-format="yyyy-MM-dd"
size="small" size="small"
type="date" type="date"
placeholder="结束日期" placeholder="结束日期"
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
@pagination="getList" @pagination="getList"
/> />
<!-- 添加或修改角色配置对话框 --> <!-- 添加或修改角色配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1100px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="1100px" :close-on-click-modal="false" append-to-body @close="handleClose">
<el-form ref="form" :model="form" size="small" label-width="auto"> <el-form ref="form" :model="form" size="small" label-width="auto">
<!-- <div--> <!-- <div-->
<!-- v-for="(item, index) in form.settingList"--> <!-- v-for="(item, index) in form.settingList"-->
...@@ -169,14 +169,17 @@ ...@@ -169,14 +169,17 @@
prop="unit" prop="unit"
> >
<el-select <el-select
v-model="addForm.unit" v-model="addForm.unitId"
style="width: 120px" :disabled="unitDisplay"
filterable
style="width: 140px"
@change="handleUnitChange"
> >
<el-option <el-option
v-for="items in unitOptions" v-for="(items,index) in unitOptions"
:key="items.value" :key="index"
:label="items.label" :label="items.unitName"
:value="items.value" :value="items.businessId"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -187,14 +190,16 @@ ...@@ -187,14 +190,16 @@
prop="class" prop="class"
> >
<el-select <el-select
v-model="addForm.class" v-model="addForm.lessonId"
filterable
style="width: 140px" style="width: 140px"
@change="handleLessonChange"
> >
<el-option <el-option
v-for="items in classOptions" v-for="(items,index) in classOptions"
:key="items.value" :key="index"
:label="items.label" :label="items.lessonName"
:value="items.value" :value="items.businessId"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -206,7 +211,7 @@ ...@@ -206,7 +211,7 @@
> >
<span> <span>
<el-date-picker <el-date-picker
v-model="addForm.createTime" v-model="addForm.beginDate"
style="width: 140px" style="width: 140px"
type="date" type="date"
placeholder="-" placeholder="-"
...@@ -224,7 +229,7 @@ ...@@ -224,7 +229,7 @@
> >
<span> <span>
<el-date-picker <el-date-picker
v-model="addForm.endTime" v-model="addForm.endDate"
style="width: 120px" style="width: 120px"
type="date" type="date"
placeholder="-" placeholder="-"
...@@ -240,7 +245,8 @@ ...@@ -240,7 +245,8 @@
<!-- </div>--> <!-- </div>-->
</el-form> </el-form>
<div style="padding: 20px;text-align: center"> <div style="padding: 20px;text-align: center">
<el-button class="fourWordsBtn" icon="el-icon-plus" size="mini" @click="handleAddShift">新增</el-button> <el-button class="fourWordsBtn" type="primary" icon="el-icon-plus" size="mini" @click="handleAddShift">新增</el-button>
<el-button class="fourWordsBtn" icon="el-icon-refresh" size="mini" @click="handleClear">重置</el-button>
</div> </div>
<el-table class="DBXXClass" border :data="form.settingList"> <el-table class="DBXXClass" border :data="form.settingList">
<el-table-column <el-table-column
...@@ -290,21 +296,19 @@ ...@@ -290,21 +296,19 @@
</template> </template>
<script> <script>
import { listRole, getRole, delRole, addRole, updateRole, exportRole, dataScope, changeRoleStatus } from '@/api/system/role' import { delRole } from '@/api/system/role'
import { roleMenuTreeSelectMC, treeSelect as menuTreeSelect, roleMenuTreeSelect } from '@/api/system/menu'
import Coolbutton from '@/components/coolbutton'
import { getDataCache, setDataCache } from '@/assets/js/filterData' import { getDataCache, setDataCache } from '@/assets/js/filterData'
import commonField from '@/utils/commonField' import commonField from '@/utils/commonField'
import { queryDirectionsList } from '@/api/courseManagement/indexApi' import { queryDirectionsList } from '@/api/courseManagement/indexApi'
import { listClass } from '@/api/classManagement' import { listClass } from '@/api/classManagement'
import { listCourseAll, listUnitAll } from '@/api/sysUnit'
export default { export default {
name: 'Role', name: 'Role',
components: { Coolbutton },
data() { data() {
return { return {
// 修改页面默认打开的树壮菜单 // 修改页面默认打开的树壮菜单
updateMenu: [], updateMenu: [],
unitDisplay: false,
hasDelPerm: ['sys:role:delete'], hasDelPerm: ['sys:role:delete'],
hasResetPerm: ['sys:role:resetPwd'], hasResetPerm: ['sys:role:resetPwd'],
hasUpdatePerm: ['sys:role:update'], hasUpdatePerm: ['sys:role:update'],
...@@ -322,21 +326,8 @@ export default { ...@@ -322,21 +326,8 @@ export default {
total: 6, total: 6,
// 角色表格数据 // 角色表格数据
dateList: [], dateList: [],
unitOptions: [ unitOptions: [],
{ value: '融创软通', label: '融创软通' }, classOptions: [],
{ value: '华软创新', label: '华软创新' },
{ value: '天津工业大学', label: '天津工业大学' },
{ value: '天津师范大学', label: '天津师范大学' },
{ value: '天津大学', label: '天津大学' }
],
classOptions: [
{ value: '软件项目管理', label: '软件项目管理' },
{ value: '计算机网络', label: '计算机网络' },
{ value: '小程序', label: '小程序' },
{ value: 'Web开发技术', label: 'Web开发技术' },
{ value: '计算机网络', label: '计算机网络' },
{ value: 'PHP', label: 'PHP' }
],
// 弹出层标题 // 弹出层标题
title: '', title: '',
// 是否显示弹出层 // 是否显示弹出层
...@@ -403,39 +394,16 @@ export default { ...@@ -403,39 +394,16 @@ export default {
}, },
courseDirection: [], courseDirection: [],
addForm: { addForm: {
unit: '', unitId: '',
class: '', unitName: '',
createTime: '', lessonId: '',
endTime: '' lessonName: '',
beginDate: null,
endDate: null
}, },
// 表单参数 // 表单参数
form: { form: {
settingList: [ settingList: []
{
unit: '融创软通',
class: 'JAVA',
createTime: '2023-11-02',
endTime: '2024-03-12'
},
{
unit: '融创软通',
class: 'WEB',
createTime: '2024-01-02',
endTime: '2024-02-12'
},
{
unit: '融创软通',
class: '计算机技术',
createTime: '2023-10-22',
endTime: '2024-01-12'
},
{
unit: '融创软通',
class: 'PHP',
createTime: '2023-07-22',
endTime: '2024-01-16'
}
]
}, },
defaultProps: { defaultProps: {
children: 'children', children: 'children',
...@@ -456,11 +424,74 @@ export default { ...@@ -456,11 +424,74 @@ export default {
next() next()
}, },
created() { created() {
this.getUnitOptions()
this.getClassOptions()
this.queryParams = JSON.parse(getDataCache(this.$route.path)) // 获取存储的筛选项 this.queryParams = JSON.parse(getDataCache(this.$route.path)) // 获取存储的筛选项
this.getList() // 列表查询 this.getList() // 列表查询
this.getCourseDirection() this.getCourseDirection()
}, },
methods: { methods: {
/** 1.获取全部单位**/
getUnitOptions() {
const obj = {
flag: '1'
}
listUnitAll(obj).then(res => {
this.unitOptions = res.data
})
},
/** 2.获取全部课程 **/
getClassOptions() {
const obj = {
flag: '1'
}
listCourseAll(obj).then(res => {
this.classOptions = res.data
})
},
/** 3.当用户选中单位时将单位选择框禁用**/
handleUnitChange(value) {
if (value && value !== '' && value !== undefined) {
this.unitDisplay = true
/**
* 根据value值查询该单位所开的课程
**/
} else {
this.unitDisplay = false
this.form.settingList = []
}
},
/** 4.清空时将单位回复正常**/
handleClear() {
this.unitDisplay = false
},
/** 5.关闭时请表单想和列表数据清空**/
handleClose() {
},
/** 6.重置方法**/
resetAddFrom() {
this.addForm = {
unitId: '',
unitName: '',
lessonId: '',
lessonName: '',
beginDate: null,
endDate: null
}
this.form.settingList = []
},
/** 7.当课程有值是将课程label查询*/
handleLessonChange(value) {
if (value && value !== '' && value !== undefined) {
if (this.classOptions.find(item => item.businessId === value)) {
this.addForm.lessonName = this.classOptions.find(item => item.businessId === value).lessonName
} else {
this.addForm.lessonName = null
}
}
},
handleAddShift() { handleAddShift() {
const params = JSON.parse(JSON.stringify(this.addForm)) const params = JSON.parse(JSON.stringify(this.addForm))
this.form.settingList.push(params) this.form.settingList.push(params)
...@@ -468,6 +499,7 @@ export default { ...@@ -468,6 +499,7 @@ export default {
handleDel(item, index) { handleDel(item, index) {
this.form.settingList.splice(index, 1) this.form.settingList.splice(index, 1)
}, },
// 获取课程方向 // 获取课程方向
getCourseDirection() { getCourseDirection() {
const that = this const that = this
...@@ -540,6 +572,7 @@ export default { ...@@ -540,6 +572,7 @@ export default {
handleAdd() { handleAdd() {
this.reset() this.reset()
this.open = true this.open = true
this.unitDisplay = false
this.title = '开课新增' this.title = '开课新增'
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
......
...@@ -22,16 +22,6 @@ ...@@ -22,16 +22,6 @@
style="width: 200px" style="width: 200px"
/> />
</el-form-item> </el-form-item>
<el-form-item prop="unitNumber" label="管理员账号">
<el-input
v-model="queryParams.unitNumber"
placeholder="管理员账号"
clearable
:maxlength="255"
size="small"
style="width: 200px"
/>
</el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button
:class="commonField.queryClass" :class="commonField.queryClass"
...@@ -74,12 +64,12 @@ ...@@ -74,12 +64,12 @@
{{ scope.row.unitName || '-' }} {{ scope.row.unitName || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="管理员账号" prop="unitNumber" :show-overflow-tooltip="true"> <el-table-column label="单位管理员" width="150" prop="unitNumber" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.unitNumber || '-' }} {{ scope.row.unitNumber || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="出口ip" prop="exitId" :show-overflow-tooltip="true"> <el-table-column label="出口ip" width="200" prop="exitId" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.exitId || '-' }} {{ scope.row.exitId || '-' }}
</template> </template>
...@@ -94,7 +84,7 @@ ...@@ -94,7 +84,7 @@
<span>{{ scope.row.createDate }}</span> <span>{{ scope.row.createDate }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="120" label="状态" prop="flag"> <el-table-column width="70" label="状态" prop="flag">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.flag" v-model="scope.row.flag"
...@@ -105,7 +95,7 @@ ...@@ -105,7 +95,7 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="150px"> <el-table-column label="操作" class-name="small-padding fixed-width" width="100px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
:class="commonField.updateClass" :class="commonField.updateClass"
...@@ -146,8 +136,8 @@ ...@@ -146,8 +136,8 @@
<el-form-item label="单位名称" prop="unitName"> <el-form-item label="单位名称" prop="unitName">
<el-input v-model.trim="form.unitName" :maxlength="30" placeholder="请输入单位名称" /> <el-input v-model.trim="form.unitName" :maxlength="30" placeholder="请输入单位名称" />
</el-form-item> </el-form-item>
<el-form-item label="管理员账号" prop="unitNumber"> <el-form-item label="单位管理员" prop="unitNumber">
<el-select v-model="form.unitNumber" style="width: 100%" clearable placeholder="请选择管理员账号"> <el-select v-model="form.unitNumber" filterable style="width: 100%" clearable placeholder="请选择管理员账号">
<el-option <el-option
v-for="(item,index) in userList" v-for="(item,index) in userList"
:key="index" :key="index"
...@@ -157,7 +147,7 @@ ...@@ -157,7 +147,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="出口Ip" prop="exitId"> <el-form-item label="出口Ip" prop="exitId">
<el-input v-model.trim="form.exitId" :maxlength="255" placeholder="请输入出口id" /> <el-input v-model.trim="form.exitId" :maxlength="255" placeholder="请输入出口ip" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -175,7 +165,8 @@ import { ...@@ -175,7 +165,8 @@ import {
delSysUnit, delSysUnit,
addSysUnit, addSysUnit,
updateSysUnit, updateSysUnit,
exportSysUnit } from '@/api/sysUnit' exportSysUnit, listUserAll
} from '@/api/sysUnit'
import commonField from '@/utils/commonField' import commonField from '@/utils/commonField'
import { listUser } from '@/api/system/user' import { listUser } from '@/api/system/user'
export default { export default {
...@@ -237,9 +228,13 @@ export default { ...@@ -237,9 +228,13 @@ export default {
flag: '' flag: ''
}, },
// 表单参数 // 表单参数
form: {}, form: {
unitType: '1'
},
// 表单校验 // 表单校验
rules: { rules: {
unitType: [{ required: true, message: '请选择单位类型', trigger: 'blur' }],
unitName: [{ required: true, message: '请输入单位名称', trigger: 'blur' }]
} }
} }
}, },
...@@ -254,8 +249,8 @@ export default { ...@@ -254,8 +249,8 @@ export default {
}, },
methods: { methods: {
getUserList() { getUserList() {
listUser().then(res => { listUserAll().then(res => {
this.userList = res.rows this.userList = res.data
}) })
}, },
/** 根据value查label**/ /** 根据value查label**/
...@@ -293,7 +288,7 @@ export default { ...@@ -293,7 +288,7 @@ export default {
createdDate: undefined, createdDate: undefined,
updatedBy: undefined, updatedBy: undefined,
updatedDate: undefined, updatedDate: undefined,
unitType: undefined, unitType: '1',
unitName: undefined, unitName: undefined,
unitNumber: undefined, unitNumber: undefined,
exitId: undefined, exitId: undefined,
...@@ -430,12 +425,6 @@ export default { ...@@ -430,12 +425,6 @@ export default {
background-color: #F4F4F4; background-color: #F4F4F4;
margin-bottom: 10px margin-bottom: 10px
} }
::v-deep .el-table th .cell{
justify-content: center!important;
}
::v-deep .el-table td .cell{
text-align: center!important;
}
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment