liunan #10
|
@ -3,6 +3,7 @@
|
|||
:style="{ width }"
|
||||
:prefix-icon="iconClass"
|
||||
clear-icon="ag-icon-clear"
|
||||
ref="datepickerref"
|
||||
v-model="dateArr"
|
||||
v-bind="attrs"
|
||||
v-on="Listeners"
|
||||
|
@ -206,13 +207,17 @@ export default {
|
|||
: "ag-icon-prefix-show";
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.value,'this.value',this.$attrs);
|
||||
if (Array.isArray(this.value)&&this.range){
|
||||
mounted() {
|
||||
if (Array.isArray(this.value)&&this.range){
|
||||
this.dateArr = [this.value[0] || "", this.value[1] || ""];
|
||||
} else {
|
||||
this.dateArr = this.value;
|
||||
}
|
||||
for(const key in this.$refs.datepickerref){
|
||||
if(!this[key]&&key!='value'){
|
||||
this[key]=this.$refs.datepickerref[key];
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value: {
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
<el-transfer :data="item.data" v-bind="item" v-model="formValue[item.enName]" v-if="item.type=='ag-transfer'" size="small"></el-transfer>
|
||||
<agNumberRange v-bind="item" v-model="formValue[item.enName]" v-if="item.type=='ag-numberRange'" size="small"/>
|
||||
<agMultifunctionSearch v-bind="item" v-model="formValue[item.enName]" v-if="item.type=='ag-multifunction-search'" size="small"/>
|
||||
<agQuery v-bind="item" v-model="formValue[item.enName]" v-if="item.type=='ag-query'" size="small"/>
|
||||
</slot>
|
||||
</el-form-item>
|
||||
</ag-col>
|
||||
|
@ -60,6 +61,8 @@ import agUpload from './../../agUpload/src/index.vue';
|
|||
import agColorPicker from './../../agColorPicker/src/index.vue';
|
||||
import agNumberRange from './../../agNumberRange/src/index.vue';
|
||||
import agMultifunctionSearch from './../../agMultifunctionSearch/src/index.vue';
|
||||
import agQuery from './../../agQuery/src/index.vue';
|
||||
|
||||
|
||||
export default{
|
||||
name:"agForm",
|
||||
|
@ -72,7 +75,8 @@ export default{
|
|||
agUpload:agUpload,
|
||||
agColorPicker,
|
||||
agNumberRange,
|
||||
agMultifunctionSearch
|
||||
agMultifunctionSearch,
|
||||
agQuery
|
||||
},
|
||||
props:{
|
||||
data:{
|
||||
|
@ -99,8 +103,7 @@ export default{
|
|||
for(const key in this.$refs.formref){
|
||||
if(!this[key]&&key!='value'){
|
||||
this[key]=this.$refs.formref[key];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import agNumberRange from './src'
|
||||
import agNumberRange from './src';
|
||||
|
||||
// 为组件提供 install 安装方法,供按需引入
|
||||
agNumberRange.install = function (Vue) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
@input="handleStartInput"
|
||||
@blur="handleInputBlur"
|
||||
></el-input>
|
||||
<span class="separator">{{ rangeSeparator }}</span>
|
||||
<span class="separator">{{ rangeSeparator||'-'}}</span>
|
||||
<el-input
|
||||
:style="{ width: width + 'px' }"
|
||||
:size="size"
|
||||
|
@ -63,6 +63,9 @@ export default {
|
|||
// 结束数值
|
||||
endValue: "",
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
watch: {
|
||||
value(newValue) {
|
||||
|
|
|
@ -56,7 +56,10 @@
|
|||
},
|
||||
},
|
||||
},
|
||||
mounted(){
|
||||
model: {
|
||||
prop: 'values', // 明确指定 prop 为 'value'
|
||||
event: 'onSearch' // 自定义事件名,用于更新 value
|
||||
}, mounted(){
|
||||
let newinput=this.inputs.map((g)=>g.label);
|
||||
this.placeholder="请选择"+newinput.join("/");
|
||||
},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import agTable from './src'
|
||||
import agTable from './src';
|
||||
|
||||
// 为组件提供 install 安装方法,供按需引入
|
||||
agTable.install = function (Vue) {
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="agtablebox">
|
||||
<el-table v-bind="$attrs" v-on="$listeners" :data="data" size="small" :header-cell-style="$attrs.headerCellStyle||{backgroundColor:'#f7f7f7'}">
|
||||
<el-table v-bind="$attrs" v-on="$listeners" :data="data" size="small" :header-cell-style="$attrs.headerCellStyle||{backgroundColor:'#f7f7f7'}" ref="tableref">
|
||||
<el-table-column v-for="item,index in columns" :key="index" v-bind="item">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="item.soltName">
|
||||
|
@ -16,6 +16,7 @@
|
|||
</el-table>
|
||||
<div class="agtablefooter">
|
||||
<el-pagination
|
||||
ref="paginationref"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page.sync="currentPage"
|
||||
|
@ -38,7 +39,16 @@
|
|||
};
|
||||
},
|
||||
mounted() {
|
||||
|
||||
for(const key in this.$refs.tableref){
|
||||
if(!this[key]&&key!='value'){
|
||||
this[key]=this.$refs.tableref[key];
|
||||
}
|
||||
}
|
||||
for(const key in this.$refs.paginationref){
|
||||
if(!this[key]&&key!='value'&&key!='pageSizes'){
|
||||
this[key]=this.$refs.paginationref[key];
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSizeChange(e){
|
||||
|
|
|
@ -6,4 +6,4 @@ agTabs.install = function (Vue) {
|
|||
}
|
||||
|
||||
// 导出组件
|
||||
export default agTabs
|
||||
export default agTabs;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-tabs class="ag-tabs" v-bind="$attrs" v-on="$listeners">
|
||||
<el-tabs class="ag-tabs" v-bind="$attrs" v-on="$listeners" ref="tabsref">
|
||||
<slot v-if="!tabsData.length" name="default" />
|
||||
<el-tab-pane
|
||||
v-else
|
||||
|
@ -31,6 +31,13 @@ export default {
|
|||
},
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
for(const key in this.$refs.tabsref){
|
||||
if(!this[key]&&key!='value'){
|
||||
this[key]=this.$refs.tabsref[key];
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
|
|
|
@ -4,7 +4,14 @@
|
|||
import agUpdate from './agUpload';
|
||||
import agForm from './agForm';
|
||||
import agColorPicker from './agColorPicker';
|
||||
|
||||
import agQuery from './agQuery';
|
||||
import agTable from './agTable';
|
||||
import agTabs from './agTabs';
|
||||
import agDialog from './agDialog';
|
||||
import agPagination from './agPagination';
|
||||
import agRow from './agRow';
|
||||
import agCol from './agCol';
|
||||
|
||||
// 注册组件
|
||||
|
||||
// 组件列表
|
||||
|
@ -13,7 +20,14 @@
|
|||
agSelect,
|
||||
agUpdate,
|
||||
agForm,
|
||||
agColorPicker
|
||||
agColorPicker,
|
||||
agQuery,
|
||||
agTable,
|
||||
agDialog,
|
||||
agTabs,
|
||||
agPagination,
|
||||
agCol,
|
||||
agRow
|
||||
]
|
||||
|
||||
// 定义 install 方法,接收 Vue 作为参数(使用 use 注册插件,那么所有的组件都会被注册)
|
||||
|
@ -38,5 +52,13 @@
|
|||
agInput,
|
||||
agSelect,
|
||||
agUpdate,
|
||||
agForm
|
||||
agForm,
|
||||
agColorPicker,
|
||||
agQuery,
|
||||
agTable,
|
||||
agDialog,
|
||||
agTabs,
|
||||
agPagination,
|
||||
agCol,
|
||||
agRow
|
||||
}
|
51
src/App.vue
51
src/App.vue
|
@ -376,7 +376,56 @@ export default {
|
|||
{label:"IMEI/机器编号",span:12,type:"ag-input-number",enName:'imei',value:'43543',placeholder:'请输入IMEI/机器编号',size:'small',clearable:true,max:10,min:2,step:2,show:true},
|
||||
{label:"质检码",span:12,type:"ag-rate",value:'',enName:'ser_sn',placeholder:'请输入质检码',size:'small',clearable:true,show:true,options:[{value:'1',label:'112'},{value:'2',label:'2223'}]},
|
||||
{label:"质检时间",span:12,type:"ag-multifunction-search",enName:'time',showAlpha:true,size:'small',colorFormat:'hsv',show:true},
|
||||
{label:"头像",span:12,type:"ag-upload",enName:'avatar',placeholder:'请输入质检码',size:'small',clearable:true,show:true,limit:4,multiple:true},
|
||||
{label:"头像",span:12,type:"ag-query",enName:'avatar',inputs:[
|
||||
{
|
||||
label:"分类",
|
||||
elem:'el-select',
|
||||
name:"class",
|
||||
options:[
|
||||
{
|
||||
value: "Chengdu",
|
||||
label: "成都",
|
||||
},
|
||||
{
|
||||
value: "Shenzhen",
|
||||
label: "深圳",
|
||||
},
|
||||
{
|
||||
value: "Guangzhou",
|
||||
label: "广州",
|
||||
},
|
||||
{
|
||||
value: "Dalian",
|
||||
label: "大连",
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
label:"品牌",
|
||||
elem:'el-select',
|
||||
name:"brand",
|
||||
placeholder:"请输入品牌",
|
||||
options:[]
|
||||
},
|
||||
{
|
||||
label:"型号",
|
||||
elem:'el-select',
|
||||
name:"model",
|
||||
options: []
|
||||
},
|
||||
{
|
||||
label:"颜色",
|
||||
elem:'el-select',
|
||||
name:"color",
|
||||
options:[]
|
||||
},
|
||||
{
|
||||
label:"容量",
|
||||
elem:'el-select',
|
||||
name:"capacity",
|
||||
options:[]
|
||||
}
|
||||
],placeholder:'请输入质检码',size:'small',clearable:true,show:true,limit:4,multiple:true},
|
||||
],
|
||||
formvalue:{
|
||||
order_sn:"11",
|
||||
|
|
Loading…
Reference in New Issue