吴门医述完成

This commit is contained in:
liqianyouyou
2024-01-07 23:44:37 +08:00
parent 7212d5f2a6
commit 04ed3f3c72
2 changed files with 44 additions and 39 deletions

View File

@@ -269,9 +269,7 @@ export default {
this.addForm.productImages = row.img
this.addForm.content = row.content
this.addForm.typeId = row.type.toString()
this.$nextTick(()=>{
this.fileList = []
})
this.fileList = []
var img = {
name: '',
url: row.img

View File

@@ -2,18 +2,18 @@
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label="分类">
<el-select v-model="dataForm.dictType" placeholder="请选择分类">
<el-select v-model="dataForm.dictType" placeholder="请选择分类" clearable @clear="clearValue">
<el-option v-for="(item,index) in typeList" :key="index" :label="item.dictValue" :value="item.dictType">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="书名">
<el-input v-model="dataForm.ligthname" placeholder="请输入书名"></el-input>
<el-form-item label="内容">
<el-input v-model="dataForm.ligthname" placeholder="请输入内容" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="pageIndex = 1;getDataList()">查询</el-button>
<el-button v-if="isAuth('book:shopproduct:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
</el-form-item>
<el-form-item>
<el-button @click="pageIndex = 1;getDataList()">查询</el-button>
<el-button v-if="isAuth('book:shopproduct:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
@@ -25,14 +25,21 @@
align="center"
label="分类">
<template slot-scope="scope">
{{ filterAA(scope.row.typeId) }}
{{ filterAA(scope.row.type) }}
</template>
</el-table-column>
<el-table-column label="书名" align="center">
<el-table-column label="内容" align="center">
<template slot-scope="scope">
{{ scope.row.name }}
<div v-if="scope.row.type == 1 || scope.row.type == 2">{{ scope.row.name }}</div>
<img v-if="scope.row.type == 3" :src="scope.row.url" alt="" style="width:70px;height:100px" />
</template>
</el-table-column>
</el-table-column>
<el-table-column label="资源url" align="center">
<template slot-scope="scope">
<div v-if="scope.row.type == 1 || scope.row.type == 2">{{ scope.row.url }}</div>
<div v-if="scope.row.type == 3">{{ scope.row.url }}</div>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
@@ -58,24 +65,21 @@
<el-dialog :visible.sync="addOrUpdateVisible" :append-to-body="true" :title="titlesub" width="50%" @close="cancleClose">
<el-form :inline="true" :model="addForm" ref="addFormRef" :rules="addFormRule">
<el-row type="flex" justify="center">
<el-form-item label="分类" prop="typeId">
<el-select v-model="addForm.typeId" placeholder="请选择分类" style="width: 500px;">
<el-form-item label="分类" prop="type" label-width="100px">
<el-select v-model="addForm.type" placeholder="请选择分类" style="width: 500px;">
<el-option v-for="(item,index) in typeList" :key="index" :label="item.dictValue" :value="item.dictType">
</el-option>
</el-select>
</el-form-item>
</el-row>
<el-row type="flex" justify="center">
<el-form-item label="书名" prop="bookId">
<el-select v-model="addForm.bookId" placeholder="请选择书名" style="width: 500px;">
<el-option v-for="item in booknameList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
<el-form-item label="内容" prop="name" label-width="100px">
<el-input style="width:500px" v-model="addForm.name"></el-input>
</el-form-item>
</el-row>
<el-row type="flex" justify="center">
<el-form-item label="排序" label-width="48px">
<el-input style="width:500px" v-model="addForm.sort"></el-input>
<el-form-item label="资源url" label-width="100px">
<el-input style="width:500px" v-model="addForm.url"></el-input>
</el-form-item>
</el-row>
</el-form>
@@ -95,13 +99,13 @@ export default {
typeList: [
{
dictValue:'吴门之歌',
dictType: 1,
dictType: '1',
},{
dictValue:'巴山夜雨',
dictType: 2,
dictType: '2',
},{
dictValue:'吴门之徽',
dictType: 3,
dictType: '3',
}
], //类型列表
booknameList: [],
@@ -140,6 +144,9 @@ export default {
this.getDataList()
},
methods: {
clearValue(val) {
this.dataForm.dictType = '';
},
// 获取数据列表
getDataList () {
this.dataListLoading = true
@@ -211,16 +218,16 @@ export default {
// 新增 / 修改
editOrUpdateHandle (row) {
this.titlesub = '修改'
this.getbookname()
// this.getbookname()
this.editId = row.id
this.addForm.bookId = row.bookId
this.addForm.typeId = row.typeId.toString()
this.addForm.sort = row.sort
this.addForm.name = row.name
this.addForm.type = row.type.toString()
this.addForm.url = row.url
this.addOrUpdateVisible = true
},
addOrUpdateHandle() {
this.getbookname()
// this.getbookname()
this.editId = ''
this.titlesub = '新增'
this.addOrUpdateVisible = true
@@ -230,9 +237,9 @@ export default {
this.$refs["addFormRef"].resetFields();
this.addForm = {
"id": '',//新增不传
"bookId": '',
"typeId": '',
"sort": ''
"name": '',
"type": '',
"url": ''
}
},
// 删除
@@ -243,7 +250,7 @@ export default {
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`/book/medicaldes/delBookRelation?id=${id}`),
url: this.$http.adornUrl(`/book/medicaldes/delLight?id=${id}`),
method: 'post',
}).then(({data}) => {
if (data && data.code === 0) {
@@ -265,13 +272,13 @@ export default {
this.$refs["addFormRef"].validate(valid => {
if(valid) {
this.$http({
url: this.$http.adornUrl('/book/medicaldes/saveOrUpdateBookRelation'),
url: this.$http.adornUrl('/book/medicaldes/saveOrUpdateLight'),
method: 'post',
data: this.$http.adornData({
"id": this.editId, //新增不传
"bookId": this.addForm.bookId,
"typeId": this.addForm.typeId,
"sort": this.addForm.sort
"name": this.addForm.name,
"type": this.addForm.type,
"url": this.addForm.url
})
}).then(({data}) => {
if (data && data.code === 0) {