|
|
@@ -32,6 +32,34 @@
|
|
|
placeholder="请输入菜单标识"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="菜单图标" prop="piconUrl" v-if="activeName !== '3'">
|
|
|
+ <el-popover
|
|
|
+ placement="bottom-start"
|
|
|
+ width="460"
|
|
|
+ trigger="click"
|
|
|
+ @show="$refs['iconSelect'].reset()"
|
|
|
+ >
|
|
|
+ <IconSelect
|
|
|
+ ref="iconSelect"
|
|
|
+ @selected="selected"
|
|
|
+ :active-icon="menuForm.piconUrl"
|
|
|
+ />
|
|
|
+ <el-input
|
|
|
+ slot="reference"
|
|
|
+ v-model="menuForm.piconUrl"
|
|
|
+ placeholder="点击选择图标"
|
|
|
+ readonly
|
|
|
+ >
|
|
|
+ <svg-icon
|
|
|
+ v-if="menuForm.piconUrl"
|
|
|
+ slot="prefix"
|
|
|
+ :icon-class="menuForm.piconUrl"
|
|
|
+ style="width: 25px; height: 25px"
|
|
|
+ />
|
|
|
+ <i v-else slot="prefix" class="el-icon-search el-input__icon" />
|
|
|
+ </el-input>
|
|
|
+ </el-popover>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="路由地址:" prop="purl" v-if="activeName !== '1'">
|
|
|
<el-input
|
|
|
v-model="menuForm.purl"
|
|
|
@@ -65,12 +93,13 @@
|
|
|
<script>
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
import { addMenuFn, updateMenuFn } from "@/api/system";
|
|
|
-
|
|
|
+import IconSelect from "@/components/IconSelect";
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
Treeselect,
|
|
|
+ IconSelect,
|
|
|
},
|
|
|
props: {
|
|
|
activeName: {
|
|
|
@@ -99,6 +128,7 @@ export default {
|
|
|
pstat: null,
|
|
|
pcode: null,
|
|
|
permissionShow: null,
|
|
|
+ piconUrl: "",
|
|
|
},
|
|
|
addMenuRules: {
|
|
|
permissionShow: {
|
|
|
@@ -151,6 +181,13 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 选择图标
|
|
|
+ selected(name) {
|
|
|
+ this.menuForm = {
|
|
|
+ ...this.menuForm,
|
|
|
+ piconUrl: name,
|
|
|
+ };
|
|
|
+ },
|
|
|
initializeForm() {
|
|
|
console.log(this.checkId, "checkid");
|
|
|
this.menuOptions[0].children.push(...this.tableData);
|
|
|
@@ -170,6 +207,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
if (this.row && this.title === "编辑") {
|
|
|
+ console.log(this.row, this.row.piconUrl, "piconUrl");
|
|
|
this.menuForm = {
|
|
|
parentId: this.row.parentId,
|
|
|
pname: this.row.permissionName,
|
|
|
@@ -177,6 +215,7 @@ export default {
|
|
|
pstat: this.row.permissionState,
|
|
|
pcode: this.row.permissionCode,
|
|
|
permissionShow: this.row.permissionShow,
|
|
|
+ piconUrl: this.row.permissionIconUrl,
|
|
|
};
|
|
|
if (this.activeName === "1") {
|
|
|
this.$nextTick(() => {
|
|
|
@@ -186,6 +225,7 @@ export default {
|
|
|
parentId: 0,
|
|
|
pcode: this.row.permissionCode,
|
|
|
permissionShow: this.row.permissionShow,
|
|
|
+ piconUrl: this.row.permissionIconUrl,
|
|
|
};
|
|
|
});
|
|
|
}
|
|
|
@@ -272,4 +312,8 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style scoped lang="scss"></style>
|
|
|
+<style scoped lang="scss">
|
|
|
+::v-deep .el-input__prefix {
|
|
|
+ line-height: 50px !important;
|
|
|
+}
|
|
|
+</style>
|