Commit 1c264e08 by Lyan

修改必填项

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