|
|
@@ -8,17 +8,17 @@
|
|
|
ref="ruleForm"
|
|
|
>
|
|
|
<h3>认证产品编辑</h3><br>
|
|
|
- <el-form-item label="中文名称" prop="cn">
|
|
|
- <el-input v-model="ruleForm.cn"></el-input>
|
|
|
+ <el-form-item label="中文名称" prop="name">
|
|
|
+ <el-input v-model="ruleForm.name"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="英文名称" prop="en">
|
|
|
- <el-input v-model="ruleForm.en"></el-input>
|
|
|
+ <el-form-item label="英文名称" prop="english_name">
|
|
|
+ <el-input v-model="ruleForm.english_name"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="状态" prop="status">
|
|
|
<el-input v-model="ruleForm.status"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="排序" prop="sort">
|
|
|
- <el-input v-model="ruleForm.sort"></el-input>
|
|
|
+ <el-form-item label="排序" prop="order">
|
|
|
+ <el-input v-model="ruleForm.order"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="价格" prop="price">
|
|
|
<el-input v-model="ruleForm.price"></el-input>
|
|
|
@@ -26,15 +26,15 @@
|
|
|
<el-form-item label="配图" prop="img">
|
|
|
<el-input v-model="ruleForm.img"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="简介" prop="summary">
|
|
|
- <el-input type="textarea" v-model="ruleForm.summary"></el-input>
|
|
|
+ <el-form-item label="简介" prop="introduction">
|
|
|
+ <el-input type="textarea" v-model="ruleForm.introduction"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="证书" prop="id">
|
|
|
- <el-input type="textarea" v-model="ruleForm.id"></el-input>
|
|
|
+ <el-form-item label="证书" prop="content">
|
|
|
+ <el-input type="textarea" v-model="ruleForm.content"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="说明" prop="remind">
|
|
|
+ <el-form-item label="说明" prop="description">
|
|
|
<quill-editor
|
|
|
- v-model="ruleForm.remind"
|
|
|
+ v-model="ruleForm.description"
|
|
|
ref="quillEditor"
|
|
|
class="editer"
|
|
|
:options="editorOption"
|
|
|
@@ -58,39 +58,33 @@ export default {
|
|
|
toolbar: [
|
|
|
['bold', 'italic', 'underline', 'strike'], // toggled buttons
|
|
|
['blockquote', 'code-block'],
|
|
|
-
|
|
|
[{ 'header': 1 }, { 'header': 2 }], // custom button values
|
|
|
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
|
|
|
[{ 'script': 'sub' }, { 'script': 'super' }], // superscript/subscript
|
|
|
[{ 'indent': '-1' }, { 'indent': '+1' }], // outdent/indent
|
|
|
[{ 'direction': 'rtl' }], // text direction
|
|
|
-
|
|
|
[{ 'size': ['small', false, 'large', 'huge'] }], // custom dropdown
|
|
|
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
|
|
|
-
|
|
|
- // [{ 'color': [] }, { 'background': [] }], // dropdown with defaults from theme
|
|
|
[{ 'font': [] }],
|
|
|
- // [{ 'align': [] }],
|
|
|
-
|
|
|
['clean'] // remove formatting button
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
ruleForm: {},
|
|
|
rules: {
|
|
|
- cn: [
|
|
|
+ name: [
|
|
|
{ required: true, message: '请输入数字', trigger: 'blur' },
|
|
|
],
|
|
|
- en: [
|
|
|
+ english_name: [
|
|
|
{ required: true, message: '请输入数字', trigger: 'blur' },
|
|
|
],
|
|
|
- id: [
|
|
|
+ status: [
|
|
|
{ required: true, message: '请输入数字', trigger: 'blur' },
|
|
|
],
|
|
|
- sort: [
|
|
|
+ order: [
|
|
|
{ required: true, message: '请输入数字', trigger: 'blur' },
|
|
|
],
|
|
|
- status: [
|
|
|
+ id: [
|
|
|
{ required: true, message: '请输入数字', trigger: 'blur' },
|
|
|
],
|
|
|
price: [
|
|
|
@@ -99,10 +93,13 @@ export default {
|
|
|
img: [
|
|
|
{ required: true, message: '请输入数字', trigger: 'blur' },
|
|
|
],
|
|
|
- summary: [
|
|
|
+ introduction: [
|
|
|
{ required: true, message: '请输入数字', trigger: 'blur' },
|
|
|
],
|
|
|
- remind: [
|
|
|
+ content: [
|
|
|
+ { required: true, message: '请输入数字', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ description: [
|
|
|
{ required: true, message: '请输入数字', trigger: 'blur' },
|
|
|
],
|
|
|
},
|
|
|
@@ -116,7 +113,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.getList()
|
|
|
+ this.getDetail()
|
|
|
},
|
|
|
methods: {
|
|
|
onEditorReady(editor) {
|
|
|
@@ -134,62 +131,29 @@ export default {
|
|
|
/**
|
|
|
* 保存或更新
|
|
|
*/
|
|
|
- async update() {
|
|
|
- // const ruleForm = this.ruleForm
|
|
|
- // const can_buy_monthly = ruleForm.can_buy_monthly ? '1' : '0'
|
|
|
- // const can_buy_quarterly = ruleForm.can_buy_quarterly ? '1' : '0'
|
|
|
- // const can_buy_yearly = ruleForm.can_buy_yearly ? '1' : '0'
|
|
|
- // const res = await this.$post("/api/admin/vip/update", {
|
|
|
- // ...ruleForm,
|
|
|
- // can_buy_monthly,
|
|
|
- // can_buy_quarterly,
|
|
|
- // can_buy_yearly,
|
|
|
- // })
|
|
|
- // if(res) this.$message({
|
|
|
- // message: '更新成功',
|
|
|
- // type: 'success'
|
|
|
- // })
|
|
|
- },
|
|
|
+ async update() {},
|
|
|
/**
|
|
|
* 提交
|
|
|
*/
|
|
|
- submitForm(formName) {
|
|
|
- // this.$refs[formName].validate((valid) => {
|
|
|
- // if(valid) {
|
|
|
- // console.log(this.ruleForm)
|
|
|
- // this.update()
|
|
|
- // } else {
|
|
|
- // console.log('error submit!!')
|
|
|
- // return false
|
|
|
- // }
|
|
|
- // })
|
|
|
- },
|
|
|
+ submitForm(formName) {},
|
|
|
/**
|
|
|
* 获取详情数据
|
|
|
*/
|
|
|
- async getDetail({ id }) {
|
|
|
- // const res = await this.$post("/api/admin/vip/getDetail", { id })
|
|
|
- // const data = res.data
|
|
|
- // const can_buy_monthly = data.can_buy_monthly === '1'
|
|
|
- // const can_buy_quarterly = data.can_buy_quarterly === '1'
|
|
|
- // const can_buy_yearly = data.can_buy_yearly === '1'
|
|
|
- // // ruleForm 相当于 detail, 这里同步下关键词
|
|
|
- // this.ruleForm = {
|
|
|
- // ...data,
|
|
|
- // can_buy_monthly,
|
|
|
- // can_buy_quarterly,
|
|
|
- // can_buy_yearly,
|
|
|
- // }
|
|
|
+ async getDetail() {
|
|
|
+ const id = this.$route.query.id
|
|
|
+ , res = await this.$post("/api/admin/cert/getDetail", { id })
|
|
|
+ , data = res.data
|
|
|
+ , can_buy_monthly = data.can_buy_monthly === '1'
|
|
|
+ , can_buy_quarterly = data.can_buy_quarterly === '1'
|
|
|
+ , can_buy_yearly = data.can_buy_yearly === '1'
|
|
|
+ // ruleForm 相当于 detail, 这里同步下关键词
|
|
|
+ this.ruleForm = {
|
|
|
+ ...data,
|
|
|
+ can_buy_monthly,
|
|
|
+ can_buy_quarterly,
|
|
|
+ can_buy_yearly,
|
|
|
+ }
|
|
|
},
|
|
|
- /**
|
|
|
- * 获取列表数据
|
|
|
- */
|
|
|
- async getList() {
|
|
|
- // const res = await this.$post("/api/admin/vip/getList")
|
|
|
- // // console.log(res)
|
|
|
- // this.list = res.data
|
|
|
- // this.titles = this.list.map(i => i.name)
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
</script>
|