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

18
src/views/firstPages/typemanage.vue

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

Loading…
Cancel
Save