|
|
|
@ -81,6 +81,12 @@
|
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
export default { |
|
|
|
|
name: '/financialsector/FinanceHome', |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<script setup> |
|
|
|
|
import { ref, defineAsyncComponent, getCurrentInstance } from 'vue'; |
|
|
|
|
import { getDictionaryBiz } from '@/api/system/dict'; //字典 |
|
|
|
@ -119,9 +125,9 @@ const request = ref({}); //用于保存会显的值
|
|
|
|
|
const templateInfo = ref({}); |
|
|
|
|
// 菜单列表 |
|
|
|
|
const ServiceList = ref([]); |
|
|
|
|
// 字典公共函数 |
|
|
|
|
async function updateDictionary(targetArray, dictionaryType) { |
|
|
|
|
await getDictionaryBiz(dictionaryType) |
|
|
|
|
// 字典公共函数 |
|
|
|
|
async function updateDictionary(targetArray, dictionaryType) { |
|
|
|
|
await getDictionaryBiz(dictionaryType) |
|
|
|
|
.then(res => { |
|
|
|
|
console.log(res, '字典'); |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
@ -150,8 +156,7 @@ async function executeCheckedResults(results) {
|
|
|
|
|
await provideData(); |
|
|
|
|
} |
|
|
|
|
pageLoading.value = false; |
|
|
|
|
console.log(results,'results'); |
|
|
|
|
|
|
|
|
|
console.log(results, 'results'); |
|
|
|
|
} |
|
|
|
|
// 页面初始化必要请求 |
|
|
|
|
const onLoad = async () => { |
|
|
|
@ -173,8 +178,8 @@ const onLoad = async () => {
|
|
|
|
|
form.value.ServiceType.includes(item.value) |
|
|
|
|
); |
|
|
|
|
// 激活菜单设置为已经存在的 |
|
|
|
|
await executeCheckedResults(result); |
|
|
|
|
Tabmenu.value=result[0].label;//设置第一个菜单 |
|
|
|
|
await executeCheckedResults(result); |
|
|
|
|
Tabmenu.value = result[0].label; //设置第一个菜单 |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
@ -196,8 +201,8 @@ onLoad();
|
|
|
|
|
const isChecked = async (val, isChecked = false, msg = false) => { |
|
|
|
|
console.log(msg, '当前msg'); |
|
|
|
|
console.log(val, 'val'); |
|
|
|
|
if (msg) { |
|
|
|
|
val.state = !val.state; |
|
|
|
|
if (msg) { |
|
|
|
|
val.state = !val.state; |
|
|
|
|
Tabmenu.value = val.label; |
|
|
|
|
if (!val.check) { |
|
|
|
|
form.value.ServiceType.push(val.value); |
|
|
|
@ -209,7 +214,7 @@ const isChecked = async (val, isChecked = false, msg = false) => {
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}) |
|
|
|
|
.then( async () => { |
|
|
|
|
.then(async () => { |
|
|
|
|
val.check = false; |
|
|
|
|
val.state = false; |
|
|
|
|
let indexToRemove = await form.value.ServiceType.findIndex(item => item == val.value); |
|
|
|
@ -263,56 +268,47 @@ const isChecked = async (val, isChecked = false, msg = false) => {
|
|
|
|
|
}; |
|
|
|
|
// 点击移除 |
|
|
|
|
const removeTag = value => { |
|
|
|
|
form.value.ServiceType.push(value);//先加回去 |
|
|
|
|
console.log(value,'value'); |
|
|
|
|
form.value.ServiceType.push(value); //先加回去 |
|
|
|
|
console.log(value, 'value'); |
|
|
|
|
ElMessageBox.confirm('关闭当前模板会重置数据!是否关闭?', '提示', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}) |
|
|
|
|
.then( async () => { |
|
|
|
|
let indexToRemove = await form.value.ServiceType.findIndex(item => item == value); |
|
|
|
|
if (indexToRemove !== -1) { |
|
|
|
|
form.value.ServiceType.splice(indexToRemove, 1); |
|
|
|
|
} |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(async () => { |
|
|
|
|
let indexToRemove = await form.value.ServiceType.findIndex(item => item == value); |
|
|
|
|
if (indexToRemove !== -1) { |
|
|
|
|
form.value.ServiceType.splice(indexToRemove, 1); |
|
|
|
|
} |
|
|
|
|
if (form.value.ServiceType.length) { |
|
|
|
|
Tabmenu.value = ServiceList.value.find(res => res.state).label; |
|
|
|
|
} |
|
|
|
|
if ($route.query.id || templateInfo.value.code) { |
|
|
|
|
let data = { |
|
|
|
|
checkType: value, |
|
|
|
|
templateId: $route.query.id, |
|
|
|
|
}; |
|
|
|
|
$_tempDelpriceTemplate(data).then(res => { |
|
|
|
|
console.log(res, '删除成功返回值'); |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
ElMessage({ |
|
|
|
|
type: 'success', |
|
|
|
|
message: res.data.msg, |
|
|
|
|
}); |
|
|
|
|
// 激活菜单设置为已经存在的 |
|
|
|
|
if (form.value.ServiceType.length) { |
|
|
|
|
Tabmenu.value = ServiceList.value.find(res => res.state).label; |
|
|
|
|
} |
|
|
|
|
if ($route.query.id || templateInfo.value.code) { |
|
|
|
|
let data = { |
|
|
|
|
checkType:value, |
|
|
|
|
templateId: $route.query.id, |
|
|
|
|
}; |
|
|
|
|
$_tempDelpriceTemplate(data).then(res => { |
|
|
|
|
console.log(res, '删除成功返回值'); |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
ElMessage({ |
|
|
|
|
type: 'success', |
|
|
|
|
message: res.data.msg, |
|
|
|
|
}); |
|
|
|
|
// 激活菜单设置为已经存在的 |
|
|
|
|
if (form.value.ServiceType.length) { |
|
|
|
|
Tabmenu.value = ServiceList.value.find(res => res.state).label; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
ElMessage({ |
|
|
|
|
type: 'success', |
|
|
|
|
message: '操作成功', |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
ServiceList.value.find(res => res.value == value).check = false; |
|
|
|
|
ServiceList.value.find(res => res.value == value).state = false; |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
ElMessage({ |
|
|
|
|
type: 'success', |
|
|
|
|
message: '操作成功', |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
ServiceList.value.find(res => res.value == value).check = false; |
|
|
|
|
ServiceList.value.find(res => res.value == value).state = false; |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
// 给子页面传递数据 |
|
|
|
|
const provideData = data => { |
|
|
|
@ -369,7 +365,6 @@ const handleChange = () => {
|
|
|
|
|
.name { |
|
|
|
|
font-size: 16px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|