¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div>
|
| | | <template v-for="(item, index) in options">
|
| | | <template v-if="values.includes(item.dictValue)">
|
| | | <span
|
| | | v-if="item.listClass == 'default' || item.listClass == ''"
|
| | | :key="item.dictValue"
|
| | | :index="index"
|
| | | :class="item.cssClass"
|
| | | >{{ item.dictLabel }}</span
|
| | | >
|
| | | <el-tag
|
| | | v-else
|
| | | :key="item.dictValue"
|
| | | :index="index"
|
| | | :type="item.listClass == 'primary' ? '' : item.listClass"
|
| | | :class="item.cssClass"
|
| | | >
|
| | | {{ item.dictLabel }}
|
| | | </el-tag>
|
| | | </template>
|
| | | </template>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | export default {
|
| | | name: "DictTag",
|
| | | props: {
|
| | | options: {
|
| | | type: Array,
|
| | | default: null,
|
| | | },
|
| | | value: [String, Array],
|
| | | },
|
| | | computed: {
|
| | | values() {
|
| | | if (this.value) {
|
| | | return Array.isArray(this.value) ? this.value : [this.value];
|
| | | } else {
|
| | | return [];
|
| | | }
|
| | | },
|
| | | },
|
| | | };
|
| | | </script>
|
| | | <style scoped>
|
| | | .el-tag + .el-tag {
|
| | | margin-left: 10px;
|
| | | }
|
| | | </style> |
| | |
| | | <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="åå
¸ç¼ç " align="center" prop="dictCode" />
|
| | | <el-table-column label="åå
¸æ ç¾" align="center" prop="dictLabel" />
|
| | | <el-table-column label="åå
¸æ ç¾" align="center" prop="dictLabel">
|
| | | <template slot-scope="scope">
|
| | | <span v-if="scope.row.listClass == '' || scope.row.listClass == 'default'">{{scope.row.dictLabel}}</span>
|
| | | <el-tag v-else :type="scope.row.listClass == 'primary' ? '' : scope.row.listClass">{{scope.row.dictLabel}}</el-tag>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column label="åå
¸é®å¼" align="center" prop="dictValue" />
|
| | | <el-table-column label="åå
¸æåº" align="center" prop="dictSort" />
|
| | | <el-table-column label="ç¶æ" align="center" prop="status" :formatter="statusFormat" />
|
| | | <el-table-column label="ç¶æ" align="center" prop="status">
|
| | | <template slot-scope="scope">
|
| | | <dict-tag :options="statusOptions" :value="scope.row.status"/>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column label="夿³¨" align="center" prop="remark" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" width="180">
|
| | | <template slot-scope="scope">
|
| | |
| | | <el-form-item label="æ°æ®é®å¼" prop="dictValue">
|
| | | <el-input v-model="form.dictValue" placeholder="请è¾å
¥æ°æ®é®å¼" />
|
| | | </el-form-item>
|
| | | <el-form-item label="æ ·å¼å±æ§" prop="cssClass">
|
| | | <el-input v-model="form.cssClass" placeholder="请è¾å
¥æ ·å¼å±æ§" />
|
| | | </el-form-item>
|
| | | <el-form-item label="æ¾ç¤ºæåº" prop="dictSort">
|
| | | <el-input-number v-model="form.dictSort" controls-position="right" :min="0" />
|
| | | </el-form-item>
|
| | | <el-form-item label="åæ¾æ ·å¼" prop="listClass">
|
| | | <el-select v-model="form.listClass">
|
| | | <el-option
|
| | | v-for="item in listClassOptions"
|
| | | :key="item.value"
|
| | | :label="item.label"
|
| | | :value="item.value"
|
| | | ></el-option>
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¶æ" prop="status">
|
| | | <el-radio-group v-model="form.status">
|
| | |
| | | <script>
|
| | | import { listData, getData, delData, addData, updateData, exportData } from "@/api/system/dict/data";
|
| | | import { listType, getType } from "@/api/system/dict/type";
|
| | | // åå
¸æ ç¾ç»ä»¶ï¼ä½¿ç¨é¢ç¹å¯å¨å
¨å±æè½½ï¼
|
| | | import DictTag from '@/components/DictTag'
|
| | |
|
| | | export default {
|
| | | name: "Data",
|
| | | components: {
|
| | | DictTag
|
| | | },
|
| | | data() {
|
| | | return {
|
| | | // é®ç½©å±
|
| | |
| | | title: "",
|
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå±
|
| | | open: false,
|
| | | // æ°æ®æ ç¾åæ¾æ ·å¼
|
| | | listClassOptions: [
|
| | | {
|
| | | value: "default",
|
| | | label: "é»è®¤"
|
| | | },
|
| | | {
|
| | | value: "primary",
|
| | | label: "主è¦"
|
| | | },
|
| | | {
|
| | | value: "success",
|
| | | label: "æå"
|
| | | },
|
| | | {
|
| | | value: "info",
|
| | | label: "ä¿¡æ¯"
|
| | | },
|
| | | {
|
| | | value: "warning",
|
| | | label: "è¦å"
|
| | | },
|
| | | {
|
| | | value: "danger",
|
| | | label: "å±é©"
|
| | | }
|
| | | ],
|
| | | // ç¶ææ°æ®åå
¸
|
| | | statusOptions: [],
|
| | | // ç±»åæ°æ®åå
¸
|
| | |
| | | this.total = response.total;
|
| | | this.loading = false;
|
| | | });
|
| | | },
|
| | | // æ°æ®ç¶æåå
¸ç¿»è¯
|
| | | statusFormat(row, column) {
|
| | | return this.selectDictLabel(this.statusOptions, row.status);
|
| | | },
|
| | | // åæ¶æé®
|
| | | cancel() {
|
| | |
| | | </router-link>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column label="ç¶æ" align="center" prop="status" :formatter="statusFormat" />
|
| | | <el-table-column label="ç¶æ" align="center" prop="status">
|
| | | <template slot-scope="scope">
|
| | | <dict-tag :options="statusOptions" :value="scope.row.status"/>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column label="夿³¨" align="center" prop="remark" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" width="180">
|
| | | <template slot-scope="scope">
|
| | |
| | |
|
| | | <script>
|
| | | import { listType, getType, delType, addType, updateType, exportType, refreshCache } from "@/api/system/dict/type";
|
| | | // åå
¸æ ç¾ç»ä»¶ï¼ä½¿ç¨é¢ç¹å¯å¨å
¨å±æè½½ï¼
|
| | | import DictTag from '@/components/DictTag'
|
| | |
|
| | | export default {
|
| | | name: "Dict",
|
| | | components: {
|
| | | DictTag
|
| | | },
|
| | | data() {
|
| | | return {
|
| | | // é®ç½©å±
|
| | |
| | | this.loading = false;
|
| | | }
|
| | | );
|
| | | },
|
| | | // åå
¸ç¶æåå
¸ç¿»è¯
|
| | | statusFormat(row, column) {
|
| | | return this.selectDictLabel(this.statusOptions, row.status);
|
| | | },
|
| | | // åæ¶æé®
|
| | | cancel() {
|