4b0914c3 by lihua

标签管理添加界面排序

1 parent f47aed9b
...@@ -339,7 +339,7 @@ onMounted(() => { ...@@ -339,7 +339,7 @@ onMounted(() => {
339 <span v-if="item.unit">{{ item.unit }}</span> 339 <span v-if="item.unit">{{ item.unit }}</span>
340 </template> 340 </template>
341 <template #default="scope" v-else-if="item.type == 'switch'"> 341 <template #default="scope" v-else-if="item.type == 'switch'">
342 <el-switch v-model="scope.row[item.field]" inline-prompt 342 <el-switch v-model="scope.row[item.field]" inline-prompt :key="scope.row.guid"
343 :disabled="!item.isDisabled ? false : item.isDisabled(scope)" :active-value="item.activeValue" 343 :disabled="!item.isDisabled ? false : item.isDisabled(scope)" :active-value="item.activeValue"
344 :inactive-value="item.inactiveValue" :width="item.switchWidth" :active-text="item.activeText" 344 :inactive-value="item.inactiveValue" :width="item.switchWidth" :active-text="item.activeText"
345 :inactive-text="item.inactiveText" :before-change="() => beforeChange(scope, item)" 345 :inactive-text="item.inactiveText" :before-change="() => beforeChange(scope, item)"
......
...@@ -49,6 +49,7 @@ const tableInfo = ref({ ...@@ -49,6 +49,7 @@ const tableInfo = ref({
49 // multiple:true, 49 // multiple:true,
50 fields: [ 50 fields: [
51 { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" }, 51 { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" },
52 { label: "界面排序", field: "orderNum", width: 90, align: "center" },
52 { label: "标签名称", field: "labelName", width: 140 }, 53 { label: "标签名称", field: "labelName", width: 140 },
53 { label: "标签类型", field: "labelTypeName", width: 140 }, 54 { label: "标签类型", field: "labelTypeName", width: 140 },
54 { label: '状态', field: 'bizState', type: 'switch', activeText: '启用', inactiveText: '禁用', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 100, align: 'center' }, 55 { label: '状态', field: 'bizState', type: 'switch', activeText: '启用', inactiveText: '禁用', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 100, align: 'center' },
...@@ -76,6 +77,11 @@ const tableInfo = ref({ ...@@ -76,6 +77,11 @@ const tableInfo = ref({
76 const detail = res.data || {}; 77 const detail = res.data || {};
77 currTableData.value = Object.assign({}, currTableData.value, detail); 78 currTableData.value = Object.assign({}, currTableData.value, detail);
78 newCreateLabelFormItems.value.forEach(item => { 79 newCreateLabelFormItems.value.forEach(item => {
80 if (item.children?.length) {
81 item.children.forEach(child => child.default = detail[child.field]);
82 } else {
83 item.default = detail[item.field];
84 }
79 item.default = detail[item.field]; 85 item.default = detail[item.field];
80 }); 86 });
81 let labelRuleField = detail.labelRuleField || {}; 87 let labelRuleField = detail.labelRuleField || {};
...@@ -225,20 +231,35 @@ const newCreateLabelFormItems = ref<any>([{ ...@@ -225,20 +231,35 @@ const newCreateLabelFormItems = ref<any>([{
225 visible: true, 231 visible: true,
226 }, 232 },
227 { 233 {
228 label: '标签类型', 234 label: ' ',
229 type: 'select', 235 type: 'select-group',
230 placeholder: '请选择', 236 placeholder: '请选择',
231 field: 'labelTypeCode', 237 field: 'labelgroup',
232 default: '', 238 children: [{
233 options: labelTypeList.value, 239 label: '标签类型',
234 props: { 240 type: 'select',
235 label: "label", 241 placeholder: '请选择',
236 value: "value", 242 field: 'labelTypeCode',
237 }, 243 default: '',
238 required: true, 244 options: labelTypeList.value,
239 filterable: true, 245 props: {
240 clearable: true, 246 label: "label",
241 visible: true, 247 value: "value",
248 },
249 required: true,
250 filterable: true,
251 clearable: true,
252 visible: true,
253 }, {
254 label: '界面排序',
255 type: 'input',
256 placeholder: '请输入',
257 field: 'orderNum',
258 maxlength: 6,
259 regexp: /\D/g,
260 required: false,
261 clearable: true,
262 }],
242 }, { 263 }, {
243 type: 'radio-group', 264 type: 'radio-group',
244 label: '规则配置', 265 label: '规则配置',
...@@ -254,7 +275,7 @@ const newCreateLabelFormItems = ref<any>([{ ...@@ -254,7 +275,7 @@ const newCreateLabelFormItems = ref<any>([{
254 275
255 const newCreateLabelFormRules = ref({ 276 const newCreateLabelFormRules = ref({
256 labelName: [required('请输入标签名称')], 277 labelName: [required('请输入标签名称')],
257 labelTypeCode: [required('请选择标签类型')], 278 labelTypeCode: [required('请选择标签类型')]
258 }); 279 });
259 280
260 const ruleContentFormRef = ref(); 281 const ruleContentFormRef = ref();
...@@ -299,6 +320,7 @@ const newCreateLabelDialogInfo = ref({ ...@@ -299,6 +320,7 @@ const newCreateLabelDialogInfo = ref({
299 let submitLabel = () => { 320 let submitLabel = () => {
300 let params = Object.assign({}, info, { 321 let params = Object.assign({}, info, {
301 bizState: 'Y', 322 bizState: 'Y',
323 orderNum: info.orderNum != null ? parseInt(info.orderNum) : null,
302 labelRuleField: { 324 labelRuleField: {
303 matchChValue: matchChValue.value.value, 325 matchChValue: matchChValue.value.value,
304 matchEnValue: matchEnValue.value.value, 326 matchEnValue: matchEnValue.value.value,
...@@ -432,10 +454,15 @@ const tabChange = (val) => { ...@@ -432,10 +454,15 @@ const tabChange = (val) => {
432 454
433 const handleCreate = () => { 455 const handleCreate = () => {
434 newCreateLabelFormItems.value.forEach(item => { 456 newCreateLabelFormItems.value.forEach(item => {
435 if (item.field == 'matchType') { 457 if (item.children?.length) {
436 item.default = 1; 458 item.children[0].default = ''
459 item.children[1].default = ''
437 } else { 460 } else {
438 item.default = ''; 461 if (item.field == 'matchType') {
462 item.default = 1;
463 } else {
464 item.default = '';
465 }
439 } 466 }
440 }); 467 });
441 matchChValue.value.value = ''; 468 matchChValue.value.value = '';
...@@ -602,8 +629,8 @@ onBeforeMount(() => { ...@@ -602,8 +629,8 @@ onBeforeMount(() => {
602 }).then((res: any) => { 629 }).then((res: any) => {
603 if (res.code == proxy.$passCode) { 630 if (res.code == proxy.$passCode) {
604 labelTypeList.value = res.data || []; 631 labelTypeList.value = res.data || [];
605 let item = newCreateLabelFormItems.value.find(item => item.field == 'labelTypeCode'); 632 let item = newCreateLabelFormItems.value.find(item => item.field == 'labelgroup');
606 item && (item.options = labelTypeList.value); 633 item && (item.children[0].options = labelTypeList.value);
607 } else { 634 } else {
608 proxy.$ElMessage.error(res.msg); 635 proxy.$ElMessage.error(res.msg);
609 } 636 }
...@@ -652,12 +679,10 @@ onBeforeMount(() => { ...@@ -652,12 +679,10 @@ onBeforeMount(() => {
652 </span> 679 </span>
653 </div> 680 </div>
654 <div class="v-match"> 681 <div class="v-match">
655 <el-input v-model="matchChValue.value" maxlength="200" 682 <el-input v-model="matchChValue.value" maxlength="200" style="width: 272px;height:94px;" show-word-limit
656 style="width: 272px;height:94px;" show-word-limit type="textarea" class="no-resize" 683 type="textarea" class="no-resize" placeholder="请输入字段中文" />
657 placeholder="请输入字段中文" /> 684 <el-input v-model="matchEnValue.value" maxlength="200" style="width: 272px;height:94px;" show-word-limit
658 <el-input v-model="matchEnValue.value" maxlength="200" 685 type="textarea" class="no-resize" placeholder="请输入字段英文" />
659 style="width: 272px;height:94px;" show-word-limit type="textarea" class="no-resize"
660 placeholder="请输入字段英文" />
661 </div> 686 </div>
662 </div> 687 </div>
663 <div class="dim-label" style="margin-top: 16px;"> 688 <div class="dim-label" style="margin-top: 16px;">
...@@ -684,8 +709,7 @@ onBeforeMount(() => { ...@@ -684,8 +709,7 @@ onBeforeMount(() => {
684 <el-input v-model="row.matchValue" class="v-input" placeholder="请输入匹配值" /> 709 <el-input v-model="row.matchValue" class="v-input" placeholder="请输入匹配值" />
685 710
686 <!-- 删除按钮 --> 711 <!-- 删除按钮 -->
687 <el-button class="extra-icon" :icon="Delete" @click="deleteRow(index)" circle 712 <el-button class="extra-icon" :icon="Delete" @click="deleteRow(index)" circle style="margin-left: 8px;" />
688 style="margin-left: 8px;" />
689 </div> 713 </div>
690 </div> 714 </div>
691 715
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!