fix bug 修改生成的模板不符合ESLint的问题
This commit is contained in:
+23
-23
@@ -248,9 +248,9 @@
|
|||||||
dataIndex: '',
|
dataIndex: '',
|
||||||
key: 'rowIndex',
|
key: 'rowIndex',
|
||||||
width: 60,
|
width: 60,
|
||||||
align:"center",
|
align: 'center',
|
||||||
customRender: function (t, r, index) {
|
customRender: function (t, r, index) {
|
||||||
return parseInt(index)+1;
|
return parseInt(index) + 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
<#assign showColNum=0>
|
<#assign showColNum=0>
|
||||||
@@ -259,14 +259,14 @@
|
|||||||
<#assign showColNum=showColNum+1>
|
<#assign showColNum=showColNum+1>
|
||||||
{
|
{
|
||||||
title: '${po.filedComment}',
|
title: '${po.filedComment}',
|
||||||
align:"center",
|
align: 'center',
|
||||||
<#if po.sort=='Y'>
|
<#if po.sort=='Y'>
|
||||||
sorter: true,
|
sorter: true,
|
||||||
</#if>
|
</#if>
|
||||||
<#if po.classType=='date'>
|
<#if po.classType=='date'>
|
||||||
dataIndex: '${po.fieldName}',
|
dataIndex: '${po.fieldName}',
|
||||||
customRender: function (text) {
|
customRender: function (text) {
|
||||||
return !text?"":(text.length>10?text.substr(0,10):text)
|
return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
|
||||||
}
|
}
|
||||||
<#elseif po.fieldDbType=='Blob'>
|
<#elseif po.fieldDbType=='Blob'>
|
||||||
dataIndex: '${po.fieldName}String'
|
dataIndex: '${po.fieldName}String'
|
||||||
@@ -304,21 +304,21 @@
|
|||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
align:"center",
|
align: 'center',
|
||||||
<#if tableVo.extendParams.scroll=='1'>
|
<#if tableVo.extendParams.scroll=='1'>
|
||||||
fixed:"right",
|
fixed: 'right',
|
||||||
width: 147,
|
width: 147,
|
||||||
</#if>
|
</#if>
|
||||||
scopedSlots: { customRender: 'action' }
|
scopedSlots: { customRender: 'action' }
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
url: {
|
url: {
|
||||||
list: "/${entityPackage}/${entityName?uncap_first}/page",
|
list: '/${entityPackage}/${entityName?uncap_first}/page',
|
||||||
delete: "/${entityPackage}/${entityName?uncap_first}/delete",
|
delete: '/${entityPackage}/${entityName?uncap_first}/delete',
|
||||||
deleteBatch: "/${entityPackage}/${entityName?uncap_first}/deleteBatch",
|
deleteBatch: '/${entityPackage}/${entityName?uncap_first}/deleteBatch',
|
||||||
exportXlsUrl: "/${entityPackage}/${entityName?uncap_first}/exportXls",
|
exportXlsUrl: '/${entityPackage}/${entityName?uncap_first}/exportXls',
|
||||||
importExcelUrl: "${entityPackage}/${entityName?uncap_first}/importExcel",
|
importExcelUrl: '${entityPackage}/${entityName?uncap_first}/importExcel'<#if bpm_flag>,
|
||||||
<#if bpm_flag>startProcess: '/act/process/extActProcess/startMutilProcess'</#if>
|
startProcess: '/act/process/extActProcess/startMutilProcess'</#if>
|
||||||
},
|
},
|
||||||
<#if bpm_flag>
|
<#if bpm_flag>
|
||||||
//代码生成后需手动设置流程编码
|
//代码生成后需手动设置流程编码
|
||||||
@@ -328,7 +328,7 @@
|
|||||||
<#if list_need_pca>
|
<#if list_need_pca>
|
||||||
pcaData: '',
|
pcaData: '',
|
||||||
</#if>
|
</#if>
|
||||||
superFieldList:[],
|
superFieldList: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
@@ -353,17 +353,17 @@
|
|||||||
</#if>
|
</#if>
|
||||||
</#list>
|
</#list>
|
||||||
</#if>
|
</#if>
|
||||||
this.getSuperFieldList();
|
this.getSuperFieldList()
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
importExcelUrl: function () {
|
importExcelUrl: function () {
|
||||||
<#noparse>return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;</#noparse>
|
<#noparse>return `${window._CONFIG.domianURL}/${this.url.importExcelUrl}`</#noparse>
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
<#if list_need_pca>
|
<#if list_need_pca>
|
||||||
getPcaText (code) {
|
getPcaText (code) {
|
||||||
return this.pcaData.getText(code);
|
return this.pcaData.getText(code)
|
||||||
},
|
},
|
||||||
</#if>
|
</#if>
|
||||||
<#if bpm_flag>
|
<#if bpm_flag>
|
||||||
@@ -380,14 +380,14 @@
|
|||||||
}
|
}
|
||||||
postAction(this.url.startProcess, params).then(res=>{
|
postAction(this.url.startProcess, params).then(res=>{
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$message.success(res.message);
|
this.$message.success(res.message)
|
||||||
this.loadData();
|
this.loadData()
|
||||||
this.onClearSelected();
|
this.onClearSelected()
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning(res.message);
|
this.$message.warning(res.message)
|
||||||
}
|
}
|
||||||
}).catch((e)=>{
|
}).catch((e)=>{
|
||||||
this.$message.warning('不识别的请求!');
|
this.$message.warning('不识别的请求!')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -408,7 +408,7 @@
|
|||||||
},
|
},
|
||||||
getSuperFieldList () {
|
getSuperFieldList () {
|
||||||
<#include "/common/utils.ftl">
|
<#include "/common/utils.ftl">
|
||||||
let fieldList=[];
|
const fieldList = []
|
||||||
<#list columns as po>
|
<#list columns as po>
|
||||||
fieldList.push(${superQueryFieldList(po)})
|
fieldList.push(${superQueryFieldList(po)})
|
||||||
</#list>
|
</#list>
|
||||||
|
|||||||
+33
-47
@@ -119,13 +119,11 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { httpAction, getAction } from '@/api/manage'
|
import { postAction <#if bpm_flag>, getAction </#if>} from '@/api/manage'
|
||||||
import { validateDuplicateValue } from '@/utils/util'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: '${entityName}Form',
|
name: '${entityName}Form',
|
||||||
components: {
|
components: {},
|
||||||
},
|
|
||||||
props: {
|
props: {
|
||||||
<#if bpm_flag>
|
<#if bpm_flag>
|
||||||
// 流程表单data
|
// 流程表单data
|
||||||
@@ -150,23 +148,21 @@
|
|||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
model:{
|
model: {<#include "/common/init/initValue.ftl">},
|
||||||
<#include "/common/init/initValue.ftl">
|
|
||||||
},
|
|
||||||
labelCol: {
|
labelCol: {
|
||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
sm: { span: 5 },
|
sm: { span: 5 }
|
||||||
},
|
},
|
||||||
wrapperCol: {
|
wrapperCol: {
|
||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
sm: { span: 16 },
|
sm: { span: 16 }
|
||||||
},
|
},
|
||||||
confirmLoading: false,
|
confirmLoading: false,
|
||||||
<#include "/common/validatorRulesTemplate/main.ftl">
|
<#include "/common/validatorRulesTemplate/main.ftl">
|
||||||
url: {
|
url: {
|
||||||
add: "/${entityPackage}/${entityName?uncap_first}/add",
|
add: '/${entityPackage}/${entityName?uncap_first}/add',
|
||||||
edit: "/${entityPackage}/${entityName?uncap_first}/edit",
|
edit: '/${entityPackage}/${entityName?uncap_first}/edit',
|
||||||
queryById: "/${entityPackage}/${entityName?uncap_first}/queryById"
|
queryById: '/${entityPackage}/${entityName?uncap_first}/queryById'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -181,8 +177,7 @@
|
|||||||
}
|
}
|
||||||
</#if>
|
</#if>
|
||||||
return this.disabled
|
return this.disabled
|
||||||
},
|
}<#if bpm_flag>,
|
||||||
<#if bpm_flag>
|
|
||||||
showFlowSubmitButton () {
|
showFlowSubmitButton () {
|
||||||
if (this.formBpm === true) {
|
if (this.formBpm === true) {
|
||||||
if (this.formData.disabled === false) {
|
if (this.formData.disabled === false) {
|
||||||
@@ -190,77 +185,68 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}</#if>
|
||||||
</#if>
|
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
// 备份model原始值
|
// 备份model原始值
|
||||||
this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
this.modelDefault = JSON.parse(JSON.stringify(this.model))
|
||||||
<#if bpm_flag>
|
<#if bpm_flag>
|
||||||
// 如果是流程中表单,则需要加载流程表单data
|
// 如果是流程中表单,则需要加载流程表单data
|
||||||
this.showFlowData();
|
this.showFlowData()
|
||||||
</#if>
|
</#if>
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
add () {
|
add () {
|
||||||
this.edit(this.modelDefault);
|
this.edit(this.modelDefault)
|
||||||
},
|
},
|
||||||
edit (record) {
|
edit (record) {
|
||||||
this.model = Object.assign({}, record);
|
this.model = Object.assign({}, record)
|
||||||
this.visible = true;
|
this.visible = true
|
||||||
},
|
},
|
||||||
<#if bpm_flag>
|
<#if bpm_flag>
|
||||||
//渲染流程表单数据
|
//渲染流程表单数据
|
||||||
showFlowData () {
|
showFlowData () {
|
||||||
if (this.formBpm === true) {
|
if (this.formBpm === true) {
|
||||||
let params = {id:this.formData.dataId};
|
let params = {id:this.formData.dataId}
|
||||||
getAction(this.url.queryById,params).then((res) => {
|
getAction(this.url.queryById,params).then((res) => {
|
||||||
if(res.success){
|
if(res.success){
|
||||||
this.edit (res.result);
|
this.edit(res.result)
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
</#if>
|
</#if>
|
||||||
submitForm () {
|
submitForm () {
|
||||||
const that = this;
|
const that = this
|
||||||
// 触发表单验证
|
// 触发表单验证
|
||||||
this.$refs.form.validate(valid => {
|
this.$refs.form.validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
that.confirmLoading = true;
|
that.confirmLoading = true
|
||||||
let httpurl = '';
|
let httpurl
|
||||||
let method = '';
|
|
||||||
if (!this.model.id) {
|
if (!this.model.id) {
|
||||||
httpurl+=this.url.add;
|
httpurl = this.url.add
|
||||||
method = 'post';
|
|
||||||
} else {
|
} else {
|
||||||
httpurl+=this.url.edit;
|
httpurl = this.url.edit
|
||||||
method = 'put';
|
|
||||||
}
|
}
|
||||||
httpAction(httpurl,this.model,method).then((res)=>{
|
postAction(httpurl, this.model).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
that.$message.success(res.message);
|
that.$message.success(res.message)
|
||||||
that.$emit('ok');
|
that.$emit('ok')
|
||||||
} else {
|
} else {
|
||||||
that.$message.warning(res.message);
|
that.$message.warning(res.message)
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
that.confirmLoading = false;
|
that.confirmLoading = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
}<#if form_popup>,
|
||||||
<#if form_popup>
|
|
||||||
popupCallback (value,row) {
|
popupCallback (value,row) {
|
||||||
this.model = Object.assign(this.model, row);
|
this.model = Object.assign(this.model, row)
|
||||||
},
|
}</#if><#if form_cat_tree>,
|
||||||
</#if>
|
|
||||||
<#if form_cat_tree>
|
|
||||||
handleCategoryChange (value, backObj) {
|
handleCategoryChange (value, backObj) {
|
||||||
this.model = Object.assign(this.model, backObj);
|
this.model = Object.assign(this.model, backObj)
|
||||||
}
|
}</#if>
|
||||||
</#if>
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
+8
-8
@@ -23,8 +23,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import ${entityName}Form from './${entityName}Form'
|
import ${entityName}Form from './${entityName}Form'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: '${entityName}Modal',
|
name: '${entityName}Modal',
|
||||||
components: {
|
components: {
|
||||||
@@ -42,25 +42,25 @@
|
|||||||
add () {
|
add () {
|
||||||
this.visible = true
|
this.visible = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.realForm.add();
|
this.$refs.realForm.add()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
edit (record) {
|
edit (record) {
|
||||||
this.visible = true
|
this.visible = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.realForm.edit(record);
|
this.$refs.realForm.edit(record)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
close () {
|
close () {
|
||||||
this.$emit('close');
|
this.$emit('close')
|
||||||
this.visible = false;
|
this.visible = false
|
||||||
},
|
},
|
||||||
handleOk () {
|
handleOk () {
|
||||||
this.$refs.realForm.submitForm();
|
this.$refs.realForm.submitForm()
|
||||||
},
|
},
|
||||||
submitCallback () {
|
submitCallback () {
|
||||||
this.$emit('ok');
|
this.$emit('ok')
|
||||||
this.visible = false;
|
this.visible = false
|
||||||
},
|
},
|
||||||
handleCancel () {
|
handleCancel () {
|
||||||
this.close()
|
this.close()
|
||||||
|
|||||||
+9
-9
@@ -35,7 +35,7 @@
|
|||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
title:"操作",
|
title: '操作',
|
||||||
width: ${modal_width},
|
width: ${modal_width},
|
||||||
visible: false,
|
visible: false,
|
||||||
disableSubmit: false
|
disableSubmit: false
|
||||||
@@ -45,25 +45,25 @@
|
|||||||
add () {
|
add () {
|
||||||
this.visible = true
|
this.visible = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.realForm.add();
|
this.$refs.realForm.add()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
edit (record) {
|
edit (record) {
|
||||||
this.visible = true
|
this.visible = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.realForm.edit(record);
|
this.$refs.realForm.edit(record)
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
close () {
|
close () {
|
||||||
this.$emit('close');
|
this.$emit('close')
|
||||||
this.visible = false;
|
this.visible = false
|
||||||
},
|
},
|
||||||
submitCallback () {
|
submitCallback () {
|
||||||
this.$emit('ok');
|
this.$emit('ok')
|
||||||
this.visible = false;
|
this.visible = false
|
||||||
},
|
},
|
||||||
handleOk () {
|
handleOk () {
|
||||||
this.$refs.realForm.submitForm();
|
this.$refs.realForm.submitForm()
|
||||||
},
|
},
|
||||||
handleCancel () {
|
handleCancel () {
|
||||||
this.close()
|
this.close()
|
||||||
|
|||||||
+13
-12
@@ -109,7 +109,7 @@
|
|||||||
import { JeroListMixin } from '@/mixins/JeroListMixin'
|
import { JeroListMixin } from '@/mixins/JeroListMixin'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "${entityName}List",
|
name: '${entityName}List',
|
||||||
mixins: [JeroListMixin],
|
mixins: [JeroListMixin],
|
||||||
components: {
|
components: {
|
||||||
${entityName}Modal
|
${entityName}Modal
|
||||||
@@ -124,16 +124,16 @@
|
|||||||
dataIndex: '',
|
dataIndex: '',
|
||||||
key: 'rowIndex',
|
key: 'rowIndex',
|
||||||
width: 60,
|
width: 60,
|
||||||
align:"center",
|
align: 'center',
|
||||||
customRender: function (t, r, index) {
|
customRender: function (t, r, index) {
|
||||||
return parseInt(index)+1;
|
return parseInt(index) + 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
<#list columns as po>
|
<#list columns as po>
|
||||||
<#if po.fieldName !='id'>
|
<#if po.fieldName !='id'>
|
||||||
{
|
{
|
||||||
title: '${po.filedComment}',
|
title: '${po.filedComment}',
|
||||||
align:"center",
|
align: 'center',
|
||||||
dataIndex: '${po.fieldName}'
|
dataIndex: '${po.fieldName}'
|
||||||
},
|
},
|
||||||
</#if>
|
</#if>
|
||||||
@@ -141,22 +141,22 @@
|
|||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
align:"center",
|
align: 'center',
|
||||||
scopedSlots: { customRender: 'action' },
|
scopedSlots: { customRender: 'action' }
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
url: {
|
url: {
|
||||||
list: "/${entityPackage}/${entityName?uncap_first}/list",
|
list: '/${entityPackage}/${entityName?uncap_first}/list',
|
||||||
delete: "/${entityPackage}/${entityName?uncap_first}/delete",
|
delete: '/${entityPackage}/${entityName?uncap_first}/delete',
|
||||||
deleteBatch: "/${entityPackage}/${entityName?uncap_first}/deleteBatch",
|
deleteBatch: '/${entityPackage}/${entityName?uncap_first}/deleteBatch',
|
||||||
exportXlsUrl: "${entityPackage}/${entityName?uncap_first}/exportXls",
|
exportXlsUrl: '${entityPackage}/${entityName?uncap_first}/exportXls',
|
||||||
importExcelUrl: "${entityPackage}/${entityName?uncap_first}/importExcel",
|
importExcelUrl: '${entityPackage}/${entityName?uncap_first}/importExcel',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
importExcelUrl: function () {
|
importExcelUrl: function () {
|
||||||
<#noparse>return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;</#noparse>
|
<#noparse>return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`</#noparse>
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -164,6 +164,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@import '~@assets/less/common.less';
|
@import '~@assets/less/common.less';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+23
-28
@@ -41,18 +41,17 @@
|
|||||||
name: "${entityName}Modal",
|
name: "${entityName}Modal",
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
title:"操作",
|
title: '操作',
|
||||||
visible: false,
|
visible: false,
|
||||||
model: {},
|
model: {},
|
||||||
labelCol: {
|
labelCol: {
|
||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
sm: { span: 5 },
|
sm: { span: 5 }
|
||||||
},
|
},
|
||||||
wrapperCol: {
|
wrapperCol: {
|
||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
sm: { span: 16 },
|
sm: { span: 16 }
|
||||||
},
|
},
|
||||||
|
|
||||||
confirmLoading: false,
|
confirmLoading: false,
|
||||||
validatorRules: {
|
validatorRules: {
|
||||||
<#list columns as po>
|
<#list columns as po>
|
||||||
@@ -64,8 +63,8 @@
|
|||||||
</#list>
|
</#list>
|
||||||
},
|
},
|
||||||
url: {
|
url: {
|
||||||
add: "/${entityPackage}/${entityName?uncap_first}/add",
|
add: '/${entityPackage}/${entityName?uncap_first}/add',
|
||||||
edit: "/${entityPackage}/${entityName?uncap_first}/edit",
|
edit: '/${entityPackage}/${entityName?uncap_first}/edit'
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -74,53 +73,49 @@
|
|||||||
methods: {
|
methods: {
|
||||||
add () {
|
add () {
|
||||||
// 初始化默认值
|
// 初始化默认值
|
||||||
this.edit({});
|
this.edit({})
|
||||||
},
|
},
|
||||||
edit (record) {
|
edit (record) {
|
||||||
this.model = Object.assign({}, record);
|
this.model = Object.assign({}, record)
|
||||||
this.visible = true;
|
this.visible = true
|
||||||
},
|
},
|
||||||
close () {
|
close () {
|
||||||
this.$emit('close');
|
this.$emit('close')
|
||||||
this.visible = false;
|
this.visible = false
|
||||||
this.$refs.form.clearValidate();
|
this.$refs.form.clearValidate()
|
||||||
},
|
},
|
||||||
handleOk () {
|
handleOk () {
|
||||||
const that = this;
|
const that = this
|
||||||
// 触发表单验证
|
// 触发表单验证
|
||||||
this.$refs.form.validate(valid => {
|
this.$refs.form.validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
that.confirmLoading = true;
|
that.confirmLoading = true
|
||||||
let httpurl = '';
|
let httpurl = ''
|
||||||
let method = '';
|
const method = 'post'
|
||||||
if (!this.model.id) {
|
if (!this.model.id) {
|
||||||
httpurl+=this.url.add;
|
httpurl = this.url.add
|
||||||
method = 'post';
|
|
||||||
} else {
|
} else {
|
||||||
httpurl+=this.url.edit;
|
httpurl = this.url.edit
|
||||||
method = 'put';
|
|
||||||
}
|
}
|
||||||
httpAction(httpurl, this.model, method).then((res) => {
|
httpAction(httpurl, this.model, method).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
that.$message.success(res.message);
|
that.$message.success(res.message)
|
||||||
that.$emit('ok');
|
that.$emit('ok')
|
||||||
} else {
|
} else {
|
||||||
that.$message.warning(res.message);
|
that.$message.warning(res.message)
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
that.confirmLoading = false;
|
that.confirmLoading = false
|
||||||
that.close();
|
that.close()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleCancel () {
|
handleCancel () {
|
||||||
this.close()
|
this.close()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
+25
-30
@@ -38,24 +38,23 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { httpAction } from '@/api/manage'
|
import { httpAction } from '@/api/manage'
|
||||||
import moment from "moment"
|
import moment from 'moment'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "${entityName}Modal",
|
name: '${entityName}Modal',
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
title:"操作",
|
title: '操作',
|
||||||
visible: false,
|
visible: false,
|
||||||
model: {},
|
model: {},
|
||||||
labelCol: {
|
labelCol: {
|
||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
sm: { span: 5 },
|
sm: { span: 5 }
|
||||||
},
|
},
|
||||||
wrapperCol: {
|
wrapperCol: {
|
||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
sm: { span: 16 },
|
sm: { span: 16 }
|
||||||
},
|
},
|
||||||
|
|
||||||
confirmLoading: false,
|
confirmLoading: false,
|
||||||
validatorRules: {
|
validatorRules: {
|
||||||
<#list columns as po>
|
<#list columns as po>
|
||||||
@@ -67,8 +66,8 @@
|
|||||||
</#list>
|
</#list>
|
||||||
},
|
},
|
||||||
url: {
|
url: {
|
||||||
add: "/${entityPackage}/${entityName?uncap_first}/add",
|
add: '/${entityPackage}/${entityName?uncap_first}/add',
|
||||||
edit: "/${entityPackage}/${entityName?uncap_first}/edit",
|
edit: '/${entityPackage}/${entityName?uncap_first}/edit',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -77,53 +76,49 @@
|
|||||||
methods: {
|
methods: {
|
||||||
add () {
|
add () {
|
||||||
// 初始化默认值
|
// 初始化默认值
|
||||||
this.edit({});
|
this.edit({})
|
||||||
},
|
},
|
||||||
edit (record) {
|
edit (record) {
|
||||||
this.model = Object.assign({}, record);
|
this.model = Object.assign({}, record)
|
||||||
this.visible = true;
|
this.visible = true
|
||||||
},
|
},
|
||||||
close () {
|
close () {
|
||||||
this.$emit('close');
|
this.$emit('close')
|
||||||
this.visible = false;
|
this.visible = false
|
||||||
this.$refs.form.clearValidate();
|
this.$refs.form.clearValidate()
|
||||||
},
|
},
|
||||||
handleOk () {
|
handleOk () {
|
||||||
const that = this;
|
const that = this
|
||||||
// 触发表单验证
|
// 触发表单验证
|
||||||
this.$refs.form.validate(valid => {
|
this.$refs.form.validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
that.confirmLoading = true;
|
that.confirmLoading = true
|
||||||
let httpurl = '';
|
let httpurl = ''
|
||||||
let method = '';
|
const method = 'post'
|
||||||
if (!this.model.id) {
|
if (!this.model.id) {
|
||||||
httpurl+=this.url.add;
|
httpurl = this.url.add
|
||||||
method = 'post';
|
|
||||||
} else {
|
} else {
|
||||||
httpurl+=this.url.edit;
|
httpurl = this.url.edit
|
||||||
method = 'put';
|
|
||||||
}
|
}
|
||||||
httpAction(httpurl, this.model, method).then((res) => {
|
httpAction(httpurl, this.model, method).then((res) => {
|
||||||
if (res.success){
|
if (res.success){
|
||||||
that.$message.success(res.message);
|
that.$message.success(res.message)
|
||||||
that.$emit('ok');
|
that.$emit('ok')
|
||||||
} else {
|
} else {
|
||||||
that.$message.warning(res.message);
|
that.$message.warning(res.message)
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
that.confirmLoading = false;
|
that.confirmLoading = false
|
||||||
that.close();
|
that.close()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleCancel () {
|
handleCancel () {
|
||||||
this.close()
|
this.close()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -157,3 +157,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.ant-calendar-picker {
|
||||||
|
min-width: 195px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user