Commit 1f9b5f34 authored by daywrite's avatar daywrite

设置-实施阶段

parent 34465469
const type = 'setting'
function temp (t) {
function temp (t, tt) {
return {
[`getList${t}Type`]: {
url: `/vue/${type}/list-${t}-type`
[`getList${t}${tt}`]: {
url: `/vue/${type}/list-${t}-${tt}`
},
[`getNew${t}Type`]: {
url: `/vue/${type}/get-new-${t}-type`
[`getNew${t}${tt}`]: {
url: `/vue/${type}/get-new-${t}-${tt}`
},
[`getEdit${t}Type`]: {
url: `/vue/${type}/get-edit-${t}-type`
[`getEdit${t}${tt}`]: {
url: `/vue/${type}/get-edit-${t}-${tt}`
},
[`saveNew${t}Type`]: {
url: `/vue/${type}/save-new-${t}-type`
[`saveNew${t}${tt}`]: {
url: `/vue/${type}/save-new-${t}-${tt}`
},
[`saveEdit${t}Type`]: {
url: `/vue/${type}/save-edit-${t}-type`
[`saveEdit${t}${tt}`]: {
url: `/vue/${type}/save-edit-${t}-${tt}`
},
[`delete${t}Type`]: {
url: `/vue/${type}/delete-${t}-type`
[`delete${t}${tt}`]: {
url: `/vue/${type}/delete-${t}-${tt}`
}
}
}
export default {
...temp('implement')
...temp('implement', 'type')
}
......@@ -36,7 +36,9 @@ export default {
name: 'implementForm',
props: {
model: Object
model: Object,
t: String,
tt: String
},
components: {
......@@ -61,14 +63,14 @@ export default {
methods: {
getNew () {
requestAPI(api.getNewimplementType, {})
requestAPI(api[`getNew${this.t}${this.tt}`], {})
.then((res) => {
this.query.order = res.nextOrder
})
},
getEdit (id) {
return requestAPI(api.getEditimplementType, {id})
return requestAPI(api[`getEdit${this.t}${this.tt}`], {id})
.then((res) => {
return res.model
})
......
......@@ -3,6 +3,8 @@
<sidePopup ref="sidePopup" title="新建实施阶段" :width="50" @update:close="() => btnClose()">
<Foom
ref="form"
:t="t"
:tt="tt"
:model="model">
</Foom>
<div class="mt20" style="margin-left: 150px;">
......@@ -22,6 +24,11 @@ import Foom from './form'
import { setModule } from '@/lib/viewHelper'
export default {
props: {
t: String,
tt: String
},
components: {
Foom
},
......
......@@ -32,7 +32,7 @@
</Pagenation>
</div>
</div>
<FormModal ref="formModal"></FormModal>
<FormModal ref="formModal" :t="t" :tt="tt"></FormModal>
</section>
</template>
<script>
......@@ -56,6 +56,8 @@ export default {
data () {
return {
t: 'implement',
tt: 'type',
pagenation: {
thispage: 1,
pagesize: 20
......@@ -77,7 +79,7 @@ export default {
methods: {
getList (params) {
requestAPI(api.getListimplementType, params)
requestAPI(api[`getList${this.t}${this.tt}`], params)
.then((res) => {
this.result.list = res.list
this.result.pagenation = res.pagenation
......@@ -112,7 +114,7 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestAPI(api.deleteimplementType, { id })
requestAPI(api[`delete${this.t}${this.tt}`], { id })
.then((res) => {
this.$message.success(`${deleteTip}成功`)
this._reload()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment