Commit 1c264e08 by Lyan

修改必填项

parent 7e128887
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
:key="item.value" :key="item.value"
:label="item.name" :label="item.name"
:value="item.value" :value="item.value"
v-show="item.value"
> >
</el-option> </el-option>
</el-select> </el-select>
...@@ -183,12 +183,12 @@ export default { ...@@ -183,12 +183,12 @@ export default {
title: [{ required: true, message: '不能为空', trigger: 'blur' }], title: [{ required: true, message: '不能为空', trigger: 'blur' }],
titleOld: [{ required: true, message: '不能为空', trigger: 'blur' }], titleOld: [{ required: true, message: '不能为空', trigger: 'blur' }],
keyword: [{ required: true, message: '不能为空', trigger: 'blur' }], keyword: [{ required: true, message: '不能为空', trigger: 'blur' }],
brief: [{ required: true, message: '不能为空', trigger: 'blur' }], // brief: [{ required: true, message: '不能为空', trigger: 'blur' }],
author: [{ required: true, message: '不能为空', trigger: 'blur' }], author: [{ required: true, message: '不能为空', trigger: 'blur' }],
source: [{ required: true, message: '不能为空', trigger: 'blur' }], source: [{ required: true, message: '不能为空', trigger: 'blur' }],
levels: [{ required: true, message: '不能为空', trigger: 'blur' }], levels: [{ required: true, message: '不能为空', trigger: 'blur' }],
directpath: [{ required: true, message: '不能为空', trigger: 'blur' }], // directpath: [{ required: true, message: '不能为空', trigger: 'blur' }],
pic: [{ required: true, message: '不能为空', trigger: 'blur' }], // pic: [{ required: true, message: '不能为空', trigger: 'blur' }],
// content: [ // content: [
// { required: true, message: '不能为空', trigger: 'blur' } // { required: true, message: '不能为空', trigger: 'blur' }
// ], // ],
......
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
<el-select v-model="dataForm.piclevel" placeholder="请输入级别" v-show="!showInfo"> <el-select v-model="dataForm.piclevel" placeholder="请输入级别" v-show="!showInfo">
<el-option <el-option
v-for="item in piclevelList" v-for="item in piclevelList"
:key="item" :key="item.value"
:label="item" :label="item.name"
:value="item"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
<p v-show="showInfo">{{dataForm.piclevel}}</p> <p v-show="showInfo">{{dataForm.piclevel}}</p>
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
</template> </template>
<script> <script>
import { piclevelList } from '@/utils'
export default { export default {
data () { data () {
return { return {
...@@ -100,13 +101,13 @@ export default { ...@@ -100,13 +101,13 @@ export default {
pictureType: '', pictureType: '',
picFile: '', picFile: '',
editor: '', editor: '',
piclevel: '', piclevel: 1,
status: '', status: '',
keyword: '', keyword: '',
jumppath: '', jumppath: '',
showtime: '' showtime: ''
}, },
piclevelList: [1, 2, 3, 4, 5, 6, 7, 8, 9], piclevelList,
pictureTypeList: [ pictureTypeList: [
{ {
value: '图片信息', value: '图片信息',
......
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
<el-select v-model="dataForm.level" placeholder="请输入级别" v-show="!showInfo"> <el-select v-model="dataForm.level" placeholder="请输入级别" v-show="!showInfo">
<el-option <el-option
v-for="item in levelList" v-for="item in levelList"
:key="item" :key="item.value"
:label="item" :label="item.name"
:value="item"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
<p v-show="showInfo">{{dataForm.level}}</p> <p v-show="showInfo">{{dataForm.level}}</p>
...@@ -89,6 +89,7 @@ ...@@ -89,6 +89,7 @@
</template> </template>
<script> <script>
import { piclevelList } from '@/utils'
import Ueditor from '../temps/ueditor' import Ueditor from '../temps/ueditor'
export default { export default {
components: { components: {
...@@ -109,7 +110,7 @@ ...@@ -109,7 +110,7 @@
keyword: '', keyword: '',
author: '', author: '',
source: '', source: '',
level: '', level: 1,
jumppath: '', jumppath: '',
content: '', content: '',
releasetime: '', releasetime: '',
...@@ -142,26 +143,26 @@ ...@@ -142,26 +143,26 @@
], ],
source: [ source: [
{ required: true, message: '不能为空', trigger: 'blur' } { required: true, message: '不能为空', trigger: 'blur' }
], ]
releasetime: [ // releasetime: [
{ required: true, message: '不能为空', trigger: 'blur' } // { required: true, message: '不能为空', trigger: 'blur' }
], // ],
implementationtime: [ // implementationtime: [
{ required: true, message: '不能为空', trigger: 'blur' } // { required: true, message: '不能为空', trigger: 'blur' }
], // ],
// content: [ // content: [
// { required: true, message: '不能为空', trigger: 'blur' } // { required: true, message: '不能为空', trigger: 'blur' }
// ], // ],
remarks: [ // remarks: [
{ required: true, message: '不能为空', trigger: 'blur' } // { required: true, message: '不能为空', trigger: 'blur' }
] // ]
}, },
ueditor: { ueditor: {
value: '', value: '',
config: {} config: {}
}, },
levelList: [1, 2, 3, 4, 5, 6, 7, 8, 9], levelList: piclevelList,
id: [], id: [],
typeList: [ typeList: [
{ {
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
<el-button v-if="isAuth('manage:logistics:check')" type="text" size="small" @click="checkHandle(scope.row.id,1)">[成功]</el-button> <el-button v-if="isAuth('manage:logistics:check')" type="text" size="small" @click="checkHandle(scope.row.id,1)">[成功]</el-button>
<el-button v-if="isAuth('manage:logistics:check')" type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button> <el-button v-if="isAuth('manage:logistics:check')" type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button>
<br v-if="isAuth('manage:logistics:check')" /> <br v-if="isAuth('manage:logistics:check')" />
<el-button v-if="isAuth('manage:logistics:info')" type="text" size="small" @click="showMsg(scope.row)">预览</el-button> <!-- <el-button v-if="isAuth('manage:logistics:info')" type="text" size="small" @click="showMsg(scope.row)">预览</el-button> -->
<el-button v-if="isAuth('manage:logistics:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button> <el-button v-if="isAuth('manage:logistics:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button v-if="isAuth('manage:logistics:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button> <el-button v-if="isAuth('manage:logistics:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template> </template>
......
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
<el-select v-model="dataForm.level" placeholder="请输入级别" v-show="!showInfo"> <el-select v-model="dataForm.level" placeholder="请输入级别" v-show="!showInfo">
<el-option <el-option
v-for="item in levelList" v-for="item in levelList"
:key="item" :key="item.value"
:label="item" :label="item.name"
:value="item"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
<p v-show="showInfo">{{dataForm.level}}</p> <p v-show="showInfo">{{dataForm.level}}</p>
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,7 @@
</template> </template>
<script> <script>
import { piclevelList } from '@/utils'
import Ueditor from '../temps/ueditor' import Ueditor from '../temps/ueditor'
export default { export default {
components: { components: {
...@@ -105,7 +106,7 @@ ...@@ -105,7 +106,7 @@
keyword: '', keyword: '',
author: '', author: '',
source: '', source: '',
level: '', level: 1,
jumpath: '', jumpath: '',
content: '', content: '',
releasetime: '', releasetime: '',
...@@ -134,26 +135,26 @@ ...@@ -134,26 +135,26 @@
], ],
source: [ source: [
{ required: true, message: '不能为空', trigger: 'blur' } { required: true, message: '不能为空', trigger: 'blur' }
], ]
releasetime: [ // releasetime: [
{ required: true, message: '不能为空', trigger: 'blur' } // { required: true, message: '不能为空', trigger: 'blur' }
], // ],
implementationtime: [ // implementationtime: [
{ required: true, message: '不能为空', trigger: 'blur' } // { required: true, message: '不能为空', trigger: 'blur' }
], // ],
// content: [ // content: [
// { required: true, message: '不能为空', trigger: 'blur' } // { required: true, message: '不能为空', trigger: 'blur' }
// ], // ],
remarks: [ // remarks: [
{ required: true, message: '不能为空', trigger: 'blur' } // { required: true, message: '不能为空', trigger: 'blur' }
] // ]
}, },
ueditor: { ueditor: {
value: '', value: '',
config: {} config: {}
}, },
levelList: [1, 2, 3, 4, 5, 6, 7, 8, 9], levelList: piclevelList,
id: [], id: [],
typeList: [], typeList: [],
title: '' title: ''
......
...@@ -54,11 +54,11 @@ ...@@ -54,11 +54,11 @@
mounted () { mounted () {
}, },
methods: { methods: {
init (id, name) { init (id, name, ppth) {
this.dataForm.id = id || 0 this.dataForm.id = id || 0
this.visible = true this.visible = true
this.dataForm.name = name this.dataForm.name = name
this.dataForm.docfile = '' this.dataForm.docfile = ppth
}, },
// 表单提交 // 表单提交
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
width="150" width="150"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,scope.row.name)">修改</el-button><br /> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,scope.row.name,scope.row.ppath)">修改</el-button><br />
<el-button type="text" size="small" @click="allUpload(scope.row.id,-1)">[未上报]</el-button> <el-button type="text" size="small" @click="allUpload(scope.row.id,-1)">[未上报]</el-button>
<el-button type="text" size="small" @click="allUpload(scope.row.id,0)">[未上传]</el-button> <el-button type="text" size="small" @click="allUpload(scope.row.id,0)">[未上传]</el-button>
</template> </template>
...@@ -184,10 +184,10 @@ ...@@ -184,10 +184,10 @@
this.dataListSelections = val this.dataListSelections = val
}, },
// 新增 / 修改 // 新增 / 修改
addOrUpdateHandle (id, name) { addOrUpdateHandle (id, name, ppth) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, name) this.$refs.addOrUpdate.init(id, name, ppth)
}) })
}, },
checkHandle (data) { checkHandle (data) {
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
width="150" width="150"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,scope.row.name)">修改</el-button><br /> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,scope.row.name,scope.row.ppath)">修改</el-button><br />
<el-button type="text" size="small" @click="allUpload(scope.row.id,-1)">[未上报]</el-button> <el-button type="text" size="small" @click="allUpload(scope.row.id,-1)">[未上报]</el-button>
<el-button type="text" size="small" @click="allUpload(scope.row.id,0)">[未上传]</el-button> <el-button type="text" size="small" @click="allUpload(scope.row.id,0)">[未上传]</el-button>
</template> </template>
...@@ -184,10 +184,10 @@ ...@@ -184,10 +184,10 @@
this.dataListSelections = val this.dataListSelections = val
}, },
// 新增 / 修改 // 新增 / 修改
addOrUpdateHandle (id, name) { addOrUpdateHandle (id, name, ppath) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, name) this.$refs.addOrUpdate.init(id, name, ppath)
}) })
}, },
checkHandle (data) { checkHandle (data) {
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
width="150" width="150"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,scope.row.name)">修改</el-button><br /> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,scope.row.name,scope.row.ppath)">修改</el-button><br />
<el-button type="text" size="small" @click="allUpload(scope.row.id,-1)">[未上报]</el-button> <el-button type="text" size="small" @click="allUpload(scope.row.id,-1)">[未上报]</el-button>
<el-button type="text" size="small" @click="allUpload(scope.row.id,0)">[未上传]</el-button> <el-button type="text" size="small" @click="allUpload(scope.row.id,0)">[未上传]</el-button>
</template> </template>
...@@ -184,10 +184,10 @@ ...@@ -184,10 +184,10 @@
this.dataListSelections = val this.dataListSelections = val
}, },
// 新增 / 修改 // 新增 / 修改
addOrUpdateHandle (id, name) { addOrUpdateHandle (id, name, ppath) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, name) this.$refs.addOrUpdate.init(id, name, ppath)
}) })
}, },
checkHandle (data) { checkHandle (data) {
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
width="150" width="150"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,scope.row.name)">修改</el-button><br /> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,scope.row.name,scope.row.ppath)">修改</el-button><br />
<el-button type="text" size="small" @click="allUpload(scope.row.id,-1)">[未上报]</el-button> <el-button type="text" size="small" @click="allUpload(scope.row.id,-1)">[未上报]</el-button>
<el-button type="text" size="small" @click="allUpload(scope.row.id,0)">[未上传]</el-button> <el-button type="text" size="small" @click="allUpload(scope.row.id,0)">[未上传]</el-button>
</template> </template>
...@@ -184,10 +184,10 @@ ...@@ -184,10 +184,10 @@
this.dataListSelections = val this.dataListSelections = val
}, },
// 新增 / 修改 // 新增 / 修改
addOrUpdateHandle (id, name) { addOrUpdateHandle (id, name, ppath) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, name) this.$refs.addOrUpdate.init(id, name, ppath)
}) })
}, },
checkHandle (data) { checkHandle (data) {
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
width="150" width="150"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,scope.row.name)">修改</el-button><br /> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,scope.row.name,scope.row.ppath)">修改</el-button><br />
<el-button type="text" size="small" @click="allUpload(scope.row.id,-1)">[未上报]</el-button> <el-button type="text" size="small" @click="allUpload(scope.row.id,-1)">[未上报]</el-button>
<el-button type="text" size="small" @click="allUpload(scope.row.id,0)">[未上传]</el-button> <el-button type="text" size="small" @click="allUpload(scope.row.id,0)">[未上传]</el-button>
</template> </template>
...@@ -184,10 +184,10 @@ ...@@ -184,10 +184,10 @@
this.dataListSelections = val this.dataListSelections = val
}, },
// 新增 / 修改 // 新增 / 修改
addOrUpdateHandle (id, name) { addOrUpdateHandle (id, name, ppath) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, name) this.$refs.addOrUpdate.init(id, name, ppath)
}) })
}, },
checkHandle (data) { checkHandle (data) {
......
...@@ -39,105 +39,105 @@ ...@@ -39,105 +39,105 @@
<script> <script>
export default { export default {
data() { data () {
return { return {
showInfo: false, showInfo: false,
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
titleEn: "", titleEn: '',
titleCn: "", titleCn: '',
keyword: "", keyword: '',
brief: "", brief: '',
releasedate: "", releasedate: '',
updatedate: "", updatedate: '',
author: "", author: '',
content: "", content: '',
hits: "", hits: '',
editor: "", editor: '',
lasteditor: "", lasteditor: ''
}, },
dataRule: { dataRule: {
titleEn: [ titleEn: [
{ {
required: true, required: true,
message: "英文标题不能为空", message: '英文标题不能为空',
trigger: "blur", trigger: 'blur'
}, }
], ],
titleCn: [ titleCn: [
{ {
required: true, required: true,
message: "中文标题不能为空", message: '中文标题不能为空',
trigger: "blur", trigger: 'blur'
}, }
],
keyword: [
{
required: true,
message: "关键字不能为空",
trigger: "blur",
},
], ],
// keyword: [
// {
// required: true,
// message: '关键字不能为空',
// trigger: 'blur'
// }
// ],
brief: [ brief: [
{ {
required: true, required: true,
message: "解释不能为空", message: '解释不能为空',
trigger: "blur", trigger: 'blur'
}, }
], ]
author: [ // author: [
{ // {
required: true, // required: true,
message: "作者不能为空", // message: '作者不能为空',
trigger: "blur", // trigger: 'blur'
}, // }
], // ],
content: [ // content: [
{ // {
required: true, // required: true,
message: "备注不能为空", // message: '备注不能为空',
trigger: "blur", // trigger: 'blur'
}, // }
], // ]
}, }
}; }
}, },
methods: { methods: {
init(id) { init (id) {
this.dataForm.id = id || 0; this.dataForm.id = id || 0
this.visible = true; this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["dataForm"].resetFields(); this.$refs['dataForm'].resetFields()
if (this.dataForm.id) { if (this.dataForm.id) {
this.$http({ this.$http({
url: this.$http.adornUrl( url: this.$http.adornUrl(
`/office/glossary/info/${this.dataForm.id}` `/office/glossary/info/${this.dataForm.id}`
), ),
method: "get", method: 'get',
params: this.$http.adornParams(), params: this.$http.adornParams()
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataForm.titleEn = data.glossary.titleEn; this.dataForm.titleEn = data.glossary.titleEn
this.dataForm.titleCn = data.glossary.titleCn; this.dataForm.titleCn = data.glossary.titleCn
this.dataForm.keyword = data.glossary.keyword; this.dataForm.keyword = data.glossary.keyword
this.dataForm.brief = data.glossary.brief; this.dataForm.brief = data.glossary.brief
this.dataForm.author = data.glossary.author; this.dataForm.author = data.glossary.author
this.dataForm.content = data.glossary.content; this.dataForm.content = data.glossary.content
} }
}); })
} }
}); })
}, },
// 表单提交 // 表单提交
dataFormSubmit() { dataFormSubmit () {
this.$refs["dataForm"].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (valid) { if (valid) {
this.$http({ this.$http({
url: this.$http.adornUrl( url: this.$http.adornUrl(
`/office/glossary/${!this.dataForm.id ? "save" : "update"}` `/office/glossary/${!this.dataForm.id ? 'save' : 'update'}`
), ),
method: "post", method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
id: this.dataForm.id || undefined, id: this.dataForm.id || undefined,
titleEn: this.dataForm.titleEn, titleEn: this.dataForm.titleEn,
...@@ -145,26 +145,26 @@ export default { ...@@ -145,26 +145,26 @@ export default {
keyword: this.dataForm.keyword, keyword: this.dataForm.keyword,
brief: this.dataForm.brief, brief: this.dataForm.brief,
author: this.dataForm.author, author: this.dataForm.author,
content: this.dataForm.content, content: this.dataForm.content
}), })
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: "操作成功", message: '操作成功',
type: "success", type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.visible = false; this.visible = false
this.$emit("refreshDataList"); this.$emit('refreshDataList')
}, }
}); })
} else { } else {
this.$message.error(data.msg); this.$message.error(data.msg)
} }
}); })
} }
}); })
}, }
}, }
}; }
</script> </script>
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="标题" prop="title"> <el-form-item label="标题" prop="title">
<el-input v-model="dataForm.title" placeholder="请输入显示标题" v-show="!showInfo"></el-input> <el-input v-model="dataForm.title" placeholder="请输入显示标题" v-show="!showInfo"></el-input>
<p v-show="showInfo">{{dataForm.title}}</p> <p v-show="showInfo">{{dataForm.title}}</p>
</el-form-item> </el-form-item>
<el-form-item label='级别' prop='levels'> <el-form-item label='级别' prop='levels'>
<el-select v-model="dataForm.levels" placeholder="请输入级别" v-show="!showInfo"> <el-select v-model="dataForm.levels" placeholder="请输入级别" v-show="!showInfo">
<el-option <el-option
v-for="item in levelList" v-for="item in levelList"
...@@ -39,12 +39,12 @@ ...@@ -39,12 +39,12 @@
</el-select> </el-select>
<p v-show="showInfo">{{dataForm.level}}</p> <p v-show="showInfo">{{dataForm.level}}</p>
</el-form-item> </el-form-item>
<el-form-item label="跳转至" prop="directpath"> <el-form-item label="跳转至" prop="directpath">
<el-input v-model="dataForm.directpath" placeholder="请输入跳转地址" v-show="!showInfo"></el-input> <el-input v-model="dataForm.directpath" placeholder="请输入跳转地址" v-show="!showInfo"></el-input>
<p v-show="showInfo">{{dataForm.directpath}}</p> <p v-show="showInfo">{{dataForm.directpath}}</p>
</el-form-item> </el-form-item>
<el-form-item label="内容" prop="content" > <el-form-item label="内容" prop="content" >
<Ueditor @ready="editorReady" :value="ueditor.value" :config="ueditor.config" ref="ue" v-show="!showInfo"></Ueditor> <Ueditor @ready="editorReady" :value="ueditor.value" :config="ueditor.config" ref="ue" v-show="!showInfo"></Ueditor>
<!-- <el-input v-model="dataForm.content" placeholder="请输入内容"></el-input> --> <!-- <el-input v-model="dataForm.content" placeholder="请输入内容"></el-input> -->
<div v-show="showInfo" v-html="dataForm.content"></div> <div v-show="showInfo" v-html="dataForm.content"></div>
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
dataForm: { dataForm: {
id: 0, id: 0,
title: '', title: '',
levels: '', levels: 1,
class1id: '', class1id: '',
class2id: '', class2id: '',
directpath: '', directpath: '',
...@@ -85,13 +85,19 @@ ...@@ -85,13 +85,19 @@
}, },
dataRule: { dataRule: {
// title: [ class1id: [
// { required: true, message: '不能为空', trigger: 'blur' } { required: true, message: '不能为空', trigger: 'blur' }
// ], ],
class2: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
title: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
// levels: [ levels: [
// { required: true, message: '不能为空', trigger: 'blur' } { required: true, message: '不能为空', trigger: 'blur' }
// ] ]
}, },
ueditor: { ueditor: {
......
...@@ -27,7 +27,14 @@ ...@@ -27,7 +27,14 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="商品等级" prop="levels"> <el-form-item label="商品等级" prop="levels">
<el-input v-model="dataForm.levels" placeholder="请输入"></el-input> <el-select v-model="dataForm.levels" placeholder="请选择级别" v-show="!showInfo">
<el-option
v-for="item in piclevelList"
:key="item.value"
:label="item.name"
:value="item.value">
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="商品价格" prop="price"> <el-form-item label="商品价格" prop="price">
<el-input v-model="dataForm.price" placeholder="请输入"></el-input> <el-input v-model="dataForm.price" placeholder="请输入"></el-input>
...@@ -88,7 +95,7 @@ ...@@ -88,7 +95,7 @@
<script> <script>
import Ueditor from '../temps/ueditor' import Ueditor from '../temps/ueditor'
import { piclevelList } from '@/utils'
export default { export default {
components: { components: {
Ueditor Ueditor
...@@ -141,11 +148,13 @@ export default { ...@@ -141,11 +148,13 @@ export default {
link: '', link: '',
mark: '', mark: '',
type: '', type: '',
levels: '', levels: 1,
author: '', author: '',
status: '', status: '',
auditor: '' auditor: ''
}, },
piclevelList,
dataRule: { dataRule: {
prename: [ prename: [
{ {
...@@ -176,27 +185,27 @@ export default { ...@@ -176,27 +185,27 @@ export default {
trigger: 'blur' trigger: 'blur'
} }
], ],
predate: [ // predate: [
{ // {
required: true, // required: true,
message: '上市时间不能为空', // message: '上市时间不能为空',
trigger: 'blur' // trigger: 'blur'
} // }
], // ],
author: [ // author: [
{ // {
required: true, // required: true,
message: '作者不能为空', // message: '作者不能为空',
trigger: 'blur' // trigger: 'blur'
} // }
], // ],
company: [ // company: [
{ // {
required: true, // required: true,
message: '出版社不能为空', // message: '出版社不能为空',
trigger: 'blur' // trigger: 'blur'
} // }
], // ],
graph: [ graph: [
{ {
required: true, required: true,
...@@ -228,12 +237,15 @@ export default { ...@@ -228,12 +237,15 @@ export default {
} }
} }
}, },
created () {
this.dialogVisible = false
},
methods: { methods: {
init (id) { init (id) {
this.dataForm.id = id || 0 this.dataForm.id = id || 0
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.clearInp()
if (this.dataForm.id) { if (this.dataForm.id) {
this.$http({ this.$http({
url: this.$http.adornUrl( url: this.$http.adornUrl(
...@@ -243,6 +255,7 @@ export default { ...@@ -243,6 +255,7 @@ export default {
params: this.$http.adornParams() params: this.$http.adornParams()
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dialogVisible = true
console.log(data.product, 'data.productdata.productdata.product') console.log(data.product, 'data.productdata.productdata.product')
this.dataForm.prename = data.product.prename this.dataForm.prename = data.product.prename
this.dataForm.company = data.product.company this.dataForm.company = data.product.company
...@@ -400,6 +413,11 @@ export default { ...@@ -400,6 +413,11 @@ export default {
instance.addListener('contentChange', () => { instance.addListener('contentChange', () => {
this.dataForm.description = instance.getContent() this.dataForm.description = instance.getContent()
}) })
},
clearInp () {
this.$refs['dataForm'].resetFields()
this.dataForm.graph = ''
this.dialogVisible = false
} }
} }
} }
......
...@@ -26,10 +26,10 @@ ...@@ -26,10 +26,10 @@
<el-form-item label='级别:' prop='levels'> <el-form-item label='级别:' prop='levels'>
<el-select v-model="dataForm.levels" placeholder="请输入级别" v-show="!showInfo"> <el-select v-model="dataForm.levels" placeholder="请输入级别" v-show="!showInfo">
<el-option <el-option
v-for="item in levelList" v-for="item in piclevelList"
:key="item" :key="item.value"
:label="item" :label="item.name"
:value="item"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
<p v-show="showInfo">{{dataForm.levels}}</p> <p v-show="showInfo">{{dataForm.levels}}</p>
...@@ -89,176 +89,177 @@ ...@@ -89,176 +89,177 @@
</template> </template>
<script> <script>
import Ueditor from '../temps/ueditor' import { piclevelList } from '@/utils'
export default { import Ueditor from '../temps/ueditor'
components: { export default {
Ueditor components: {
}, Ueditor
data () { },
return { data () {
loading: false, return {
visible: false, loading: false,
showInfo: false, visible: false,
defaultProps: { showInfo: false,
children: 'children', defaultProps: {
label: 'label' children: 'children',
}, label: 'label'
dataForm: { },
id: 0, dataForm: {
title: '', id: 0,
keyword: '', title: '',
author: '', keyword: '',
source: '', author: '',
levels: '', source: '',
directpath: '', levels: '',
content: '', directpath: '',
publicdate: '', content: '',
startdate: '', publicdate: '',
class1: '', startdate: '',
brief: '', class1: '',
titleOld: '' brief: '',
}, titleOld: ''
cclassidStr: undefined, },
dataRule: { cclassidStr: undefined,
titleOld: [ dataRule: {
titleOld: [
{ required: true, message: '不能为空', trigger: 'blur' } { required: true, message: '不能为空', trigger: 'blur' }
], ],
title: [ title: [
{ required: true, message: '不能为空', trigger: 'blur' } { required: true, message: '不能为空', trigger: 'blur' }
], ],
class1: [ class1: [
{ required: true, message: '不能为空', trigger: 'blur' } { required: true, message: '不能为空', trigger: 'blur' }
], ],
levels: [ levels: [
{ required: true, message: '不能为空', trigger: 'blur' } { required: true, message: '不能为空', trigger: 'blur' }
], ],
keyword: [ keyword: [
{ required: true, message: '不能为空', trigger: 'blur' } { required: true, message: '不能为空', trigger: 'blur' }
], ],
// directpath: [ // directpath: [
// { required: true, message: '不能为空', trigger: 'blur' } // { required: true, message: '不能为空', trigger: 'blur' }
// ], // ],
author: [ author: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
source: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
publicdate: [
{ required: true, message: '不能为空', trigger: 'blur' } { required: true, message: '不能为空', trigger: 'blur' }
], ],
startdate: [ source: [
{ required: true, message: '不能为空', trigger: 'blur' } { required: true, message: '不能为空', trigger: 'blur' }
], ],
// publicdate: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
// startdate: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
// content: [ // content: [
// { required: true, message: '不能为空', trigger: 'blur' } // { required: true, message: '不能为空', trigger: 'blur' }
// ], // ],
remarks: [ remarks: [
{ required: true, message: '不能为空', trigger: 'blur' } { required: true, message: '不能为空', trigger: 'blur' }
] ]
}, },
ueditor: { ueditor: {
value: '', value: '',
config: {} config: {}
},
piclevelList,
id: [],
typeList: [
{
typeName: '法律法规'
}, },
levelList: [1, 2, 3, 4, 5, 6, 7, 8, 9], {
id: [], typeName: '相关标准'
typeList: [ }
{ ],
typeName: '法律法规' title: ''
}, }
{ },
typeName: '相关标准'
} created () {
], },
title: '' methods: {
} init (id, showInfo) {
}, this.dataForm.id = id || 0
this.visible = true
created () { this.showInfo = showInfo
this.$nextTick(() => {
this.clearInp()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/office/policy/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
this.loading = false
if (data && data.code === 0) {
this.dataForm = data.policy
this.dataForm.publicdate = data.policy.releasedate
this.dataForm.startdate = data.policy.updatedate
this.ueditor.value = this.dataForm.content
} else {
this.$message.error(data.msg)
}
})
}
})
}, },
methods: {
init (id, showInfo) {
this.dataForm.id = id || 0
this.visible = true
this.showInfo = showInfo
this.$nextTick(() => {
this.clearInp()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/office/policy/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
this.loading = false
if (data && data.code === 0) {
this.dataForm = data.policy
this.dataForm.publicdate = data.policy.releasedate
this.dataForm.startdate = data.policy.updatedate
this.ueditor.value = this.dataForm.content
} else {
this.$message.error(data.msg)
}
})
}
})
},
// 更新父子组件内容 // 更新父子组件内容
editorReady (instance) { editorReady (instance) {
instance.setContent(this.dataForm.content) instance.setContent(this.dataForm.content)
instance.addListener('contentChange', () => { instance.addListener('contentChange', () => {
this.dataForm.content = instance.getContent() this.dataForm.content = instance.getContent()
}) })
}, },
// 表单提交 // 表单提交
dataFormSubmit () { dataFormSubmit () {
this.loading = true this.loading = true
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (valid) { if (valid) {
this.$http({ this.$http({
url: this.$http.adornUrl(`/office/policy/${!this.dataForm.id ? 'save' : 'update'}`), url: this.$http.adornUrl(`/office/policy/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'id': this.dataForm.id || undefined, 'id': this.dataForm.id || undefined,
'titleOld': this.dataForm.titleOld, 'titleOld': this.dataForm.titleOld,
'title': this.dataForm.title, 'title': this.dataForm.title,
'class1': this.dataForm.class1, 'class1': this.dataForm.class1,
'keyword': this.dataForm.keyword, 'keyword': this.dataForm.keyword,
'author': this.dataForm.author, 'author': this.dataForm.author,
'source': this.dataForm.source, 'source': this.dataForm.source,
'levels': this.dataForm.levels, 'levels': this.dataForm.levels,
'directpath': this.dataForm.directpath, 'directpath': this.dataForm.directpath,
'content': this.dataForm.content, 'content': this.dataForm.content,
'brief': this.dataForm.brief, 'brief': this.dataForm.brief,
'publicdate': this.dataForm.publicdate, 'publicdate': this.dataForm.publicdate,
'startdate': this.dataForm.startdate 'startdate': this.dataForm.startdate
})
}).then(({data}) => {
this.loading = false
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
}) })
} }).then(({data}) => {
}) this.loading = false
}, if (data && data.code === 0) {
this.$message({
clearInp () { message: '操作成功',
this.$refs['dataForm'].resetFields() type: 'success',
this.ueditor.value = '' duration: 1500,
} onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
},
clearInp () {
this.$refs['dataForm'].resetFields()
this.ueditor.value = ''
} }
} }
}
</script> </script>
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
<el-select v-model="dataForm.piclevel" placeholder="请输入级别" v-show="!showInfo"> <el-select v-model="dataForm.piclevel" placeholder="请输入级别" v-show="!showInfo">
<el-option <el-option
v-for="item in piclevelList" v-for="item in piclevelList"
:key="item" :key="item.value"
:label="item" :label="item.name"
:value="item"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
<p v-show="showInfo">{{dataForm.piclevel}}</p> <p v-show="showInfo">{{dataForm.piclevel}}</p>
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
</template> </template>
<script> <script>
import { piclevelList } from '@/utils'
export default { export default {
data () { data () {
return { return {
...@@ -106,7 +107,7 @@ export default { ...@@ -106,7 +107,7 @@ export default {
jumppath: '', jumppath: '',
showtime: '' showtime: ''
}, },
piclevelList: [1, 2, 3, 4, 5, 6, 7, 8, 9], piclevelList,
pictureTypeList: [ pictureTypeList: [
{ {
value: '图片信息', value: '图片信息',
...@@ -164,13 +165,13 @@ export default { ...@@ -164,13 +165,13 @@ export default {
trigger: 'blur' trigger: 'blur'
} }
], ],
keyword: [ // keyword: [
{ // {
required: true, // required: true,
message: '不能为空', // message: '不能为空',
trigger: 'blur' // trigger: 'blur'
} // }
], // ],
// jumppath: [ // jumppath: [
// { // {
// required: true, // required: true,
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<el-form-item> <el-form-item>
<el-button @click="getDataList()" type="primary">查询</el-button> <el-button @click="getDataList()" type="primary">查询</el-button>
<el-button v-if="isAuth('manage:branch:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="isAuth('manage:branch:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('manage:branch:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <!-- <el-button v-if="isAuth('manage:branch:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> -->
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<el-button class="seach-btn" @click="getDataList2()" type="primary">搜索</el-button> <el-button class="seach-btn" @click="getDataList2()" type="primary">搜索</el-button>
</el-form> </el-form>
<div class="add-btn"> <div class="add-btn">
<el-button v-if="isAuth('manage:doc:save')" type="primary" @click="addOrUpdateHandle()"> + 添加</el-button> <el-button v-if="isAuth('manage:doc:save')" type="primary" @click="addOrUpdateHandle('',true)"> + 添加</el-button>
</div> </div>
<div class="table-list"> <div class="table-list">
<el-table <el-table
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
<el-button v-if="isAuth('manage:doc:check')" type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button> <el-button v-if="isAuth('manage:doc:check')" type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button>
<br v-if="isAuth('manage:doc:check')"/> <br v-if="isAuth('manage:doc:check')"/>
<el-button v-if="isAuth('manage:doc:info')" type="text" size="small" @click="downFile(scope.row.docfile)">预览</el-button> <el-button v-if="isAuth('manage:doc:info')" type="text" size="small" @click="downFile(scope.row.docfile)">预览</el-button>
<el-button v-if="isAuth('manage:doc:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button> <el-button v-if="isAuth('manage:doc:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id,false)">修改</el-button>
<el-button v-if="isAuth('manage:doc:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button> <el-button v-if="isAuth('manage:doc:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
......
...@@ -95,7 +95,6 @@ ...@@ -95,7 +95,6 @@
:key="item.value" :key="item.value"
:label="item.name" :label="item.name"
:value="item.value" :value="item.value"
v-show="item.value"
> >
</el-option> </el-option>
</el-select> </el-select>
...@@ -229,7 +228,7 @@ export default { ...@@ -229,7 +228,7 @@ export default {
name: '', name: '',
phone: '', phone: '',
email: '', email: '',
levels: '', levels: 1,
pic: '', pic: '',
brief: '' brief: ''
}, },
......
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