Browse Source

政策修改内容是无法获取到数据问题

master
aBin 4 years ago
parent
commit
4b4093d3e5
  1. 15
      src/views/firstPages/policy.vue
  2. 18
      src/views/firstPages/typemanage.vue

15
src/views/firstPages/policy.vue

@ -203,13 +203,14 @@
contentEditable="true"
style="
border: 1px solid #000;
border-radius: 10px 0 0 10px;
border-radius: 5px;
padding: 20px;
background: #f5f5f5;
height: 260px;
overflow-y: auto;
"
v-html="temp.content"
id="edit-content"
>
'
</div>
@ -318,7 +319,7 @@
contentEditable="true"
style="
border: 1px solid #000;
border-radius: 10px 0 0 10px;
border-radius: 5px;
padding: 20px;
background: #f5f5f5;
height: 260px;
@ -458,7 +459,6 @@ export default {
const that = this
that.listLoading = true
await api.PolicyDetail(that.data).then(res => {
console.log(that.data)
that.polictList = res.list
that.total = res.total - 0
@ -468,12 +468,9 @@ export default {
})
},
handleUpdate(row) {
console.log("row")
console.log(row)
const that = this
that.temp = Object.assign({}, row) // copy obj
console.log(that.temp)
that.temp.timestamp = new Date(that.temp.timestamp)
that.temp.timestamp = new Date().toLocaleDateString()
that.dialogStatus = 'update'
for (const key in that.typeList) {
if (that.typeList[key] === that.temp.type) {
@ -492,7 +489,8 @@ export default {
},
async Commit() {
const that = this
console.log("=====>",that.temp.content)
var editPolicyBox = document.getElementById('edit-content')
that.temp.content = editPolicyBox.innerHTML
that.temp.type = that.typeList[`${that.policyType1}`]
that.temp.auditStatus = that.status[`${that.policyStatus1}`]
for (let i = 0; i < that.temp.projectLabels.length; i++) {
@ -501,6 +499,7 @@ export default {
i -= 1
}
}
console.log(that.temp)
await api.PolicyUpdate(that.temp).then(res => {
this.getList()
this.cascader = ''

18
src/views/firstPages/typemanage.vue

@ -28,16 +28,18 @@
type="primary"
icon="el-icon-search"
@click="Search"
>搜索</el-button
>
搜索
</el-button>
<el-button
class="filter-item"
style="margin-left: 10px"
type="primary"
icon="el-icon-edit"
@click="AddCategory"
>添加</el-button
>
添加
</el-button>
</div>
<!-- 类型列表 -->
<el-table
@ -65,12 +67,12 @@
class-name="small-padding fixed-width"
>
<template slot-scope="{ row }">
<el-button type="primary" size="mini" @click="handleUpdate(row)"
>修改</el-button
>
<el-button size="mini" type="danger" @click="handleDelete(row.id)"
>删除</el-button
>
<el-button type="primary" size="mini" @click="handleUpdate(row)">
修改
</el-button>
<el-button size="mini" type="danger" @click="handleDelete(row.id)">
删除
</el-button>
</template>
</el-table-column>
</el-table>

Loading…
Cancel
Save