Commit 1239f3fd authored by 赵啸非's avatar 赵啸非

修改菜单切换

parent 5442d286
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
<el-form-item :label="label" :prop="prop" class='my-form-field'> <el-form-item :label="label" :prop="prop" class='my-form-field'>
<slot> <slot>
<el-input show-word-limit :maxlength="maxLength" :disabled='disabled' :placeholder='placeholder' v-model="field" @change="emit" @input="emit" @focus="emit" v-if='type === "text"' :class="inputClass" :clearable='clearable'></el-input> <el-input show-word-limit :maxlength="maxLength" :disabled='disabled' :placeholder='placeholder' v-model="field" @change="emit" @input="emit" v-if='type === "text"' :class="inputClass" :clearable='clearable'></el-input>
<el-input show-word-limit :maxlength="maxLength" :disabled='disabled' :placeholder='placeholder' v-model="field" @change="emit" @input="emit" type='password' v-if='type === "password"'></el-input> <el-input show-word-limit :maxlength="maxLength" :disabled='disabled' :placeholder='placeholder' v-model="field" @change="emit" @input="emit" type='password' v-if='type === "password"'></el-input>
<el-input-number :disabled='disabled' v-model="field" size="small" :placeholder='placeholder' @change="emit" @input="emit" v-if='type === "num"'></el-input-number> <el-input-number :disabled='disabled' v-model="field" size="small" :placeholder='placeholder' @change="emit" @input="emit" v-if='type === "num"'></el-input-number>
<el-input show-word-limit :disabled='disabled' :placeholder='placeholder' v-model="field" :maxlength="maxLength" <el-input show-word-limit :disabled='disabled' :placeholder='placeholder' v-model="field" :maxlength="maxLength"
@change="emit" :rows='rows' @input="emit" v-if='type === "textarea"' type='textarea' :autosize="textareaSize" :class="inputClass"></el-input> @change="emit" :rows='rows' @input="emit" v-if='type === "textarea"' type='textarea' :autosize="textareaSize" :class="inputClass"></el-input>
<!-- 一级 --> <!-- 一级 -->
...@@ -64,12 +64,12 @@ export default { ...@@ -64,12 +64,12 @@ export default {
type: [String, Number, Array], type: [String, Number, Array],
}, },
// 组件的el-col span宽度 1-24,默认12 // 组件的el-col span宽度 1-24,默认12
span: { span: {
type: Number, type: Number,
default: 12, default: 12,
}, },
// 字段类型: text,password,textarea,select,radio,checkbox,date,datetime // 字段类型: text,password,textarea,select,radio,checkbox,date,datetime
type: { type: {
type: String, type: String,
default: 'text', default: 'text',
}, },
...@@ -93,10 +93,6 @@ export default { ...@@ -93,10 +93,6 @@ export default {
type: String, type: String,
default: '', default: '',
}, },
multiple:{
type: Boolean,
default: false,
},
// 字段所需的枚举类型 // 字段所需的枚举类型
enumData: { enumData: {
type: Object, type: Object,
...@@ -144,7 +140,7 @@ export default { ...@@ -144,7 +140,7 @@ export default {
emit() { emit() {
this.$emit('input', this.newVal) this.$emit('input', this.newVal)
this.$emit('change', this.newVal) this.$emit('change', this.newVal)
this.$emit('focus') //this.$emit('focus', this.newVal)
this.$emit('cascaderChange',this.newVal) this.$emit('cascaderChange',this.newVal)
} }
}, },
......
...@@ -125,8 +125,6 @@ export default { ...@@ -125,8 +125,6 @@ export default {
if(this.id){ if(this.id){
this.form.parentId=this.id this.form.parentId=this.id
} }
console.log("data",data)
console.log("name",this.form.name)
this.open = true; this.open = true;
}, },
afterSubmit(data) { afterSubmit(data) {
...@@ -147,6 +145,7 @@ export default { ...@@ -147,6 +145,7 @@ export default {
}, },
// 表单重置 // 表单重置
reset() { reset() {
this.resetForm("form");
this.form = { this.form = {
name : "", name : "",
url : null, url : null,
...@@ -165,10 +164,11 @@ export default { ...@@ -165,10 +164,11 @@ export default {
authType : 3, authType : 3,
createUserName : null, createUserName : null,
}; };
this.resetForm("form");
}, },
resetForm(refName) { resetForm(refName) {
if (this.$refs[refName]) { if (this.$refs[refName]) {
console.log("重置表单")
this.$refs[refName].resetFields(); this.$refs[refName].resetFields();
} }
}, },
......
...@@ -24,7 +24,6 @@ export default { ...@@ -24,7 +24,6 @@ export default {
methods: { methods: {
afterRender(data) { afterRender(data) {
data.data = handleTree(data.data, "id", "parentId"); data.data = handleTree(data.data, "id", "parentId");
console.log("tree data:",data.data)
this.menuOptions = data.data; this.menuOptions = data.data;
this.$refs.layoutTable.showType = "treetable" this.$refs.layoutTable.showType = "treetable"
}, },
...@@ -116,24 +115,6 @@ export default { ...@@ -116,24 +115,6 @@ export default {
}) })
} }
}, },
// 操作菜单状态
changeStatus(row, column) {
return (
<my-switch
confirm
url='/menu/save'
row={row}
onChange={this.statusChange}
value={this.tableData.data}
onInput={(data)=>{
this.tableData.data = data;
}}/>
)
},
statusChange() {
this.$store.dispatch('login');
},
}, },
data() { data() {
return { return {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment