吴门医述完成

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.productImages = row.img
this.addForm.content = row.content this.addForm.content = row.content
this.addForm.typeId = row.type.toString() this.addForm.typeId = row.type.toString()
this.$nextTick(()=>{ this.fileList = []
this.fileList = []
})
var img = { var img = {
name: '', name: '',
url: row.img url: row.img

View File

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