Commit f10e31c3 authored by wends's avatar wends

update plop-template

parent 18114b7d
import request from '@/utils/request'
// const baseURL = process.env.VUE_APP_BASE_API
const baseURL = ''
// 获取数据集列表-分页
export function getTableData(data) {
return request({
url: `${baseURL}/cc/linque/getDatasetList`,
method: 'post',
data
})
}
...@@ -122,6 +122,7 @@ ...@@ -122,6 +122,7 @@
{{#if script}} {{#if script}}
<script> <script>
import { getTableData } from '@/api{{ path }}'
export default { export default {
name: '{{ properCase name }}', name: '{{ properCase name }}',
props: {}, props: {},
...@@ -148,7 +149,20 @@ export default { ...@@ -148,7 +149,20 @@ export default {
created() {}, created() {},
mounted() {}, mounted() {},
methods: { methods: {
getTableData(pageNum) {}, getTableData(pageNum) {
const params = {
...this.searchForm,
pageNum,
pageSize: this.pageForm.pageSize
}
getTableData(params)
.then(res => {
const { records, totalSize } = res.data
this.tableData = records
this.pageForm.total = totalSize
})
.catch(err => console.error(err))
},
resetForm() { resetForm() {
this.$refs.searchForm.resetFields() this.$refs.searchForm.resetFields()
}, },
......
...@@ -45,17 +45,25 @@ module.exports = { ...@@ -45,17 +45,25 @@ module.exports = {
actions: data => { actions: data => {
const name = '{{name}}' const name = '{{name}}'
const path = '{{path}}' const path = '{{path}}'
const actions = [{ const actions = [
type: 'add', {
path: `src/views/${path}/index.vue`, type: 'add',
templateFile: 'plop-templates/view/index.hbs', path: `src/views/${path}/index.vue`,
data: { templateFile: 'plop-templates/view/index.hbs',
name: name, data: {
template: data.blocks.includes('template'), name: name,
script: data.blocks.includes('script'), template: data.blocks.includes('template'),
style: data.blocks.includes('style') script: data.blocks.includes('script'),
style: data.blocks.includes('style'),
apiPath: path
}
},
{
type: 'add',
path: `src/api/${path}.js`,
templateFile: 'plop-templates/view/api.hbs'
} }
}] ]
return actions return actions
} }
......
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