Commit 1f9b5f34 authored by daywrite's avatar daywrite

设置-实施阶段

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