新增日志等

dev_2022-03-03
yujialong 3 years ago
parent 9c448af60b
commit 06fbe7d4c7
  1. 5
      src/router/index.js
  2. 2
      src/views/serve/addModel.vue
  3. 220
      src/views/system/addLog.vue
  4. 6
      src/views/system/manageLog.vue
  5. 14
      src/views/system/staff.vue

@ -117,6 +117,11 @@ let router = new Router({
component: () => import( '../views/system/manageLog'), component: () => import( '../views/system/manageLog'),
// meta: { title: '数据管理' } // meta: { title: '数据管理' }
}, },
{
path: '/addLog',
component: () => import( '../views/system/addLog'),
// meta: { title: '数据管理' }
},
{ {
path: '/permission', path: '/permission',
component: () => import('../views/customer/Permission.vue'), component: () => import('../views/customer/Permission.vue'),

@ -17,7 +17,7 @@
<el-card shadow="hover"> <el-card shadow="hover">
<el-form ref="form" label-width="120px" :disabled="isDetail"> <el-form ref="form" label-width="120px" :disabled="isDetail">
<el-form-item label="模型名称"> <el-form-item label="模型名称">
<el-input placeholder="请输入模型名称" v-model="form.modelName" maxlength="25"></el-input> <el-input placeholder="请输入模型名称" v-model="form.modelName" maxlength="25" style="width: 400px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="模型代码"> <el-form-item label="模型代码">
<codemirror <codemirror

@ -0,0 +1,220 @@
<template>
<div class="wrap">
<el-card shadow="hover" class="mgb20">
<div class="flex-between">
<div class="per_title" v-preventReClick @click="$router.back()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school" v-text="id ? '编辑更新日志' : '新增更新日志'"></span>
</div>
<div v-if="!isDetail">
<el-button type="primary" round v-preventReClick @click="submit(1)">发布</el-button>
<el-button v-if="!postStatus" type="primary" round v-preventReClick @click="submit(0)">草稿</el-button>
</div>
</div>
</el-card>
<el-card shadow="hover">
<el-form ref="form" label-width="120px" :disabled="isDetail">
<el-form-item label="版本标题">
<el-input placeholder="请输入版本标题" v-model="form.modelName" maxlength="30" style="width: 400px"></el-input>
</el-form-item>
<el-form-item label="封面图片">
<el-upload
class="avatar-uploader"
accept=".jpg,.png,.jpeg"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.fileupload"
:headers="headers"
name="file"
>
<img v-if="coverUrl" :src="coverUrl" class="avatar">
<div class="uploader-default" v-else>
<i class="el-icon-plus"></i>
<p>上传封面</p>
</div>
</el-upload>
</el-form-item>
<el-form-item label="更新内容">
<ul class="contents">
<li v-for="(item, i) in form.content" :key="i">
<div class="action">
<el-select v-model="value" size="small" placeholder="请选择版本">
<el-option
v-for="item in vers"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<div class="btns">
<i v-if="i === form.content.length - 1" class="el-icon-circle-plus-outline" @click="add"></i>
<i class="el-icon-delete" @click="del"></i>
</div>
</div>
<el-input
type="textarea"
:rows="5"
placeholder="请输入"
v-model="textarea">
</el-input>
</li>
</ul>
</el-form-item>
</el-form>
</el-card>
</div>
</template>
<script>
export default {
data() {
return {
categoryId : this.$route.query.categoryId,
form: {
modelName: '',
modelDemo: '',
content: [{}]
}
};
},
mounted() {
this.id && this.getData()
},
methods: {
//
getData() {
this.$post(`${this.api.modelFindById}?id=${this.id}`).then(res => {
const { data } = res
this.form.modelName = data.modelName
this.form.modelDemo = data.modelDemo
this.codeKey++
}).catch(res => {})
},
//
add() {
this.form.content.push({})
},
//
del() {
},
//
submit(postStatus){
const { modelName, modelDemo } = this.form
const id = this.id
if (!modelName) return this.$message.error('请输入模型名称')
if (!modelDemo) return this.$message.error('请输入模型代码')
const data = {
categoryId: this.categoryId,
modelName,
modelDemo,
postStatus
}
if (id) {
data.id = id
this.$post(this.api.updateSysModelDemo, data).then(res => {
this.$message.success('编辑成功')
this.$router.back()
}).catch(res => {})
} else {
this.$post(this.api.saveSysModelDemo, data).then(res => {
this.$message.success('新增成功')
this.$router.back()
}).catch(res => {})
}
},
}
};
</script>
<style lang="scss" scoped>
$avatar-width: 104px;
/deep/ .avatar-uploader {
.el-upload {
position: relative;
width: $avatar-width;
height: auto;
border: 1px dashed #d9d9d9;
border-radius: 2px;
cursor: pointer;
overflow: hidden;
&:hover {
border-color: #409EFF;
}
.uploader-default {
display: flex;
flex-direction: column;
justify-content: center;
width: $avatar-width !important;
height: $avatar-width;
text-align: center;
background: rgba(0, 0, 0, 0.04);
i {
font-size: 20px;
font-weight: bold;
color: #8c939d;
}
p {
margin-top: 10px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
line-height: 1;
}
}
.avatar {
width: $avatar-width;
height: $avatar-width;
display: block;
}
}
.el-upload__tip {
margin-top: 0;
p {
font-size: 14px;
color: rgba(0, 0, 0, 0.45);
line-height: 1;
&:first-child {
margin-bottom: 5px;
}
}
}
}
.contents {
width: 700px;
li {
padding: 15px;
margin-bottom: 20px;
border: 1px dashed #e9e9e9;
border-radius: 8px;
}
.action {
display: flex;
justify-content: space-between;
margin-bottom: 15px;
}
.btns {
i {
margin-left: 10px;
color: #9076FF;
cursor: pointer;
&:hover {
opacity: .9;
}
}
}
}
</style>

@ -16,7 +16,7 @@
</div> </div>
</div> </div>
<div> <div>
<el-button type="primary">新增日志</el-button> <el-button type="primary" @click="add">新增日志</el-button>
</div> </div>
</div> </div>
<el-timeline class="timeline"> <el-timeline class="timeline">
@ -60,6 +60,10 @@ export default {
this.total = res.rolePage.total; this.total = res.rolePage.total;
}).catch(res => {}); }).catch(res => {});
}, },
//
add() {
this.$router.push(`/addLog`)
},
// //
del(item) { del(item) {
this.$confirm("确定要删除分类吗?", "提示", { this.$confirm("确定要删除分类吗?", "提示", {

@ -1,6 +1,17 @@
<template> <template>
<div class="wrap"> <div class="wrap">
<div class="side"> <div class="side">
<div class="m-b-20">
<el-radio-group v-model="studentType" @change="changeStudentType">
<div class="m-b-20">
<el-radio :label="1">所有员工</el-radio>
</div>
<div>
<el-radio :label="2">未加入部门的员工</el-radio>
</div>
</el-radio-group>
</div>
<el-divider></el-divider>
<org ref="org" @getSingle="getSingle" @getCheck="getCheck"></org> <org ref="org" @getSingle="getSingle" @getCheck="getCheck"></org>
</div> </div>
@ -600,6 +611,9 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.m-b-20 {
margin-bottom: 20px;
}
.wrap { .wrap {
display: flex; display: flex;
padding: 0 24px; padding: 0 24px;

Loading…
Cancel
Save