ソースを参照

add selectComponent & search form styles

docs_0727
lb 1年前
コミット
ff77ab8546
6個のファイルの変更55行の追加10行の削除
  1. +8
    -5
      src/components/BaseSearchForm.vue
  2. +30
    -0
      src/components/noTemplateComponents/selectComponent.js
  3. +4
    -1
      src/views/modules/pms/material/config.js
  4. +4
    -1
      src/views/modules/pms/materialType/config.js
  5. +5
    -2
      src/views/modules/pms/productionLine/config.js
  6. +4
    -1
      src/views/modules/pms/workSequence/config.js

+ 8
- 5
src/components/BaseSearchForm.vue ファイルの表示

@@ -10,13 +10,14 @@
:prop="opt.prop ?? '' + index"
:rules="opt.bind?.rules ? opt.bind.rules : undefined"
>
<el-input v-if="opt.input" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable />
<el-select v-if="opt.select" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable>
<el-input v-if="opt.input" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable size="small" />
<el-select v-if="opt.select" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable size="small">
<el-option v-for="item in opt.select" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-date-picker v-if="opt.timerange" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable />
<el-date-picker v-if="opt.timerange" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable size="small" />
<el-upload
v-if="opt.upload"
size="small"
:key="'upload_' + Math.random().toString()"
class="inline-block pl-3"
action="https://jsonplaceholder.typicode.com/posts/"
@@ -26,7 +27,9 @@
<el-button
v-if="opt.button && (!opt.button.permission || $hasPermission(opt.button.permission))"
:key="'button' + Math.random().toString()"
size="small"
:type="opt.button.type"
v-bind="opt.bind"
@click="handleBtnClick(opt.button.name)"
>{{ opt.button.name }}</el-button
>
@@ -37,7 +40,7 @@

<script>
export default {
name: "",
name: "BaseSearchForm",
props: {
headConfig: {
type: Object,
@@ -65,7 +68,7 @@ export default {
console.log("[BaseSearchForm] configs:", JSON.parse(JSON.stringify(this.headConfig)));

this.headConfig.fields.forEach((field, index) => {
// 没有 field.prop ,则为按钮之类的
// 没有 field.prop ,则为按钮之类的
if (!field.prop) return;

if (!this.dataForm[field.prop]) {


+ 30
- 0
src/components/noTemplateComponents/selectComponent.js ファイルの表示

@@ -0,0 +1,30 @@
// import i18n from '@/i18n'

export default {
name: 'SelectComponent',
props: {
injectData: {
type: Object,
default: () => ({})
}
},
data() {
return {
// TODO: i18n
defaultText: '查看详情'
}
},
methods: {
emitClick() {
// console.log('inject data:' ,this.injectData)
this.$emit('emit-data', {
type: this.injectData.head?.actionName || 'select-change-action',
data: this.injectData.head?.emitFullData ? this.injectData : this.injectData.id
})
}
},
render: function (h) {
// console.log('button content:', this.injectData)
return h('span', null, [h('el-button', { props: { type: 'text' }, style: { paddingLeft: 0 }, on: { click: this.emitClick } }, this.injectData.head?.buttonContent || this.defaultText)])
}
}

+ 4
- 1
src/views/modules/pms/material/config.js ファイルの表示

@@ -42,9 +42,12 @@ export default function () {
},
{
button: {
type: 'plain',
type: 'primary',
name: '新增',
permission: ''
},
bind: {
plain: true,
}
}
]


+ 4
- 1
src/views/modules/pms/materialType/config.js ファイルの表示

@@ -40,9 +40,12 @@ export default function () {
},
{
button: {
type: 'plain',
type: 'primary',
name: '新增',
permission: 'pms:materialType:save'
},
bind: {
plain: true,
}
}
]


+ 5
- 2
src/views/modules/pms/productionLine/config.js ファイルの表示

@@ -39,10 +39,13 @@ export default function () {
},
{
button: {
type: "plain",
type: "primary",
name: "新增",
permission: "pms:productionLine:save",
permission: "pms:productionLine:save"
},
bind: {
plain: true,
}
},
];



+ 4
- 1
src/views/modules/pms/workSequence/config.js ファイルの表示

@@ -37,9 +37,12 @@ export default function () {
},
{
button: {
type: 'plain',
type: 'primary',
name: '新增',
permission: 'pms:workSequence:save'
},
bind: {
plain: true,
}
}
]


読み込み中…
キャンセル
保存