This commit is contained in:
2022-08-11 14:22:23 +08:00
parent 0ddba21e1c
commit a1056abe80
29 changed files with 161 additions and 87 deletions

View File

@@ -6,8 +6,9 @@
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button @click="addOrEdit()">测试</el-button>
<el-button v-if="$hasPermission('monitoring:product:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<!-- <el-button @click="addOrEdit()">测试</el-button> -->
<!-- <el-button v-if="$hasPermission('monitoring:product:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> -->
<el-button v-if="$hasPermission('monitoring:product:save')" type="primary" @click="addOrEdit()">新增</el-button>
</el-form-item>
</el-form>
<!-- <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
@@ -52,17 +53,17 @@
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> -->
<base-dialog v-if="showbasedialog" ref="basedialog" :configs="addOrUpdateConfigs" @refreshDataList="getDataList"></base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './product-add-or-update'
// import AddOrUpdate from './product-add-or-update'
import BaseTable from '@/components/base-table'
import TableOperateComponent from '@/components/base-table/components/operationComponent'
import TableTextComponent from '@/components/base-table/components/detailComponent'
// import TableTextComponent from '@/components/base-table/components/detailComponent'
import BaseDialog from '@/components/base-dialog/addOrUpdate'
import moment from 'moment'
import dictListMixin from '@/mixins/dictlist-module'
@@ -77,27 +78,7 @@ const tableConfigs = [
{ prop: 'code', name: '产品编码' },
{ prop: 'specifications', name: '规格' },
{ prop: 'unitDictValue', name: '单位', filter: dictFilter(UnitDictTypeId) },
// { prop: 'unitDictValue', name: '单位value对应到数据字典label_value' },
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['viewAttr', 'delete'] }
// { "prop": "id", "name": "ID" },
// { "prop": "description", "name": "描述" },
// { "prop": "externalCode", "name": "外部编码,用于对照外部系统的编码" },
// { "prop": "area", "name": "一单位的面积(平方米)" },
// { "prop": "processTime", "name": "加工一单位产品需要的时间" },
// {
// "prop": "typeDictValue",
// "name": "产品类型value对应到数据字典label_value"
// },
// { "prop": "enabled", "name": "启用状态:0 、停用1、启用" },
// { "prop": "remark", "name": "备注" },
// { "prop": "valid", "name": "删除标志,是否有效:1 可用 0不可用" },
// { "prop": "creatorId", "name": "创建人" },
// { "prop": "creatorName", "name": "创建人姓名" },
// { "prop": "createTime", "name": "添加时间" },
// { "prop": "updaterId", "name": "更新人" },
// { "prop": "updaterName", "name": "更新人姓名" },
// { "prop": "version", "name": "版本号" }
]
const addOrUpdateConfigs = {
@@ -113,10 +94,9 @@ const addOrUpdateConfigs = {
name: 'processTime',
label: '加工时间',
placeholder: '请输入加工时间',
type: 'number', // type: number(input+number) | default(input) | textarea | select(options在父组件里获取) | datetime
type: 'number',
required: true,
rules: [
// 除了required之外的验证规则
{
type: 'number',
trigger: 'blur',
@@ -129,9 +109,6 @@ const addOrUpdateConfigs = {
'specifications',
{
name: 'typeDictValue',
// rules: [
// {required: true, trigger: 'blur'}
// ],
label: '产品类型', // 对于非常见属性最好自己指定label
type: 'select',
options: [
@@ -149,7 +126,6 @@ const addOrUpdateConfigs = {
}
],
operations: [
// { name: 'reset', url: true },
{ name: 'cancel', url: true, showAlways: true },
{ name: 'save', url: '/monitoring/product', permission: '', showOnEdit: false },
{ name: 'update', url: '/monitoring/product', permission: '', showOnEdit: true }
@@ -166,13 +142,6 @@ const addOrUpdateConfigs = {
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
]
}
// extraComponents: [
// {
// name: 'CompName',
// label: 'markdown编辑器',
// component: () => import('xx.vue')
// }
// ]
}
export default {
@@ -195,7 +164,7 @@ export default {
}
},
components: {
AddOrUpdate,
// AddOrUpdate,
BaseTable,
BaseDialog
},
@@ -204,7 +173,6 @@ export default {
this.addOrUpdateConfigs.fields.forEach(item => {
if (item.name) {
if (item.name === 'typeDictValue') {
console.log('dict : ', this.dictList)
item.options = this.dictList[ProductTypeDictTypeId]
} else if (item.name === 'unitDictValue') {
item.options = this.dictList[UnitDictTypeId]