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 @@
{{#if script}}
<script>
import { getTableData } from '@/api{{ path }}'
export default {
name: '{{ properCase name }}',
props: {},
......@@ -148,7 +149,20 @@ export default {
created() {},
mounted() {},
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() {
this.$refs.searchForm.resetFields()
},
......
......@@ -45,17 +45,25 @@ module.exports = {
actions: data => {
const name = '{{name}}'
const path = '{{path}}'
const actions = [{
type: 'add',
path: `src/views/${path}/index.vue`,
templateFile: 'plop-templates/view/index.hbs',
data: {
name: name,
template: data.blocks.includes('template'),
script: data.blocks.includes('script'),
style: data.blocks.includes('style')
const actions = [
{
type: 'add',
path: `src/views/${path}/index.vue`,
templateFile: 'plop-templates/view/index.hbs',
data: {
name: name,
template: data.blocks.includes('template'),
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
}
......
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