我们发布啦

This commit is contained in:
张乐
2020-08-13 16:12:57 +08:00
parent a3e1c38d27
commit c0cec49f41
1885 changed files with 376936 additions and 2 deletions

View File

@@ -0,0 +1,182 @@
<template>
<div class="components-container">
<div class="container">
<el-form inline>
<el-form-item label="状态">
<el-select v-model="listPram.status" placeholder="状态" clearable @change="handlerSearch" class="selWidth">
<el-option
v-for="item in constants.roleListStatus"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="关键词">-->
<!-- <el-input v-model="listPram.keywords" placeholder="请输入关键词" clearable></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item>-->
<!-- <el-button type="primary" @click="handlerSearch">查询</el-button>-->
<!-- </el-form-item>-->
</el-form>
</div>
<el-button type="primary" size="mini" @click="handlerOpenEditData({},0)">添加数据</el-button>
<el-dialog
:title="editDataConfig.isCreate === 0?'添加数据':'编辑数据'"
:visible.sync="editDataConfig.visible"
append-to-body
destroy-on-close
>
<edit
v-if="editDataConfig.visible"
:form-data="formData"
:edit-data="editDataConfig.editData"
:is-create="editDataConfig.isCreate"
@hideDialog="handlerHideDia"
/>
</el-dialog>
<el-table
:data="dataList.list"
style="width: 100%;margin-bottom: 20px;"
>
<el-table-column label="编号" prop="id" />
<el-table-column
v-for="item,index in formConf.fields"
:key="index"
:label="item.__config__.label"
:prop="item.__vModel__"
>
<template slot-scope="scope">
<div v-if="['img','image','pic'].indexOf(item.__vModel__) > -1" class="demo-image__preview">
<el-image
style="width: 36px; height: 36px"
:src="scope.row[item.__vModel__]"
:preview-src-list="[scope.row[item.__vModel__]]"
/>
</div>
<span v-else>{{ scope.row[item.__vModel__] }}</span>
</template>
</el-table-column>
<el-table-column label="状态" prop="status">
<template slot-scope="scope">
<span>{{ scope.row.status | filterShowOrHide }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button type="text" size="small" @click="handlerOpenEditData(scope.row,1)">编辑</el-button>
<el-button type="text" size="small" @click="handlerDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="listPram.page"
:page-sizes="constants.page.limit"
:layout="constants.page.layout"
:total="dataList.total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
<script>
import edit from './combineEdit'
import * as constants from '@/utils/constants.js'
import * as systemGroupDataApi from '@/api/systemGroupData.js'
import * as systemFormConfigApi from '@/api/systemFormConfig.js'
export default {
// name: "combineDataList"
components: { edit },
props: {
formData: {
type: Object,
required: true
}
},
data() {
return {
constants,
listPram: {
gid: null,
keywords: null,
status: null, // 1=开启 2=关闭
page: 1,
pageSize: constants.page.limit[0]
},
editDataConfig: {
visible: false,
isCreate: 0, // 0=create 1=edit
editData: {}
},
formConf: { fields: [] },
dataList: { list: [], total: 0 }
}
},
mounted() {
this.handlerGetFormConfig()
this.listPram.gid = this.formData.id
this.handlerGetListData(this.listPram)
},
methods: {
handlerSearch() {
this.listPram.page = 1
this.handlerGetListData(this.listPram)
},
handlerGetListData(pram) { // 获取列表数据
systemGroupDataApi.groupDataList(pram).then(data => {
const _selfList = []
data.list.forEach(_lItem => {
_lItem.value = JSON.parse(_lItem.value)
const _fields = _lItem.value.fields
const _rowData = {}
_fields.map((item) => {
_rowData[item.name] = item.value
})
_rowData.id = _lItem.id
_rowData.sort = _lItem.sort
_rowData.status = _lItem.status
_selfList.push(_rowData)
})
this.dataList.list = _selfList
this.dataList.total = data.total
})
},
handlerGetFormConfig() { // 获取表单配置后生成table列
const _pram = { id: this.formData.formId }
systemFormConfigApi.getFormConfigInfo(_pram).then(data => {
this.formConf = JSON.parse(data.content)
})
},
handlerOpenEditData(rowData, isCreate) {
this.editDataConfig.editData = rowData
this.editDataConfig.isCreate = isCreate
this.editDataConfig.visible = true
},
handlerHideDia() {
this.handlerGetListData(this.listPram)
this.editDataConfig.visible = false
},
handlerDelete(rowData) {
this.$confirm('确实删除当前数据', '提示').then(() => {
systemGroupDataApi.groupDataDelete(rowData).then(data => {
this.$message.success('删除数据成功')
this.handlerHideDia()
})
})
},
handleSizeChange(val) {
this.listPram.limit = val
this.handlerGetListData(this.listPram)
},
handleCurrentChange(val) {
this.listPram.page = val
this.handlerGetListData(this.listPram)
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,118 @@
<template>
<div>
<el-form ref="selfForm" :model="selfForm" label-width="100px">
<el-form-item label="排序" prop="sort" :rules="[{ required: true, message:'排序不能为空', trigger:['blur','change'] }]">
<el-input-number v-model="selfForm.sort" />
</el-form-item>
<el-form-item
label="状态"
prop="status"
:rules="[{ required: true, message:'正确操作状态', trigger:['change'] }]"
>
<el-switch
v-model="selfForm.status"
active-color="#13ce66"
inactive-color="#ff4949"
/>
</el-form-item>
</el-form>
<parser
v-if="formConf.fields.length > 0"
:is-edit="isCreate === 1"
:form-conf="formConf"
:form-edit-data="editData"
@submit="handlerSubmit"
/>
<!-- {{ editData }}-->
</div>
</template>
<script>
import parser from '@/components/FormGenerator/components/parser/Parser'
import * as systemGroupDataApi from '@/api/systemGroupData.js'
import * as systemFormConfigApi from '@/api/systemFormConfig.js'
export default {
// name: "combineEdit"
components: { parser },
props: {
formData: {
type: Object,
required: true
},
isCreate: {
type: Number,
default: 0 // 0=create 1=edit
},
editData: {
type: Object
}
},
data() {
return {
formConf: { fields: [] },
selfForm: {
sort: 0,
status: 0
}
}
},
mounted() {
this.handlerGetFormConfig()
this.handlerInitEditData()
},
methods: {
handlerInitEditData() {
const { sort, status } = this.editData
this.selfForm.sort = sort
this.selfForm.status = status
},
handlerGetFormConfig() { // 获取表单配置后生成table列
const _pram = { id: this.formData.formId }
systemFormConfigApi.getFormConfigInfo(_pram).then(data => {
this.formConf = JSON.parse(data.content)
})
},
handlerSubmit(formValue) {
this.isCreate === 0 ? this.handlerSave(formValue) : this.handlerEdit(formValue)
},
handlerSave(formValue) {
const _pram = this.buildFormPram(formValue)
systemGroupDataApi.groupDataSave(_pram).then(data => {
this.$message.success('添加数据成功')
this.$emit('hideDialog')
})
},
handlerEdit(formValue) {
const _pram = this.buildFormPram(formValue)
systemGroupDataApi.groupDataEdit(_pram, this.editData.id).then(data => {
this.$message.success('编辑数据成功')
this.$emit('hideDialog')
})
},
buildFormPram(formValue) {
const _pram = {
gid: this.formData.id,
form: {
fields: [],
id: this.formData.formId,
sort: this.selfForm.sort,
status: this.selfForm.status
}}
const _fields = []
Object.keys(formValue).forEach((key) => {
_fields.push({
name: key,
title: key,
value: formValue[key]
})
})
_pram.form.fields = _fields
return _pram
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,143 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="container">
<el-form inline>
<el-form-item label="数据搜索">
<el-input v-model="listPram.keywords" placeholder="请输入IDKEY组合数据名称简介" class="selWidth" size="small">
<el-button slot="append" icon="el-icon-search" size="small" @click="handlerSearch" />
</el-input>
</el-form-item>
</el-form>
</div>
<el-button size="mini" type="primary" @click="handlerOpenEdit({},0)">添加数据组</el-button>
</div>
<el-table
:data="dataList.list"
style="width: 100%;margin-bottom: 20px;"
size="mini"
highlight-current-row
>
<el-table-column label="数据组名称" prop="name" min-width="150"/>
<el-table-column label="简介" prop="info" min-width="150"/>
<el-table-column label="操作" fixed="right" min-width="180">
<template slot-scope="scope">
<el-button size="small" type="text" @click="handleDataList(scope.row)">数据列表</el-button>
<el-button size="small" type="text" @click="handlerOpenEdit(scope.row, 1)">编辑</el-button>
<el-button size="small" type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="listPram.page"
:page-sizes="constants.page.limit"
:layout="constants.page.layout"
:total="dataList.total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</el-card>
<el-dialog
:title="editDialogConfig.isCreate === 0?'创建数据组':'编辑数据组'"
:visible.sync="editDialogConfig.visible"
>
<edit
v-if="editDialogConfig.visible"
:is-create="editDialogConfig.isCreate"
:edit-data="editDialogConfig.editData"
@hideDialog="handlerHideDialog"
/>
</el-dialog>
<el-dialog title="组合数据列表" :visible.sync="comDataListConfig.visible" fullscreen>
<cm-data-list v-if="comDataListConfig.visible" :form-data="comDataListConfig.formData" />
</el-dialog>
</div>
</template>
<script>
import * as constants from '@/utils/constants.js'
import edit from '@/views/maintain/devconfig/combinedDataEdit'
import * as systemGroupApi from '@/api/systemGroup'
import cmDataList from './combineDataList'
export default {
// name: "combinedData"
components: { edit, cmDataList },
data() {
return {
constants,
dataList: {
list: [],
total: 0
},
listPram: {
keywords: null,
page: 1,
pageSize: constants.page.limit[0]
},
editDialogConfig: {
visible: false,
isCreate: 0, // 0=创建 1=编辑
editData: {}
},
comDataListConfig: {
visible: false,
formData: {}
}
}
},
mounted() {
this.handlerGetList(this.listPram)
},
methods: {
handlerSearch() {
this.listPram.page = 1
this.handlerGetList(this.listPram)
},
handlerOpenEdit(editData, isCreate) {
isCreate === 0 ? this.editDialogConfig.editData = {} : this.editDialogConfig.editData = editData
this.editDialogConfig.isCreate = isCreate
this.editDialogConfig.visible = true
},
handlerGetList(pram) {
systemGroupApi.groupList(pram).then(data => {
this.dataList = data
})
},
handleDataList(rowData) {
if (rowData.formId <= 0) return this.$message.error('请先关联表单')
this.comDataListConfig.formData = rowData
this.comDataListConfig.visible = true
},
handleDelete(rowData) {
this.$confirm('确定删除当前数据', '提示').then(() => {
systemGroupApi.groupDelete(rowData).then(data => {
this.$message.success('删除数据成功')
setTimeout(() => {
this.handlerGetList(this.listPram)
}, 800)
})
})
},
handleSizeChange(val) {
this.listPram.limit = val
this.handlerGetList(this.listPram)
},
handleCurrentChange(val) {
this.listPram.page = val
this.handlerGetList(this.listPram)
},
handlerHideDialog() {
setTimeout(() => {
this.editDialogConfig.visible = false
this.handlerGetList(this.listPram)
}, 800)
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,108 @@
<template>
<div class="components-container">
<el-form ref="editPram" :model="editPram" label-width="100px">
<el-form-item
label="数据组名称"
prop="name"
:rules="[{ required:true, message:'填写数据组名称', trigger:['blur','change'] }]"
>
<el-input v-model="editPram.name" placeholder="数据组名称" clearable />
</el-form-item>
<el-form-item
label="数据简介"
prop="info"
:rules="[{ required:true, message:'填写数据简介', trigger:['blur','change'] }]"
>
<el-input v-model="editPram.info" placeholder="数据简介" clearable />
</el-form-item>
<el-form-item
label="表单数据ID"
prop="formId"
:rules="[{ required:true, message:'请选择表单数据', trigger:['change'] }]"
>
<span>{{ editPram.formId }}</span>
<el-button type="primary" @click="selectFormDialogConfig.visible = true">选择模板数据</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" class="btn-width100" @click="handlerSubmit('editPram')">确定</el-button>
</el-form-item>
</el-form>
<el-dialog title="选择表单模板" :visible.sync="selectFormDialogConfig.visible" append-to-body>
<form-config-list select-model @selectedRowData="handlerSelectedRowData" />
</el-dialog>
</div>
</template>
<script>
import formConfigList from '@/views/maintain/formConfig'
import * as systemGroupApi from '@/api/systemGroup'
export default {
// name: "combinedDataEdit"
components: { formConfigList },
props: {
isCreate: {
type: Number,
default: 0
},
editData: {
type: Object,
default: {}
}
},
data() {
return {
editPram: {
formId: null,
info: null,
name: null,
id: null
},
selectedFormConfigData: {},
selectFormDialogConfig: {
visible: false
}
}
},
mounted() {
this.handlerInitEditData()
},
methods: {
handlerInitEditData() {
if (this.isCreate !== 1) return
const { id, name, info, formId, createTime, updateTime } = this.editData
this.editPram.id = id
this.editPram.name = name
this.editPram.info = info
this.editPram.formId = formId
},
handlerSelectedRowData(rowData) {
this.selectedFormConfigData = rowData
this.editPram.formId = this.selectedFormConfigData.id
this.selectFormDialogConfig.visible = false
},
handlerSubmit(form) {
this.$refs[form].validate(result => {
if (!result) return
this.isCreate === 0 ? this.handlerSave(this.editPram) : this.handlerEdit(this.editPram)
})
},
handlerSave(pram) {
systemGroupApi.groupSave(pram).then(data => {
this.$message.success('添加组合数据成功')
this.$emit('hideDialog')
})
},
handlerEdit(pram) {
systemGroupApi.groupEdit(pram).then(data => {
this.$message.success('编辑组合数据成功')
this.$emit('hideDialog')
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,151 @@
<template>
<div class="components-container">
<el-form ref="editPram" :model="editPram" label-width="100px">
<el-form-item label="父级">
<!-- <span>{{ prent.name}}</span>-->
<el-cascader
v-model="editPram.pid"
:options="allTreeList"
:props="categoryProps"
disabled
style="width:100%"
/>
</el-form-item>
<el-form-item
label="分类名称"
prop="name"
:rules="[{ required:true,message:'请输入分类名称',trigger:['blur','change'] }]"
>
<el-input v-model="editPram.name" placeholder="分类名称" />
</el-form-item>
<el-form-item label="英文名称" prop="url" :rules="[{required:true,message:'英文名称不能为空',trigger:['blur','change']}]">
<el-input v-model="editPram.url" placeholder="URL" />
</el-form-item>
<el-form-item label="排序">
<el-input-number v-model="editPram.sort" :min="1" :max="10" />
</el-form-item>
<el-form-item label="状态">
<el-switch v-model="editPram.status" :active-value="true" :inactive-value="false" />
</el-form-item>
<!-- 这里的类型是无限极分类的类型不能当做配置分类的类型使用下面的扩展字段实现原有业务中的类型-->
<!-- <el-form-item label="类型" prop="type" :rules="[{required:true,message:'请选择类型',trigger:['blur']}]">-->
<!-- <el-select v-model="editPram.type" disabled>-->
<!-- <el-option v-for="item in constants.categoryType" :key="item.value"-->
<!-- :label="item.name" :value="item.value"></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="类型">-->
<!-- <el-radio-group v-model="editPram.extra">-->
<!-- <el-radio v-for="item,index in constants.configCategory" :label="item.value">-->
<!-- {{ item.label }}-->
<!-- </el-radio>-->
<!-- </el-radio-group>-->
<!-- &lt;!&ndash; <el-input type="textarea" v-model="editPram.extra" placeholder="扩展字段"/>&ndash;&gt;-->
<!-- </el-form-item>-->
<el-form-item>
<el-button size="mini" type="primary" @click="handlerSubmit('editPram')">确定</el-button>
<el-button size="mini" @click="close">取消</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import * as constants from '@/utils/constants.js'
import * as categoryApi from '@/api/categoryApi.js'
import * as selfUtil from '@/utils/ZBKJIutil.js'
export default {
// name: "configCategotyEdit"
props: {
prent: {
type: Object,
default: 0
},
isCreate: {
type: Number,
default: 0
},
editData: {
type: Object
},
allTreeList: {
type: Array
}
},
data() {
return {
constants,
editPram: {
extra: null, // 关联表单id
name: null,
pid: null,
sort: 0,
status: true,
type: constants.categoryType[5].value,
url: null,
id: 0
},
categoryProps: {
value: 'id',
label: 'name',
children: 'child',
expandTrigger: 'hover',
checkStrictly: true,
emitPath: false
},
parentOptions: []
}
},
mounted() {
this.initEditData()
},
methods: {
close() {
this.$emit('hideEditDialog')
},
initEditData() {
this.parentOptions = selfUtil.addTreeListLabelForCasCard(this.allTreeList)
if (this.isCreate !== 1) {
const { id } = this.prent
this.editPram.pid = id
} else {
const { extra, name, pid, sort, status, type, url, id } = this.editData
// this.editPram.extra = extra
this.editPram.name = name
this.editPram.pid = pid
this.editPram.sort = sort
this.editPram.status = status
this.editPram.type = type
this.editPram.url = url
this.editPram.id = id
this.editPram.extra = extra
}
},
handlerSubmit(formName) {
this.$refs[formName].validate((valid) => {
if (!valid) return
this.handlerSaveOrUpdate(this.isCreate === 0)
})
},
handlerSaveOrUpdate(isSave) {
if (isSave) {
this.editPram.pid = this.prent.id
categoryApi.addCategroy(this.editPram).then(data => {
this.$emit('hideEditDialog')
this.$message.success('创建分类成功')
})
} else {
this.editPram.pid = Array.isArray(this.editPram.pid) ? this.editPram.pid[0] : this.editPram.pid
categoryApi.updateCategroy(this.editPram).then(data => {
this.$emit('hideEditDialog')
this.$message.success('更新分类成功')
})
}
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,203 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div slot="header">
<el-form inline>
<el-form-item>
<el-button size="mini" type="primary" @click="handlerOpenAdd({id:0,name:'顶层目录'})">添加分类</el-button>
</el-form-item>
</el-form>
</div>
<el-table
ref="treeList"
:data="treeList"
style="width: 100%;"
row-key="id"
size="mini"
class="table"
highlight-current-row
:tree-props="{children: 'child', hasChildren: 'hasChildren'}"
>
<el-table-column prop="name" label="分类昵称" min-width="300">
<template slot-scope="scope">
{{ scope.row.name }}
</template>
</el-table-column>
<el-table-column label="英文名称" show-overflow-tooltip min-width="180">
<template slot-scope="scope">
<span>{{ scope.row.url }}</span>
</template>
</el-table-column>
<el-table-column label="已关联的表单" show-overflow-tooltip min-width="130">
<template slot-scope="scope">
<span>{{ scope.row.extra }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="排序" prop="sort" width="150"></el-table-column>-->
<el-table-column label="启用状态" min-width="100">
<template slot-scope="scope">
<span>{{ scope.row.status | filterYesOrNo }}</span>
</template>
</el-table-column>
<el-table-column label="操作" min-width="250" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
:disabled="scope.row.pid > 0"
@click="handlerOpenAdd(scope.row)"
>添加子目录</el-button>
<el-button type="text" size="small" @click="handleEditMenu(scope.row)">编辑</el-button>
<el-button type="text" size="small" @click="handlerOpenFormConfig(scope.row)">配置列表</el-button>
<el-button type="text" size="small" @click="handleDelMenu(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog
:title="editDialogConfig.isCreate === 0?'添加分类':'编辑分类'"
:visible.sync="editDialogConfig.visible"
destroy-on-close
:close-on-click-modal="false"
>
<edit
v-if="editDialogConfig.visible"
:prent="editDialogConfig.prent"
:is-create="editDialogConfig.isCreate"
:edit-data="editDialogConfig.data"
:biztype="editDialogConfig.biztype"
:all-tree-list="treeList"
@hideEditDialog="hideEditDialog"
/>
</el-dialog>
<el-dialog title="选择已配置的表单" :visible.sync="configFormSelectedDialog.visible">
<span class="color-red">注意表单不能重复关联</span>
<form-config-list
v-if="configFormSelectedDialog.visible"
select-model
@selectedRowData="handlerSelectedRowData"
/>
<el-form>
<el-form-item>
<el-button type="primary" style="width:100%;" @click="handlerAddFormExtra">关联</el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import * as constants from '@/utils/constants.js'
import * as categoryApi from '@/api/categoryApi.js'
import edit from '@/views/maintain/devconfig/configCategotyEdit.vue'
import * as selfUtil from '@/utils/ZBKJIutil.js'
import configList from './configList'
import formConfigList from '@/views/maintain/formConfig'
export default {
// name: "configCategroy"
components: { edit, configList, formConfigList },
props: {
},
data() {
return {
constants,
searchPram: {
status: null,
type: null
},
editDialogConfig: {
visible: false,
isCreate: 0, // 0=创建1=编辑
prent: {}, // 父级对象
data: {}
},
treeList: [],
listPram: {
pid: 0,
type: constants.categoryType[5].value,
status: null,
name: null,
page: constants.page.page,
limit: constants.page.limit[1]
},
configFormSelectedDialog: {
visible: false,
currentData: {}
}
}
},
mounted() {
this.handlerGetTreeList()
},
methods: {
handlerOpenFormConfig(rowData) {
this.configFormSelectedDialog.currentData = rowData
this.configFormSelectedDialog.visible = true
},
handlerGetList() {
categoryApi.listCategroy(this.listPram).then(data => {
// this.dataList = data
this.treeList = data.list
})
},
handlerOpenAdd(rowData) {
this.editDialogConfig.isCreate = 0
this.editDialogConfig.prent = rowData
this.editDialogConfig.data = {}
this.editDialogConfig.biztype = this.biztype
this.editDialogConfig.visible = true
},
handleEditMenu(rowData) {
this.editDialogConfig.isCreate = 1
this.editDialogConfig.data = rowData
this.editDialogConfig.prent = rowData
this.editDialogConfig.visible = true
},
handleDelMenu(rowData) {
this.$confirm('确定删除当前数据?').then(() => {
categoryApi.deleteCategroy(rowData).then(data => {
this.handlerGetTreeList()
this.$message.success('删除成功')
})
})
},
hideEditDialog() {
setTimeout(() => {
this.editDialogConfig.prent = {}
this.editDialogConfig.type = 0
this.editDialogConfig.visible = false
this.handlerGetTreeList()
}, 200)
},
handlerGetTreeList() {
// status: this.selectModel?1:-1
const _pram = { type: constants.categoryType[5].value, status: -1 }
categoryApi.treeCategroy(_pram).then(data => {
this.treeList = this.handleAddArrt(data)
})
},
handleAddArrt(treeData) {
// let _result = this.addTreeListLabel(treeData)
const _result = selfUtil.addTreeListLabel(treeData)
return _result
},
handlerSelectedRowData(rowData) {
this.configFormSelectedDialog.currentData.extra = rowData.id
},
handlerAddFormExtra() {
categoryApi.updateCategroy(this.configFormSelectedDialog.currentData).then(data => {
this.$message.success('关联表单成功')
setTimeout(() => {
this.configFormSelectedDialog.visible = false
this.handlerGetTreeList()
}, 800)
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,23 @@
<template>
<div class="components-container">
<config-list :prent-data="prentData" />
</div>
</template>
<script>
import configList from '@/components/FormGenerator/index/Home.vue'
export default {
components: { configList },
// name: "configList",
props: {
prentData: {
type: Object,
default: {}
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,56 @@
<template>
<div>
<config-list
:edit-data="editData"
:is-create="isCreate"
@getFormConfigDataResult="handlerGetFormConfigData"
/>
</div>
</template>
<script>
import configList from '@/components/FormGenerator/index/Home.vue'
import * as systemFormConfigApi from '@/api/systemFormConfig.js'
export default {
// name: "edit"
components: { configList },
props: {
editData: {
type: Object,
default: {}
},
isCreate: {
type: Number,
default: 0 // 0=创建1=编辑
}
},
data() {
return {}
},
methods: {
handlerGetFormConfigData(formConfigData) {
formConfigData.id ? this.handlerEdit(formConfigData) : this.handlerSave(formConfigData)
},
handlerSave(pram) {
systemFormConfigApi.getFormConfigSave(pram).then(data => {
this.$message.success('创建表单配置成功')
setTimeout(() => {
this.$emit('hideDialog')
}, 800)
})
},
handlerEdit(pram) {
systemFormConfigApi.getFormConfigEdit(pram).then(data => {
this.$message.success('编辑表单配置成功')
setTimeout(() => {
this.$emit('hideDialog')
}, 800)
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,142 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="container">
<el-form inline size="small">
<el-form-item label="关键字">
<el-input v-model="listPram.keywords" placeholder="请输入id名称描述" clearable class="selWidth" size="small">
<el-button slot="append" icon="el-icon-search" size="small" @click="handlerSearch" />
</el-input>
</el-form-item>
<el-form-item v-if="selectModel">
<el-button type="primary" :disabled="!selectedConfigData.id" @click="handlerConfimSelect">确定选择</el-button>
</el-form-item>
</el-form>
</div>
<el-button size="mini" type="primary" @click="handlerEditData({},0)" v-if="!selectModel">创建表单</el-button>
</div>
<el-table
:data="dataList.list"
:highlight-current-row="selectModel"
size="mini"
class="table"
highlight-current-row
@current-change="handleCurrentRowChange"
>
<el-table-column label="ID" prop="id" width="80"/>
<el-table-column label="名称" prop="name" min-width="180"/>
<el-table-column label="描述" prop="info" min-width="220"/>
<el-table-column label="更新时间" prop="updateTime" min-width="200" />
<el-table-column v-if="!selectModel" label="操作" min-width="80" fixed="right">
<template slot-scope="scope">
<el-button type="text" size="small" @click="handlerEditData(scope.row,1)">编辑</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="listPram.page"
:page-sizes="constants.page.limit"
:layout="constants.page.layout"
:total="dataList.total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</el-card>
<el-dialog
:visible.sync="editDialogConfig.visible"
title="title"
fullscreen
:title="editDialogConfig.isCreate === 0? '创建表单':'编辑表单'"
destroy-on-close
:close-on-click-modal="false"
>
<edit
v-if="editDialogConfig.visible"
:is-create="editDialogConfig.isCreate"
:edit-data="editDialogConfig.editData"
@hideDialog="handlerHide"
/>
</el-dialog>
</div>
</template>
<script>
import * as systemFormConfigApi from '@/api/systemFormConfig.js'
import * as constants from '@/utils/constants.js'
import edit from './edit'
export default {
// name: "index"
components: { edit },
props: {
selectModel: {
type: Boolean,
default: false
}
},
data() {
return {
constants,
listPram: {
keywords: null,
page: 1,
limit: constants.page.limit[0]
},
editDialogConfig: {
visible: false,
editData: {},
isCreate: 0
},
dataList: { list: [], total: 0 },
selectedConfigData: {}
}
},
mounted() {
this.handlerGetList(this.listPram)
},
methods: {
handlerSearch() {
this.listPram.page = 1
this.handlerGetList(this.listPram)
},
handlerGetList(pram) {
systemFormConfigApi.getFormConfigList(pram).then(data => {
this.dataList = data
})
},
handlerEditData(rowData, isCreate) {
if (isCreate === 0) {
this.editDialogConfig.editData = {}
} else {
this.editDialogConfig.editData = rowData
}
this.editDialogConfig.isCreate = isCreate
this.editDialogConfig.visible = true
},
handlerHide() {
this.editDialogConfig.editData = {}
this.editDialogConfig.isCreate = 0
this.editDialogConfig.visible = false
this.handlerGetList(this.listPram)
},
handleSizeChange(val) {
this.listPram.limit = val
this.handlerGetList(this.listPram)
},
handleCurrentChange(val) {
this.listPram.page = val
this.handlerGetList(this.listPram)
},
handleCurrentRowChange(rowData) {
this.selectedConfigData = rowData
},
handlerConfimSelect() {
this.$emit('selectedRowData', this.selectedConfigData)
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,15 @@
<template>
<div>
<router-view />
</div>
</template>
<script>
export default {
}
</script>
<style lang="sass" scoped>
</style>

View File

@@ -0,0 +1,110 @@
<template>
<div class="divBox">
<el-card class="box-card">
<el-form ref="pram" :model="pram" :rules="rules" label-width="100px">
<el-form-item label="管理员账号" prop="account">
<el-input v-model="pram.account" placeholder="管理员账号" :disabled="true"/>
</el-form-item>
<el-form-item label="管理员姓名" prop="realName">
<el-input v-model="pram.realName" placeholder="管理员姓名" />
</el-form-item>
<el-form-item label="原始密码">
<el-input v-model="password" placeholder="原始密码" />
</el-form-item>
<el-form-item label="新密码" prop="pwd">
<el-input
v-model="pram.pwd"
placeholder="管理员密码,不更改可以不填写"
clearable
@input="handlerPwdInput"
@clear="handlerPwdInput"
/>
</el-form-item>
<el-form-item v-if="pram.pwd" label="确认新密码" prop="repwd">
<el-input v-model="pram.repwd" placeholder="确认新密码" clearable />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handlerSubmit('pram')">提交</el-button>
<el-button @click="close('pram')">取消</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</template>
<script>
import * as systemAdminApi from '@/api/systemadmin.js'
import Cookies from 'js-cookie'
export default {
name: "index",
data() {
const validatePass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请再次输入密码'))
} else if (value !== this.pram.pwd) {
callback(new Error('两次输入密码不一致!'))
} else {
callback()
}
}
return {
password: '',
JavaInfo: JSON.parse(Cookies.get('JavaInfo')),
pram: {
account: JSON.parse(Cookies.get('JavaInfo')).account,
pwd: null,
repwd: null,
realName: null,
id: JSON.parse(Cookies.get('JavaInfo')).id
},
roleList: [],
rules: {
account: [{ required: true, message: '请填管理员账号', trigger: ['blur', 'change'] }],
pwd: [{ required: true, message: '请填管理员密码', trigger: ['blur', 'change'] }],
repwd: [{ required: true, message: '确认密码密码', validator: validatePass, trigger: ['blur', 'change'] }],
realName: [{ required: true, message: '管理员姓名', trigger: ['blur', 'change'] }],
roles: [{ required: true, message: '管理员身份', trigger: ['blur', 'change'] }]
}
}
},
methods: {
close(formName) {
this.$refs[formName].resetFields();
},
handlerSubmit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
systemAdminApi.adminUpdate(this.pram).then(data => {
this.$message.success('提交成功')
})
} else {
return false;
}
});
},
handlerPwdInput(val) {
if (!val) {
this.rules.pwd = []
this.rules.repwd = []
return
}
this.rules.pwd = [
{ required: true, message: '请填管理员密码', trigger: ['blur', 'change'] },
{ min: 6, max: 20, message: '长度6-20个字符', trigger: ['blur', 'change'] }]
this.rules.repwd = [{ required: true, message: '两次输入密码不一致', validator: (rule, value, callback) => {
if (value === '') {
callback(new Error('两次输入密码不一致!'))
} else if (value !== this.pram.pwd) {
callback(new Error('两次输入密码不一致!'))
} else {
callback()
}
}, trigger: ['blur', 'change'] }]
}
}
}
</script>
<style scoped>
</style>